掲示板

Service Builder not generating Files

thumbnail
11年前 に George Stafford によって更新されました。

Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
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:

[Console output redirected to file:C:\XXXXXXXXX\Liferay Developer Studio\workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
Buildfile: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\country-at-risk-portlet\build.xml
build-service:
     [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
     [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:43)
     [java] 	at java.lang.reflect.Method.invoke(Method.java:601)
     [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:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long
     [java] 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
     [java] 	at java.lang.Runtime.exec(Runtime.java:615)
     [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=206, The filename or extension is too long
     [java] 	at java.lang.ProcessImpl.create(Native Method)
     [java] 	at java.lang.ProcessImpl.<init>(ProcessImpl.java:189)
     [java] 	at java.lang.ProcessImpl.start(ProcessImpl.java:133)
     [java] 	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1021)
     [java] 	... 23 more
     [java] Java Result: -1
     [echo] ${service.test.output}
    [mkdir] Created dir: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\my-portlet\docroot\WEB-INF\service-classes
compile-java:
      [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.
   [delete] Deleting directory C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\my-portlet\docroot\WEB-INF\service-classes
BUILD SUCCESSFUL
Total time: 1 second</init>


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
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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?
thumbnail
11年前 に George Stafford によって更新されました。

RE: Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
No, this is the response I get from that functionality in my Console.
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Service Builder not generating Files (回答)

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
C:\Program Files\Java\jdk1.7.0_07\jre\bin\java.exe": CreateProcess error=206, The filename or extension is too long [java] 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:
thumbnail
11年前 に David H Nebinger によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 14919 参加年月日: 06/09/02 最新の投稿
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?
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
David, I think he means the log console in Liferay Studio.
thumbnail
11年前 に Gregory Amerson によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 1123 参加年月日: 10/02/16 最新の投稿
George Stafford:

[Console output redirected to file:C:\XXXXXXXXX\Liferay Developer Studio\workspace\.metadata\.plugins\com.liferay.ide.eclipse.sdk\sdk.log]
Buildfile: C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20\portlets\country-at-risk-portlet\build.xml
build-service:
     [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
[/quote]


Hey 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.

Take a look at this thread: [url]http://www.liferay.com/community/forums/-/message_boards/message/15389942[/url]

In 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,
C:\XXXXXXXXX\Liferay Developer Studio\liferay-plugins-sdk-6.1.20
then 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]

Hope this helps!
thumbnail
11年前 に George Stafford によって更新されました。

RE: Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
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!
thumbnail
11年前 に George Stafford によって更新されました。

RE: Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
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

java.lang.NoClassDefFoundError: VW_COUNTRY_DETAIL

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

Any ideas?

添付ファイル:

thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
It's probably not finding the jar file for VW_COUNTRY_DETAIL.
thumbnail
11年前 に George Stafford によって更新されました。

RE: Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
What Jar file would that be? I don't understand what Jar file the service builder would be looking for in the scaffolded code?
thumbnail
11年前 に Hitoshi Ozawa によって更新されました。

RE: Service Builder not generating Files

Liferay Legend 投稿: 7942 参加年月日: 10/03/24 最新の投稿
Isn't that the Oracle view you're trying to query?
thumbnail
11年前 に George Stafford によって更新されました。

RE: Service Builder not generating Files

Junior Member 投稿: 62 参加年月日: 12/10/01 最新の投稿
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.