Hi, When building ui components, it generates code from given wsdl using WSDL2Java. However, it fails with following error
[java] java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.6.0_13\jre\bin\java.exe": CreateProcess error=87, The parameter is inc orrect [java] at java.lang.ProcessBuilder.start(ProcessBuilder.java:459) [java] at java.lang.Runtime.exec(Runtime.java:593) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:597) [java] at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:834) [java] at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:435) [java] at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:449) [java] at org.apache.tools.ant.taskdefs.Java.fork(Java.java:751) [java] at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:171) [java] at org.apache.tools.ant.taskdefs.Java.execute(Java.java:84) [java] at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275) [java] at org.apache.tools.ant.Task.perform(Task.java:364) [java] at org.apache.tools.ant.Target.execute(Target.java:341) [java] at org.apache.maven.plugin.antrun.AbstractAntMojo.executeTasks(AbstractAntMojo.java:108) [java] at org.apache.maven.plugin.antrun.AntRunMojo.execute(AntRunMojo.java:83) [java] at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348) [java] at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180) [java] at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328) [java] at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138) [java] at org.apache.maven.cli.MavenCli.main(MavenCli.java:362) [java] at org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60) [java] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) [java] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) [java] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) [java] at java.lang.reflect.Method.invoke(Method.java:597) [java] at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) [java] at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) [java] at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) [java] at org.codehaus.classworlds.Launcher.main(Launcher.java:375) [java] Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect [java] at java.lang.ProcessImpl.create(Native Method) [java] at java.lang.ProcessImpl.<init>(ProcessImpl.java:81) [java] at java.lang.ProcessImpl.start(ProcessImpl.java:30) [java] at java.lang.ProcessBuilder.start(ProcessBuilder.java:452) [java] ... 35 more [INFO] Executed tasks [INFO] [compiler:compile {execution: default-compile}] The reason is, the classpath is too long, and windows can have only limited classpath. The corresponding ant task in pom.xml is as follows: (Note that, I took components\gadgets\org.wso2.carbon.gadget.editor.ui as an example, but most of the other *.ui components are also failing. ) <tasks> <java classname="org.apache.axis2.wsdl.WSDL2Java" fork="true"> <arg line="-uri src/main/resources/GadgetEditorService/GadgetEditorService.wsdl -u -uw -o target/generated-code -p org.wso2.carbon.gadget.editor.ui -ns2p http://services.editor.gadget.carbon.wso2.org =org.wso2.carbon.gadget.editor.ui.services,http://utils.extensi ons.registry.carbon.wso2.org/xsd=org.wso2.carbon.gadget.editor.ui.beans.xsd,http://exceptions.core.registry.carbon.wso2.org/xsd=org.wso2.carbon.gadget .editor.ui.exceptions.xsd"/> <classpath refid="maven.dependency.classpath"/> <classpath refid="maven.compile.classpath"/> <classpath refid="maven.runtime.classpath"/> </java> </tasks> When we change the "fork" parameter to "false", it works correctly. However, the WSDL and output directory are given relative to the component directory and will work only if the fork="true". So, we can't build it from some other location (e.g if the component is "components\gadgets\org.wso2.carbon.gadget.editor.ui", we can build inside this location, but the build will fail if we try to build from "components" or "components\gadgets"). One possibility is giving absolute path for WSDL and output directory. Modifying it as follows works without any issue: <tasks> <java classname="org.apache.axis2.wsdl.WSDL2Java"> <arg line="-uri ${project.basedir}/src/main/resources/GadgetEditorService/GadgetEditorService.wsdl -u -uw -o ${pro ject.basedir}/target/generated-code -p org.wso2.carbon.gadget.editor.ui -ns2p http://services.editor.gadget.carbon.wso2.org =org.wso2.carbon.gadget.editor.ui.services,http://utils.extensi ons.registry.carbon.wso2.org/xsd=org.wso2.carbon.gadget.editor.ui.beans.xsd,http://exceptions.core.registry.carbon.wso2.org/xsd=org.wso2.carbon.gadget .editor.ui.exceptions.xsd"/> <classpath refid="maven.dependency.classpath"/> <classpath refid="maven.compile.classpath"/> <classpath refid="maven.runtime.classpath"/> </java> </tasks> Is it ok to change as above? Any problem in above approach? Please give your comments. Regards, Shankar -- S.Uthaiyashankar Senior Architect & Senior Manager WSO2 Inc. http://wso2.com/ - "lean . enterprise . middleware"
_______________________________________________ Carbon-dev mailing list Carbon-dev@wso2.org https://wso2.org/cgi-bin/mailman/listinfo/carbon-dev