Foros de discusión

Service builder fails with exception CreateProcess error=87

Tom Witmer, modificado hace 11 años.

Service builder fails with exception CreateProcess error=87

New Member Mensajes: 22 Fecha de incorporación: 27/07/09 Mensajes recientes
Before I open a ticket on this, can anyone confirm if I'm missing a step?

I've been successfully using Liferay Developer Studio v1.5.2 against Portal v6.1.10 EE.

I then tried pulling in Portal EE v1.6.20 elements (SDK, runtime) and now find Service Builder won't run.

Steps to reproduce:
  • Install Portal 6.1.20 SDK and runtime to Liferay Developer Studio
  • Create new empty Hook project
  • Invoke new Service Builder (New -> "Liferay Service Builder")
  • Right-click generated service.xml file, select "Liferay" -> "Build Services"
  • Receive error:


[Console output redirected to file:C:\Workspaces\liferay\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
Buildfile: C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\build.xml
build-service:
     [java] C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\build-common-plugin.xml:169: java.io.IOException: Cannot run program "C:\Java\Liferay Developer Studio\liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\jre1.6.0_20\win\bin\java.exe": CreateProcess error=87, The parameter is incorrect
     [java] 	at org.apache.tools.ant.taskdefs.Java.fork(Java.java:798)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
     [java] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
     [java] 	at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
     [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.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:390)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:411)
     [java] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
     [java] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
     [java] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
     [java] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
     [java] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
     [java] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
     [java] Caused by: java.io.IOException: Cannot run program "C:\Java\Liferay Developer Studio\liferay-portal-6.1.20-ee-ga2\tomcat-7.0.27\jre1.6.0_20\win\bin\java.exe": CreateProcess error=87, The parameter is incorrect
     [java] 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
     [java] 	at java.lang.Runtime.exec(Runtime.java:593)
     [java] 	at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
     [java] 	at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
     [java] 	at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
     [java] 	at org.apache.tools.ant.taskdefs.Java.fork(Java.java:791)
     [java] 	... 18 more
     [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:453)
     [java] 	... 23 more
     [java] Java Result: -1
     [echo] ${service.test.output}
    [mkdir] Created dir: C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\docroot\WEB-INF\service-classes
compile-java:
      [zip] Warning: skipping zip archive C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\docroot\WEB-INF\lib\Workshare-hook-service.jar because no files were included.
   [delete] Deleting directory C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\docroot\WEB-INF\service-classes
BUILD SUCCESSFUL
Total time: 1 second
</init>
Tom Witmer, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

New Member Mensajes: 22 Fecha de incorporación: 27/07/09 Mensajes recientes
After trying a few more things I decided to open this as an issue after all.
thumbnail
Gregory Amerson, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
The reason for this error is that the process parameters are too long. Windows platform has a limit of the length of the process arguments (including the executable file) . The service builder invocation of java to execute the service builder class including the classpath (all of the jars) is overrunning the maximum length allowed on Windows.

The workaround is to switch the JRE that the Liferay runtime is using to a JRE that has a very short path. Also its a good idea to move the SDK to a short path as well.

I am going to try to get this issue fixed in future version of Liferay Portal / SDK / Service builder but for now I hope this can help.
thumbnail
Gregory Amerson, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
Hi Tom,

I have a workaround available now. I've attached a new version of build-common-plugin.xml that will fix the build-service error.

Simply find your Plugins SDK that has your portlet project and copy the attached file and replace the build-common-plugin.xml that you have. Then re-run build-service in Studio and it should work.
Jonny Olliff-Lee, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Junior Member Mensajes: 48 Fecha de incorporación: 25/01/11 Mensajes recientes
Gregory Amerson:
Hi Tom,

I have a workaround available now. I've attached a new version of build-common-plugin.xml that will fix the build-service error.

Simply find your Plugins SDK that has your portlet project and copy the attached file and replace the build-common-plugin.xml that you have. Then re-run build-service in Studio and it should work.


Hi Gregory,

Thank you for this workaround, however I found it only worked with by building the service from the command line, and not through Liferay Developer Studio. It's not really a big deal, but thought I'd make people aware of it!

Jonny
Tom Witmer, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

New Member Mensajes: 22 Fecha de incorporación: 27/07/09 Mensajes recientes
Jonny Olliff-Lee:
Gregory Amerson:
Hi Tom,

I have a workaround available now. I've attached a new version of build-common-plugin.xml that will fix the build-service error.

Simply find your Plugins SDK that has your portlet project and copy the attached file and replace the build-common-plugin.xml that you have. Then re-run build-service in Studio and it should work.


Hi Gregory,

Thank you for this workaround, however I found it only worked with by building the service from the command line, and not through Liferay Developer Studio. It's not really a big deal, but thought I'd make people aware of it!

Jonny


Thanks Jonny! That was the next thing I needed to do.

Actually, I ended up having to create a new hook project on the command-line, recreate the services via the command-line, and manually pull over the rest of the files from the 6.1.10 project.

The newly created hook project had a v2.3 web.xml, which failed to deploy until I upgraded that to v2.4. My hook deploys and runs now, so I'm happy.
Jonny Olliff-Lee, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Junior Member Mensajes: 48 Fecha de incorporación: 25/01/11 Mensajes recientes
Hi Tom,

I'm glad that helped! :-)

I've also been having issues with 6.1.20 and version 2.3 web.xml's, generally porting over 6.1.10 portlets. But like you I recreated my portlets with the new SDK and then copied the files across I needed and updated the web.xml.

Does anyone from Liferay know if there is going to be a fix to the Plugins SDK to fix the web.xml issue?

Thanks,
Jonny
thumbnail
Gregory Amerson, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Liferay Legend Mensajes: 1123 Fecha de incorporación: 16/02/10 Mensajes recientes
Jonny Olliff-Lee:
Hi Tom,

I'm glad that helped! :-)

I've also been having issues with 6.1.20 and version 2.3 web.xml's, generally porting over 6.1.10 portlets. But like you I recreated my portlets with the new SDK and then copied the files across I needed and updated the web.xml.

Does anyone from Liferay know if there is going to be a fix to the Plugins SDK to fix the web.xml issue?

Thanks,
Jonny



Can you explain the Plugins SDK web.xml issue again exactly? I'll try to see what we can do.
Jonny Olliff-Lee, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Junior Member Mensajes: 48 Fecha de incorporación: 25/01/11 Mensajes recientes
Hi Gregory,

I just went to try it again and the plugins-sdk doesn't actually create a web.xml, so I must have copied the 6.1.1 version across by mistake! Sorry about that!

Jonny
Tom Witmer, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

New Member Mensajes: 22 Fecha de incorporación: 27/07/09 Mensajes recientes
Jonny Olliff-Lee:
Hi Gregory,

I just went to try it again and the plugins-sdk doesn't actually create a web.xml, so I must have copied the 6.1.1 version across by mistake! Sorry about that!

Jonny


The command-line 'create' script does not create the web.xml file, but Liferay Dev Studio 1.5.2 does when you do File -> Import -> "Liferay Project from Existing Source". It's also possible I copied it across from the 6.1.10 hook, but either way results in the obsolete web.xml version.

The import DOES work, despite an error popup with "org.eclipse.core.runtime.CoreException: One or more constraints have not been satisfied." So not a blocker, just yet another item for Gregory to address in his copious free time. :-)

Gregory: this IDE seriously rocks! Liferay Portal has such potential and the IDE is a great way to unlock it.
Jonny Olliff-Lee, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Junior Member Mensajes: 48 Fecha de incorporación: 25/01/11 Mensajes recientes
Tom Witmer:
Jonny Olliff-Lee:
Hi Gregory,

I just went to try it again and the plugins-sdk doesn't actually create a web.xml, so I must have copied the 6.1.1 version across by mistake! Sorry about that!

Jonny


The command-line 'create' script does not create the web.xml file, but Liferay Dev Studio 1.5.2 does when you do File -> Import -> "Liferay Project from Existing Source". It's also possible I copied it across from the 6.1.10 hook, but either way results in the obsolete web.xml version.

The import DOES work, despite an error popup with "org.eclipse.core.runtime.CoreException: One or more constraints have not been satisfied." So not a blocker, just yet another item for Gregory to address in his copious free time. :-)

Gregory: this IDE seriously rocks! Liferay Portal has such potential and the IDE is a great way to unlock it.


Hi Tom,

Now that makes more sense, I think that's how my web.xml got in there too because I imported through Liferay Developer Studio, then tried to build, but if failed so built from the command line!!

Liferay Developer Studio is a must have for development! If only there was an IntelliJ plugin as well! ;-)
Tom Witmer, modificado hace 11 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

New Member Mensajes: 22 Fecha de incorporación: 27/07/09 Mensajes recientes
Gregory Amerson:
Hi Tom,

I have a workaround available now. I've attached a new version of build-common-plugin.xml that will fix the build-service error.

Simply find your Plugins SDK that has your portlet project and copy the attached file and replace the build-common-plugin.xml that you have. Then re-run build-service in Studio and it should work.


Thanks! I just finished getting 6.1.20 EE configured in the Dev Studio with a shortened directory path to avoid Windows path length problems.

My results are mixed: The Liferay -> Build Services task worked, but the new service code had a number of compilation errors (cannot return a void results, incompatible return types, undefined methods). Otherwise, I am able to build and deploy my hook to the 6.1.20 EE portal, so things generally seem configured right. I'll keep digging to see if there's something I missed.
thumbnail
Olaf Kock, modificado hace 10 años.

RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20

Liferay Legend Mensajes: 6403 Fecha de incorporación: 23/09/08 Mensajes recientes
Thanks, the workaround you give elsewhere (the updated buildfile) is an unconventional solution to this problem, but it helps very well, without moving all of the installations around.

As I didn't find a crossreference in this thread, here is the issue: IDE-678 marks this as fixed in IDE/DevStudio 2.0.0 M1