Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Tom Witmer
Service builder fails with exception CreateProcess error=87
August 8, 2012 7:23 AM
Answer

Tom Witmer

Rank: New Member

Posts: 22

Join Date: July 27, 2009

Recent Posts

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:
  1. Install Portal 6.1.20 SDK and runtime to Liferay Developer Studio
  2. Create new empty Hook project
  3. Invoke new Service Builder (New -> "Liferay Service Builder")
  4. Right-click generated service.xml file, select "Liferay" -> "Build Services"
  5. Receive error:

 1
 2[Console output redirected to file:C:\Workspaces\liferay\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
 3Buildfile: C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\build.xml
 4build-service:
 5     [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
 6     [java]     at org.apache.tools.ant.taskdefs.Java.fork(Java.java:798)
 7     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
 8     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
 9     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
10     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
11     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
12     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
13     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
14     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
15     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
16     [java]     at org.apache.tools.ant.Target.execute(Target.java:390)
17     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
18     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
19     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
20     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
21     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
22     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
23     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
24     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
25     [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
26     [java]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:460)
27     [java]     at java.lang.Runtime.exec(Runtime.java:593)
28     [java]     at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
29     [java]     at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
30     [java]     at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
31     [java]     at org.apache.tools.ant.taskdefs.Java.fork(Java.java:791)
32     [java]     ... 18 more
33     [java] Caused by: java.io.IOException: CreateProcess error=87, The parameter is incorrect
34     [java]     at java.lang.ProcessImpl.create(Native Method)
35     [java]     at java.lang.ProcessImpl.<init>(ProcessImpl.java:81)
36     [java]     at java.lang.ProcessImpl.start(ProcessImpl.java:30)
37     [java]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:453)
38     [java]     ... 23 more
39     [java] Java Result: -1
40     [echo] ${service.test.output}
41    [mkdir] Created dir: C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\docroot\WEB-INF\service-classes
42compile-java:
43      [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.
44   [delete] Deleting directory C:\Java\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\hooks\Workshare-hook\docroot\WEB-INF\service-classes
45BUILD SUCCESSFUL
46Total time: 1 second
Tom Witmer
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 6, 2012 9:33 AM
Answer

Tom Witmer

Rank: New Member

Posts: 22

Join Date: July 27, 2009

Recent Posts

After trying a few more things I decided to open this as an issue after all.
Gregory Amerson
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 6, 2012 10:13 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1032

Join Date: February 16, 2010

Recent Posts

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.
Gregory Amerson
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 7, 2012 8:34 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1032

Join Date: February 16, 2010

Recent Posts

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.
Attachments: build-common-plugin.xml (35.2k)
Jonny Olliff-Lee
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 8, 2012 12:49 AM
Answer

Jonny Olliff-Lee

Rank: Junior Member

Posts: 48

Join Date: January 25, 2011

Recent Posts

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
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 8, 2012 8:59 AM
Answer

Tom Witmer

Rank: New Member

Posts: 22

Join Date: July 27, 2009

Recent Posts

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.
Tom Witmer
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 8, 2012 12:23 PM
Answer

Tom Witmer

Rank: New Member

Posts: 22

Join Date: July 27, 2009

Recent Posts

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
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 9, 2012 12:06 AM
Answer

Jonny Olliff-Lee

Rank: Junior Member

Posts: 48

Join Date: January 25, 2011

Recent Posts

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
Gregory Amerson
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 9, 2012 5:40 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1032

Join Date: February 16, 2010

Recent Posts

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
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 9, 2012 5:44 AM
Answer

Jonny Olliff-Lee

Rank: Junior Member

Posts: 48

Join Date: January 25, 2011

Recent Posts

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
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 9, 2012 9:28 AM
Answer

Tom Witmer

Rank: New Member

Posts: 22

Join Date: July 27, 2009

Recent Posts

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
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
August 10, 2012 12:14 AM
Answer

Jonny Olliff-Lee

Rank: Junior Member

Posts: 48

Join Date: January 25, 2011

Recent Posts

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! ;-)
Olaf Kock
RE: Service builder problems with Liferay Dev Studio 1.5.2, Portal 6.1.20
July 23, 2013 1:07 PM
Answer

Olaf Kock

LIFERAY STAFF

Rank: Liferay Legend

Posts: 3521

Join Date: September 23, 2008

Recent Posts

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