Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
George Stafford
Service Builder not generating Files
November 8, 2012 10:29 AM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

So I am trying to use the service builder and it's not creating any files for me. I'm guessing part of my problem relates to my lack of Java knowledge! emoticon

I've got the Console Output here:

 1[Console output redirected to file:C:\XXXXXXXXX\Liferay Developer Studio\workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
 2Buildfile: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\country-at-risk-portlet\build.xml
 3build-service:
 4     [java] C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\build-common-plugin.xml:169: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
 5     [java]     at org.apache.tools.ant.taskdefs.Java.fork(Java.java:798)
 6     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:214)
 7     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
 8     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
 9     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
10     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
11     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
12     [java]     at java.lang.reflect.Method.invoke(Method.java:601)
13     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
14     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
15     [java]     at org.apache.tools.ant.Target.execute(Target.java:390)
16     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:411)
17     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
18     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
19     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
20     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
21     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
22     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
23     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
24     [java] Caused by: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
25     [java]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
26     [java]     at java.lang.Runtime.exec(Runtime.java:615)
27     [java]     at org.apache.tools.ant.taskdefs.Execute$Java13CommandLauncher.exec(Execute.java:862)
28     [java]     at org.apache.tools.ant.taskdefs.Execute.launch(Execute.java:481)
29     [java]     at org.apache.tools.ant.taskdefs.Execute.execute(Execute.java:495)
30     [java]     at org.apache.tools.ant.taskdefs.Java.fork(Java.java:791)
31     [java]     ... 18 more
32     [java] Caused by: java.io.IOException: CreateProcess error=206, The filename or extension is too long
33     [java]     at java.lang.ProcessImpl.create(Native Method)
34     [java]     at java.lang.ProcessImpl.<init>(ProcessImpl.java:189)
35     [java]     at java.lang.ProcessImpl.start(ProcessImpl.java:133)
36     [java]     at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
37     [java]     ... 23 more
38     [java] Java Result: -1
39     [echo] ${service.test.output}
40    [mkdir] Created dir: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\my-portlet\docroot\WEB-INF\service-classes
41compile-java:
42      [zip] Warning: skipping zip archive C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\my-portlet\docroot\WEB-INF\lib\country-at-risk-portlet-service.jar because no files were included.
43   [delete] Deleting directory C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\my-portlet\docroot\WEB-INF\service-classes
44BUILD SUCCESSFUL
45Total time: 1 second


Some of the things I noticed that I can't quite figure out are that the build-common-plugin.xml is utilizing the jdk 1.7 when I have everything else set up to run the Liferay Java Library. I double checked that, and I tried to run ant from the command line but I'm on Windows so I must not have that environment variable set up correctly because it won't run.

I'm wondering if this error is hiding some other error that's preventing the Service Builder from running? I get this same error when building my portlet regularly. My other portlet within this project is working and functional so I know the build is successful.

Thanks!
George
David H Nebinger
RE: Service Builder not generating Files
November 8, 2012 12:21 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11113

Join Date: September 1, 2006

Recent Posts

If you open service.xml using Liferay's gui tool, then click on the 'Build Services' from the top-right corner, will it run correctly?
George Stafford
RE: Service Builder not generating Files
November 8, 2012 12:31 PM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

No, this is the response I get from that functionality in my Console.
Hitoshi Ozawa
RE: Service Builder not generating Files
November 8, 2012 1:37 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

C:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long at org.apache.tools.ant.taskdefs.Java.fork(Java.java:798)


First, you shouldn't be using jdk1.7.0. Liferay doesn't support 1.7.0 yet. It's planned for the next release.

It may be your folder path is too deep. Try moving it up to the root C drive.

C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\build-common-plugin.xml:

change this to be like below:
C:\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\build-common-plugin.xml:
David H Nebinger
RE: Service Builder not generating Files
November 8, 2012 2:04 PM
Answer

David H Nebinger

Community Moderator

Rank: Liferay Legend

Posts: 11113

Join Date: September 1, 2006

Recent Posts

George Stafford:
No, this is the response I get from that functionality in my Console.


I understand it comes from the console, but does the same error occur within the IDE?
Hitoshi Ozawa
RE: Service Builder not generating Files
November 8, 2012 3:02 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

David, I think he means the log console in Liferay Studio.
Gregory Amerson
RE: Service Builder not generating Files
November 8, 2012 3:13 PM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1024

Join Date: February 16, 2010

Recent Posts

George Stafford:

 1[Console output redirected to file:C:\XXXXXXXXX\Liferay Developer Studio\workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
 2Buildfile: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\country-at-risk-portlet\build.xml
 3build-service:
 4     [java] C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\build-common-plugin.xml:169: java.io.IOException: Cannot run program "C:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
 5[/quote]
 6
 7
 8Hey George, this is definitely a path length issue.  This has been fixed for 6.2.0 in plugins SDK, but for 6.1.x you need a patched version of build-common-plugin.xml.
 9
10Take a look at this thread: [url]http://www.liferay.com/community/forums/-/message_boards/message/15389942[/url]
11
12In that thread a few replies down I posted a message and attached a new version of build-common-plugin.xml.  So find your plugins SDK here,
13C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20
14then copy in that patched version of build-common-plugin.xml.  Then re-run service builder from Studio and you should be in good shape.  Here is the JIRA ticket if you are interested: [url]http://issues.liferay.com/browse/LPS-29085[/url]
15
16Hope this helps!
George Stafford
RE: Service Builder not generating Files
November 9, 2012 6:22 AM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

Sorry David - I did mean the Log Console in the IDE. I am unable to run ant locally, not sure why.

The patch for build-common-plugin.xml did the trick though and generated errors that I can work with. Was nice to get it to build.

As for the JDK 1.7, I'm not sure why it's picking that up in the error message. I have all the settings that I know how to change pointing at the 1.6 which is what I'm using on both my local and remote environments as well as the JRE I have referenced in my portlet project itself (jdk1.6.0_35). Any ideas where that flag is slipping in and pointing to the 1.7?

Thanks again folks!
George Stafford
RE: Service Builder not generating Files
November 9, 2012 1:47 PM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

I'm now experiencing a problem where I am unable to deploy my portlets due to the successful build in the service.xml. This kind of has me stuck at the moment as I'm not sure what this error means - I fixed another one, but this one has me stumped. I also don't know how to "rip out" the service builder stuff so that I can go back to the way my portlets were. Any help would be appreciated.

I've attached the error stack that I am receiving from Liferay/Tomcat when it tries to deploy the package. Basically I have a error on

1java.lang.NoClassDefFoundError: VW_COUNTRY_DETAIL

VW_COUNTRY_DETAIL is the Oracle View I'm trying to query.

Any ideas?
Attachments: car_stack.txt (22.9k)
Hitoshi Ozawa
RE: Service Builder not generating Files
November 10, 2012 5:45 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

It's probably not finding the jar file for VW_COUNTRY_DETAIL.
George Stafford
RE: Service Builder not generating Files
November 12, 2012 6:22 AM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

What Jar file would that be? I don't understand what Jar file the service builder would be looking for in the scaffolded code?
Hitoshi Ozawa
RE: Service Builder not generating Files
November 12, 2012 1:29 PM
Answer

Hitoshi Ozawa

Rank: Liferay Legend

Posts: 7949

Join Date: March 23, 2010

Recent Posts

Isn't that the Oracle view you're trying to query?
George Stafford
RE: Service Builder not generating Files
February 25, 2013 7:30 AM
Answer

George Stafford

Rank: Junior Member

Posts: 62

Join Date: October 1, 2012

Recent Posts

Just to update this information, I managed to fix this problem in a new project by moving the liferay plugins folder up to the root of my C drive, and thereby shrinking the path a lot. So the problem, even though it wasn't being displayed, was related to path length, which I've seen in other functionality that wasn't as adversely affected.

Once I had code compiling, the rest of these suggestions and mentions began to make sense. So everything is working now. Thanks folks.