JSP java server page

One Star

JSP java server page

Hello,
I have an application whitch is developped in Netbeans(java langage).I want to execute my appliction in a server.
I ask if talend open studio can integrate my source code in Java Server Page(JSP) to execute it in this server.
Please can you anser me.
Thank you
One Star

Re: JSP java server page

When you export your job as a POJO or war file, yes u can.
For POJO, you'll have to add the jars to your classpath and call correctly the main class. U could also use Runtime.exec() to launch the script/shell TOS generate.
For the war, you'll have to deploy the archive in your container and call the URL from the jsp as needed.
One Star

Re: JSP java server page

Hello;
thank you for your anser.
Please can you explain more your idea. I tried to follow your steps but i can't touch the resuly.
this is my source codde in netbeans(Slot).
Please can you help me.
thank you
One Star

Re: JSP java server page

hello;
someone can help me please.
thank you.
One Star

Re: JSP java server page

Hello,
I have the same problem.
I made a job using Talend : extract data from excel file and insert them into a database Oracle.
I want tou execute this job in my project JSP only when I click at a button.
First, Il should import the excel file to the server ans then call this job.
Can anyone help me.
Thank u.
Community Manager

Re: JSP java server page

Hello All
Now I will show you how to run Talend Job in JSP page.
1) Export job as 'Axis webServices(WAR)', about how to export talend job and deploy it on server and run it as webservice, please see 1686.
here, I export a war file: test_0.1.war and put it to webapps foder of tomcat.(note that test_0.1.war will be unziped automatically to a folder: test_0.1 under webapps)
2)In talend, create a new job and put a tWebservicesInput component in Job editor, type in wsdl url in WSDL field. (See screenshot1)
3)Go to 'Advanced Setting' tab, select 'AdvanceD Use' option, then click on 'WSDL2Java' button to generate a stub client code. (See screenshot2). About 'WSDL2Java' button on tWebserviceInput, please see 6226.
4)Copy all the jar files which locates on webapps\test_0.1\WEB-INF\lib,(see screenshot3) then open your J2EE project in MyEclipse or other equate IDE, paste these jar files into lib folder. (see sreenshot4)
5)Create a new package called routines under src folder.(see screenshot5)
6)Create the same interface and class as client code generated on TOS. eg: create a interface called Test_PortType, copy the code of Test_PortType from TOS, then paste it on MyEclipse. (see screenshot6)
7)Call the client code inside a JSP page as you do on TOS. (see screenshot7)
8)Deploy your project and start server.
9)Run the JSP page and all are OK now Smiley Wink (see screenshot8)

Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: JSP java server page

Hello,
thank you Shong for your reply
It works fine. But I have some questions about this solution :
1- What I Shoud make in Schema Type of tWebServiceInput
2- How can I make my webservice and my project test.war parameterizable?
In your example, the address "http://localhost.../WSDL" is not dynamic. So I can put it in "context" but how can I change it when I put my projet in another server?

3- Can I integrate the job test_0.1.war to my project? Because I prefer deploy only one project and not two : test_0.1.war ans myProject.war.
Thank you
Community Manager

Re: JSP java server page

Hello
1- What I Shoud make in Schema Type of tWebServiceInput
2- How can I make my webservice and my project test.war parameterizable?
In your example, the address "http://localhost.../WSDL" is not dynamic. So I can put it in "context" but how can I change it when I put my projet in another server?

We just use tWebServiceInput to generate the stub client code here, don't use it to run the job. To generate the client code, we need the address "http://localhost.../WSDL" and click on the 'WSDL2Java' button, so don't need care the schema. If there is a red X on the component, you can add one column on schema, but it is not important.
3- Can I integrate the job test_0.1.war to my project? Because I prefer deploy only one project and not two : test_0.1.war ans myProject.war.

test_0.1.war is an example, I export my job scritp and name it as test_0.1, you can call it any name in your case. To run the Talend job in a JSP page, I think you should know:
1) How to export a job in .war type.
2) How to deploy a job in webservice and run it out of TOS.
3) How to call the webservice on tWebServiceInput and know 'WSDL2Java' button usage.

Best regards
shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: JSP java server page

Hello Everyone!
I am trying to implement the job in jsp as per shong's steps shown below.
But when i click on wsdl2java button, it generates only stub class.
It doesnot generate any port type interface.
Even for the simplest jobs also, the result is same.
Can any one help?
As my jobs are running fine from browser and from TOS.
Thanks in advance.
-- Krsna
One Star

Re: JSP java server page

Hi friends -
Just curious, has anyone been able to use the "export job scripts" functionality as a .war when also using contexts? I know, I know, this appears very obvious as it even allows you to select the context upon export, but I am unable to successfully move from one context to another when referencing it as a webapp within tomcat; no matter what I do, it seems to reset to the Default context, which, of course, throws an error in the tomcat logs (very plain to see).
Any suggestions?
Thanks,
One Star

Re: JSP java server page

I didn't explain it very well. I've been able to do exactly as you (and the tutorial) have explained. So, I've been able to deploy the exported .war as a webapp within tomcat with no problems. Where I am running into difficulty is when it comes to contexts. When exporting, I select the context appropriate for the export (in this case, it is NOT the default), however the default context is the only one referenced (I can see this in the tomcat logs, so I know it's using the one I did NOT select). What am I doing wrong? Is there a particular java file, config file, etc. where I can verify that the desired context is setup?
Thanks,
Community Manager

Re: JSP java server page

Hello bbeliaso
Sorry, I did't see your post.
When exporting, I select the context appropriate for the export (in this case, it is NOT the default), however the default context is the only one referenced

Which version of TOS did you use? Maybe it was bug. I am using the latest version TOS3.1.4 and it list all the context group. See my screenshots.
Best regards

shong
----------------------------------------------------------
Talend | Data Agility for Modern Business
One Star

Re: JSP java server page

Thank You very much, Shong!
Your explain helped me, but I have else some questions
at the first, I don't need to use jsp-pages, and I must run my job from another
Java application.
I'm not very well in Java-programming yet, and with talend work for a little time,
but!
value, which returns from TOS something like "[],
but now, if i runned my project, i need to see standard console(to see, have my program errors or not)
and than i need to open console for tomcat.
this is not very useful for normal programming...
and why return type for runJob is String[][] if normally program returned just number?