aspose file tools*
The moose likes Ant, Maven and Other Build Tools and the fly likes Problem in Ant build.xml to call WSDL2Java.bat Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Problem in Ant build.xml to call WSDL2Java.bat" Watch "Problem in Ant build.xml to call WSDL2Java.bat" New topic
Author

Problem in Ant build.xml to call WSDL2Java.bat

soumik palit
Greenhorn

Joined: Jan 03, 2007
Posts: 1
Hello,

I am using Apache Axis2 1.1 for making a Web Service. I want to generate the files using WSDL in the Ant build.xml file. To do this I need to call the WSDL2Java.bat file with the required arguments from the build.xml file.

Trying to generate the sources from the command prompt succeeds. Here are the args:
X:/oem_tools_1/ApacheAxis/bin/wsdl2java.bat -uri X:\pse_appl1\ONCMS\SCWebservice\resources\META-INF\EMServices.wsdl -o X:/pse_appl1/ONCMS/SCWebservice/generated/EMServices -ss -ssi -sd -d xmlbeans -g
Also, I tried calling a test.bat file from my build.xml => this also succeds. Here is the part of the build.xml:
<exec executable="${ApacheAxis.generated}/test.bat">
<arg value="E:\temp\log.log" />
<arg value="E:\myProj\batchFiles\log.log" />
</exec>

However, when I call the wsdl2java.bat file from the build.xml, I get the following error:
<task location="X:\pse_appl1\ONCMS\SCWebservice\build.xml:62: " name="exec" time="0 seconds"></task>
<stacktrace><![CDATA[X:\pse_appl1\ONCMS\SCWebservice\build.xml:62: Execute failed: java.io.IOException: CreateProcess: X:\oem_tools_1\ApacheAxis\bin\wsdl2java.bat -uri X:/pse_appl1/ONCMS/SCWebservice/resources/META-INF/EMServices.wsdl -o X:/pse_appl1/ONCMS/SCWebservice/generated/EMServices -ss -ssi -sd -d xmlbeans -g error=5
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:620)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:653)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
Caused by: java.io.IOException: CreateProcess: X:\oem_tools_1\ApacheAxis\bin\wsdl2java.bat -uri X:/pse_appl1/ONCMS/SCWebservice/resources/META-INF/EMServices.wsdl -o X:/pse_appl1/ONCMS/SCWebservice/generated/EMServices -ss -ssi -sd -d xmlbeans -g error=5
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
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:585)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:834)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:435)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:449)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:576)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:617)
... 10 more
--- Nested Exception ---
java.io.IOException: CreateProcess: X:\oem_tools_1\ApacheAxis\bin\wsdl2java.bat -uri X:/pse_appl1/ONCMS/SCWebservice/resources/META-INF/EMServices.wsdl -o X:/pse_appl1/ONCMS/SCWebservice/generated/EMServices -ss -ssi -sd -d xmlbeans -g error=5
at java.lang.ProcessImpl.create(Native Method)
at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
at java.lang.ProcessImpl.start(ProcessImpl.java:30)
at java.lang.ProcessBuilder.start(ProcessBuilder.java:451)
at java.lang.Runtime.exec(Runtime.java:591)
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:585)
at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:834)
at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:435)
at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:449)
at org.apache.tools.ant.taskdefs.ExecTask.runExecute(ExecTask.java:576)
at org.apache.tools.ant.taskdefs.ExecTask.runExec(ExecTask.java:617)
at org.apache.tools.ant.taskdefs.ExecTask.execute(ExecTask.java:452)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
at org.apache.tools.ant.Task.perform(Task.java:364)
at org.apache.tools.ant.Target.execute(Target.java:341)
at org.apache.tools.ant.helper.ProjectHelper2.parse(ProjectHelper2.java:142)
at org.apache.tools.ant.ProjectHelper.configureProject(ProjectHelper.java:91)
at org.apache.tools.ant.Main.runBuild(Main.java:653)
at org.apache.tools.ant.Main.startAnt(Main.java:187)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:246)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:67)
]]></stacktrace>

Here is the part of the build.xml:
<exec dir="X:/oem_tools_1/ApacheAxis/bin" executable="X:/oem_tools_1/ApacheAxis/bin/wsdl2java.bat" os="Windows XP">
<arg value="-uri" />
<!--arg value="${WSDL.dir}/EMServices.wsdl" /-->
<arg value="X:/pse_appl1/ONCMS/SCWebservice/resources/META-INF/EMServices.wsdl" />
<arg value="-o" />
<!--arg value="${ApacheAxis.generated}/EMServices" /-->
<arg value="X:/pse_appl1/ONCMS/SCWebservice/generated/EMServices" />
<arg value="-ss" />
<arg value="-ssi" />
<arg value="-sd" />
<arg value="-d" />
<arg value="xmlbeans" />
<arg value="-g" />
</exec>

Can anyone please tell me where the problem is???!!!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Problem in Ant build.xml to call WSDL2Java.bat