One Star

Export job as webservice (WAR) on Tomcat

Hi all,
I'm trying to export a job as a web service on Tomcat 5.5.
My job is very simple as you can see with the attach picture.
I can create the war file and deploy it onto tomcat but when i try to call the webservice from a new job (with the tWebServiceInput component) i get the following error :

Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultSubcode:
faultString: The AXIS engine could not find a target service to invoke! targetService is migration_xml_plat.wsdl
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:i3info9


I also attach the picture of the job calling the webservice.
Have you any ideas ?
Best regards,
Sam.

  • Data Integration
27 REPLIES
Employee

Re: Export job as webservice (WAR) on Tomcat

Hello,
Assuming that migration_xml_plat is your job name, your url should end with migration_xml_plat?wsdl and not migration_xml_plat.wsdl
Regards,
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi mhirt,
Thanks for your answer.
Actually i made a mistake, the job name was "not migration_xml_plat" but "migration_plat_xml". I also changed the url with migration_plat_xml?wsdl as you said but...i always get the same error message :
Exception in component tWebServiceInput_1
AxisFault
faultCode: {http://xml.apache.org/axis/}Server.NoService
faultSubcode:
faultString: The AXIS engine could not find a target service to invoke! targetService is migration_plat_xml
faultActor:
faultNode:
faultDetail:
{http://xml.apache.org/axis/}hostname:i3info9
The AXIS engine could not find a target service to invoke! targetService is migration_plat_xml

This is really strange because i can change the job name with everything i want and i always get the same error message. it seems that the component can't find the service however the war file seems to be well deployed on the tomcat server. (When i go in the tomcat manager, everything seems to run well)
I try something else : call the service directly from the navigator with the url : http://localhost:8080/mig/services/migration_plat_xml?method=runJob.
Here is the message i get :



ns1Smiley Frustratederver.NoService

The AXIS engine could not find a target service to invoke! targetService is migration_plat_xml


i3info9




Any ideas ?
Best regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

I'm still working on this problem and i have some remarks/questions :
Tomcat is running correctly and the job war file is deployed. When i enter the following url "http://localhost:8080/mig/services/", i get the following message :
AXIS error
No service is available at this URL

It is like if the service had not been created.
Thus, my questions are : Do i need to insert a specific component in the job i want to export as webservice ? Do i need to check some parameters before exporting the job ? Do i need to update config files after the job is deployed on the server ?
Best regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi,
I have exactly the same issue Smiley Sad
I have found some old post in the forum, but no solution. It seem export to web service work with some version Talend but not with the others Smiley Sad
I have try with 3.2.0 and 3.2.1, I get the same result.
There is no .wsdl files in the generated war, it is normal ?
Someone to us on this issue ?
Thanks in advance.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi Xaelis,
I'm happy to find someone experiencing the same problem.
I also saw these old posts but there weren't really numerous. I was starting to believe that i was doing something wrong. Well, it still could be but if you encounter the same issue maybe it's not...

According to the wsdl file, actually, there is one in the war file. We can find it in the wsdl directory but it seems that nothing is link to it...
Is it a bug ? Someone to us on this issue ?
Best regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

According to the wsdl file, actually, there is one in the war file. We can find it in the wsdl directory but it seems that nothing is link to it...

Hu ? I have no wsdl directory in my generated war file (neither if I export in a zip file).
This is my generated war structure :
project.war
\META-INF
\MANIFEST.INF
\WEB-INF
\classes
\- ...
\lib
\- ...
\src
\- ...
\server-config.wsdd
\web.xml
I can make a little sample project if it can help to help us to solve the issue. But actually it is happed with all project.
I can also make a bug report, but I want to be sure it is really a bug and not a bad use.
One Star

Re: Export job as webservice (WAR) on Tomcat

This is my generated war structure :
project.war
\META-INF
\MANIFEST.INF
\WEB-INF
\classes
\- ...
\lib
\- ...
\src
\- ...
\server-config.wsdd
\web.xml

This is weird, here is my generated war structure :
\META-INF
\MANIFEST.INF
\WEB-INF
\classes
\- ...
\lib
\- ...
\src
\- ...
\attachments
\- nothing
\server-config.wsdd
\web.xml
\wsdl
\.wsdl
I do have a wsdl file but it seems that it doesn't change anything since i get the error message indicating that no target service can be found. I'm using TOS 2.3.1. I could also generate a basic war file but i don't know how i could attach it to a post.
Actually i'm in the same situation as you. I don't know if it is a bug or a bad use of TOS.
Best regards,
Sam.
Employee

Re: Export job as webservice (WAR) on Tomcat

Hello,
There are two very different topic :
Xaelis, the export as war should not generate such a tree.
There was a bug in 2.2 (3169). The same problem occurs when trying to export a job containing a tSendMail.
This problem is resolved in 2.3.
Is this your case ? Else, can you precise what components your job is using and what is your TOS version ?
etletisme,
Your war looks good.
Can you try this URL : http://localhost:8080/mig/servlet/AxisServlet ?
Another question : what is your Java version ?
Regards,
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi mhirt,
Thanks for your answer.
I've got some interresting news : As you said, it seems that i have a problem wih my jdk.
Actually, i had no jdk installed on my workstation and i was using the jre1.6 update 3.
This week end, I was working on my issue on my laptop using jdk1.5.0_11 and jre1.5.0_11, the same release of TOS and tomcat as i use at work. I tried once more to export a job coming from the project i'm working on at work and....it worked !
In the generated archive, i had a new directory :
META-INF
\MANIFEST.INF
\WEB-INF
\classes
\- ...
\lib
\- ...
\src
\- ...
\attachments
\- nothing
\server-config.wsdd
\web.xml
\wsdl
\.wsdl
\wsdd
\-...

This morning, at work, i tried to deploy the archive generated on my laptop on my workstation...it worked.
Then i installed jdk1.5.0_15 on my workstation. When the installation finished, i opened the talend preferences->talend and i changed the java url, then i went in java->Installed JRE's, i add my jdk5 and remove the jre1.6.
TOS recompiled its classes and the workspace.
To finish, i tried to export a job with this new configuration but...nothing to do, the wsdd directory was still missig in the generating archive.
Maybe i forgot to update something in the preferences ?
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi etletisme
I also have your problem
Do you have some news ?
Thanks Smiley Happy
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi maverick,
Actually i haven't found the solution. I'm exporting my jobs as webservices using my laptop.
I guess that my workstation isn't well configured and i think that the problem comes from the jdk. Unfortunately, the point is that i haven't admin privileges on my workstation. Thus, i can't uninstall jre 1.6.3 in order to force the system to use jdk5.
Well i guess that the issue comed from the jdk but maybe there's something else.
Regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hello
I have test it on JDK (build 1.5.0_10-b03) and JDK (build 1.6.0-b105) and JDK (build 1.6.0_05-b13) with Tomcat (jakarta-tomcat-5.0.28.exe), it seems OK. ( I post a screen. )
I don't doubt your description with export webservice problem, but I need more detail info to represent it on our site and then locate it root cause. (such as: OS version, JDK version, TOS version, job screen, and the problem, that we can rebuilt the environment as yours, and represent the problem. )
thanks for your deeply info to help us locate this problem.
Regards
xtan
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi xtan,

I made an example (see the attached picture). I'm working on Windows XP SP2. At the beginning, only jres were running on my workstation: jre1.6.0.02 and jre1.6.0.03.
On the contrary, on my laptop, where everything is working fine, i have also windows XP SP2 but i've got JDK1.5.0_11.
So i asked an admin (i haven't admin priviledges) to install a jdk5 on my workstation where i had the two jres 1.6.0. The admin installed jdk1.5.0_15.
Then i went in the Talend properties to change the java url and so indicate to Talend that jdk5 has to be used and not the jre1.6.0.
But, it still not work : when i export the job in war, it always misses the wsdd directory. Maybe there is a conflict between jdk5 and jre6.
To finish, about tomcat, i'm using using tomcat-5.5.26. The server runs well : when i deploy an archive created on my laptop, the webservice in working fine.
To sum up, the problem comes only from the creation of the war archive : the wsdd directory is missing.

I hope i've been enough precise.
regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hello etletisme
Thanks for your very detailed step info, and take effort to post a screen with much info.
Your info help me a lot, I can focus eyes on the wsdd file and JDK version.
the result is just as your conclusion before, it is the JDK version problem.
Here I describle it like this:
1. TOS-All-r11699-V2.3.1 in this directory C:/test/TOS-All-r11699-V2.3.1, run on jdk1.5.0_10 or jdk1.6.0_05, they work normally, export the war file no problem.
2. TOS-All-r11699-V2.3.1 in this directory C:/my test/TOS-All-r11699-V2.3.1, run on jdk1.5.0_10, it is OK; but run on jdk1.6.0_05, it can't export the right war file, there miss the wsdd folder.
Here, we can get a simple conclusion, jdk1.6.0_05 with "blank char in file path" (C:/my test/), there can generate the problem.
the same problem in WTP, @see:http://dev.eclipse.org/newslists/news.eclipse.webtools/msg14639.html
(the one use the directory:c:\Eclipse\Eclipse3.3 Europa JEE), and there is not a resolve solution in WTP till now, I think maybe it is not his problem, maybe axis.jar problem or jdk1.6.0_05 problem.
==============
Additional, here, I want to desrible "TOS and JRE" issue.
1. TOS running JRE, we can use the -vm paramater when run TOS, like this: -vm C:\Program Files\Java\jre1.6.0_05\bin\javaw.exe
2. TOS compile job code with JRE, we can assign here: TOS->Window->Preferences->Java->Installed JREs
3. TOS run Job with JRE, we can assign here: TOS->Window->Preferences->Talend (Java interpreter)
==============
the root problem about this bug:
there we can get a message in TOS console when export failed:
java.net.MalformedURLException: unknown protocol: e
at java.net.URL.(URL.java:574)
at java.net.URL.(URL.java:464)
at java.net.URL.(URL.java:413)
at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650)
at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:771)
at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:107)
at com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:225)
at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:369)
at org.apache.axis.utils.XMLUtils.newDocument(XMLUtils.java:420)
at org.apache.axis.wsdl.symbolTable.SymbolTable.populate(SymbolTable.java:482)
at org.apache.axis.wsdl.gen.Parser$WSDLRunnable.run(Parser.java:361)
at java.lang.Thread.run(Thread.java:619)
and then locate it deeply to JDK source, there I find it is a JDK bug. In order to describle it simply, here I
make a simple test case, it run in jdk1.5.0_10 and jdk1.6.0_05, there will get different result (@see post screen), the bug export war file is just related with it.
public class Test4 {
public static void main(String[] args) throws MalformedURIException, MalformedURLException {
String expandSystemId = com.sun.org.apache.xerces.internal.impl.XMLEntityManager.expandSystemId(
"E:\\Talend ALL\\eclipse_3 3/talendExporter/AAA.wsdl", null, false);
System.out.println(expandSystemId);
URL location = new URL(expandSystemId);
}
}
today, I only get this info about the bug, if I will get more later, will post here.
regards
xtan
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi xtan,
Thanks you so much ! it runs perfectly !
On my workstation, Talend was installed inside a directory called "Espace travail". I changed "Espace travail" into "Espace_travail" and everything is now working fine.
Regards,
Sam.
One Star

Re: Export job as webservice (WAR) on Tomcat

Dear xtan,
Thank you very much indeed !
You were very helpfull on this problem, and my web service is also working perfectly now that I changed all the paths !
Thanks again
BUT... I have an other problem...
When I launch the job with the url http://localhost:8080/Talend/services/demo?method=runJob, the page is loading and doesn't stop loading until I stop it manualy. My output files are not generated
In TOS, the job takes about 10 sec to complete.
You can see the job graph in my screenshot here : http://www.talendforge.org/forum/viewtopic.php?id=2513
There is no space in input and output file's path, and I checked the permissions on the folders.
That's great to take time for helping Talend users Smiley Wink
PS : etletisme, je suis sûr qu'il y a plus de français qu'on ne le pense sur ce forum Smiley Happy
One Star

Re: Export job as webservice (WAR) on Tomcat

Hello maverick
About your new problem, I have checked it. There really exist a problem here, but it is not your fault, I think it also is not our TOS fault, it is related with the special use case problem when deploy war file.
Here I describe it like:
1. make a simple job: tFileInputDelimited-->tLogRow, then export war file, deploy to tomcat, it is ok.
2. make a simple job: tFileInputXML --->tLogRow, then export war file, deploy to tomcat, it is failed.
(I think if we deploy to other J2ee Server, not tomcat maybe it is Ok.)
locate it deeply, there get the root problem is the jar files conflict:
1. in this directory: C:\Program Files\Apache Software Foundation\Tomcat 5.0\common\endorsed
we can find there exist a jar file: xercesImpl.jar
2. in war file, we can get it in: C:\Program Files\Apache Software Foundation\Tomcat 5.0\webapps\DDD_0.1\WEB-INF\lib\xercesImpl.jar. This jar file is used by tFileInputXML.
3. delete all the jars in the directory "endorsed";
or rename the "endorsed" to "endorsed_AAA";
or delete all jars in "endorsed", move "DDD_0.1\WEB-INF\lib\xercesImpl.jar" to it.
then start tomcat, it is OK.
as discuss above, the root problem is tomcat use the xercesImpl.jar to parse the web.xml file, the tFileInputXMl also use it two parse it. tomcat with a low version because it only need deal with common xml file, tFileInputXML use a high version for supporting the sepcial xml file parsing requirement.
here, we can image that if we deploy the war file to other J2ee Server, maybe it is OK.
I also add a post screen.
Regards
xtan
One Star

Re: Export job as webservice (WAR) on Tomcat

xtan,
All is now working perfectly.
My boss is happy, and so am I ! Smiley Happy
Thanks to you Smiley Wink
Have a nice day
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi,
Same thing here. The WAR gets generated ok but with only META-INF and WEB-INF folders. No \wsdl or \wsdd so no service is recognized by AXIS. Any suggestion?.
TOS: version 2.3.2.r12707 installed in C:\Talend-r12707-V2.3.2
JAVA_HOME=C:\Archiv~1\Java\jdk1.5.0_06
Thanks,

Eduardo.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi,
Just to report that I have downgraded to:
TOS: version 2.3.1.r11699 installed in C:\Talend-r11699-V2.3.1
JAVA_HOME=C:\Archiv~1\Java\jdk1.5.0_06
And now works fine.

Eduardo.
PS: I have also tried with version 2.4.0M1.r13097 and, although the wsdl and wsdd got generated, the service didn't work. Same error.
Employee

Re: Export job as webservice (WAR) on Tomcat

Hello,
If you have wsdl and wsdd it should really work.
The questions are
What is not working ?
What URL are you calling ?
One Star

Re: Export job as webservice (WAR) on Tomcat

Hi,
No it does not work. The error is the same that the others have reported: "The AXIS engine could not find a target service to invoke!".
The URL is ok. The same URL works in the version I have reported: http://localhost:8080/sit6-ws/services/GetEmployeeById?method=runJob&args=--context_param%20id=22481M
Strange indeed. I'll report again if I find something.

Eduardo.
Community Manager

Re: Export job as webservice (WAR) on Tomcat

Hello Eduardo
I have checked that the job can works fine with TOS2.3.1 and TOS2.3.2, but failed with TOS2.4.0M1(although the wsdl and wsdd folder got generated)
and reported a 3529
Do you have some new finding?
Best regards

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

Re: Export job as webservice (WAR) on Tomcat

Hi,
same problem, the wsdl is not generated.
Talend version : 2.4.0RC1
Java version : Sun JDK 1.6.0.6
The exception in Talend is :
ERROR: java.lang.ClassNotFoundException: project.ws1_0_1.ws1
java.lang.Throwable: java.lang.ClassNotFoundException: project.ws1_0_1.ws1
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobJavaScriptsWSManager$TalendJava2WSDL.generateWSDL(Unknown Source)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobJavaScriptsWSManager.getWSDLFile(Unknown Source)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobJavaScriptsWSManager.getExportResources(Unknown Source)
at org.talend.repository.ui.wizards.exportjob.JavaJobScriptsExportWSWizardPage.getExportResources(Unknown Source)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizardPage.finish(Unknown Source)
at org.talend.repository.ui.wizards.exportjob.JobScriptsExportWizard.performFinish(Unknown Source)
at org.eclipse.jface.wizard.WizardDialog.finishPressed(WizardDialog.java:742)
at org.eclipse.jface.wizard.WizardDialog.buttonPressed(WizardDialog.java:373)
at org.eclipse.jface.dialogs.Dialog$2.widgetSelected(Dialog.java:616)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:227)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.jface.window.Window.runEventLoop(Window.java:820)
at org.eclipse.jface.window.Window.open(Window.java:796)
at org.talend.repository.ui.actions.ExportJobScriptAction.run(Unknown Source)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:498)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:545)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:490)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:402)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1101)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:3319)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:2971)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.java:2389)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:2353)
at org.eclipse.ui.internal.Workbench.access$4(Workbench.java:2219)
at org.eclipse.ui.internal.Workbench$4.run(Workbench.java:466)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:289)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:461)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:149)
at org.talend.rcp.intro.Application.start(Unknown Source)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:153)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:106)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:76)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:363)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:504)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:443)
at org.eclipse.equinox.launcher.Main.run(Main.java:1169)
at org.eclipse.equinox.launcher.Main.main(Main.java:1144)
Caused by: java.lang.ClassNotFoundException: project.ws1_0_1.ws1
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:251)
at org.apache.axis.utils.ClassUtils$2.run(ClassUtils.java:187)
at java.security.AccessController.doPrivileged(Native Method)
at org.apache.axis.utils.ClassUtils.loadClass(ClassUtils.java:160)
at org.apache.axis.utils.ClassUtils.forName(ClassUtils.java:100)
at org.apache.axis.wsdl.fromJava.Emitter.setCls(Emitter.java:2079)
at org.talend.repository.ui.wizards.exportjob.scriptsmanager.JobJavaScriptsWSManager$TalendJava2WSDL.run(Unknown Source)
... 46 more
ERROR: JAVA2WSDL fail, the deploy.wsdd file don't exist. So, the server-config.wsdd file will be invalid
Community Manager

Re: Export job as webservice (WAR) on Tomcat

Hello
same problem, the wsdl is not generated.

I have checked that it works fine with TOS2.4.0RC1 on windows xp. Which OS are you using?
How do you deploy the job in webapp?
Please read the related 1686.
Best regards

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

Re: Export job as webservice (WAR) on Tomcat

My OS is Linux Ubuntu 8.04.
One Star

Re: Export job as webservice (WAR) on Tomcat

Hello lmichenaud
the problem : java.lang.ClassNotFoundException: project.ws1_0_1.ws1
It is because java source ----> java class, there have some problem. we use the eclipse jdt mechanism.
I can't get your description in my local , can you provider us more info?
1. all jobs have this bug?
2. all workspaces have this bug? (change workspaces like this, unzip the TOS to anther folder, and use it as a new one.)
3. all TOS have this problem? (you can try the TOS-All-r13892-V2.3.3 or TOS-All-r13097-V2.4.0M1)
4. all JDK version have this bug? (you only need try one JDK1.5, one JDK 1.6, it is enough.)
5. what is your OS version?
I expect your more info, thanks for support.