Fórum

issue : unable to generate the service builder classes in liferay 6.1

Kiran Kumar Boyini, modificado 11 Anos atrás.

issue : unable to generate the service builder classes in liferay 6.1

Expert Postagens: 287 Data de Entrada: 02/06/11 Postagens Recentes
Hi All,

I am using liferay 6.1.0-ce-ga4 version.I am trying to run the service builder for my entity.But here I am not able to generate

the any classes.

Please see the below logs details

[color=#f72020]Buildfile: D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\build.xml
build-service:
    [mkdir] Created dir: D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\docroot\WEB-INF\classes
     [copy] Copied 2 empty directories to 1 empty directory under D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\docroot\WEB-INF\classes
     [echo] Loading jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
     [echo] Dec 21, 2012 9:24:16 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [echo] INFO: Global lib directory /D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/lib/ext/
     [echo] Dec 21, 2012 9:24:16 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [echo] INFO: Portal lib directory /D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/
     [echo] 09:24:16,984 INFO  [EasyConf:122] Refreshed the configuration of all components
     [echo] 09:24:17,468 INFO  [ConfigurationLoader:56] Properties for jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal loaded from [jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties, jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties]
     [echo] Loading jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
     [echo] Loading jar:file:/D:/liferay-6.1.0-ce-b4-21dec/liferay-portal-tomcat-6.1.0-ce-b4-20111110/liferay-portal-6.1.0-ce-b4/tomcat-7.0.22/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
     [echo] java.lang.NullPointerException
     [echo] 	at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:33)
     [echo] 	at com.liferay.util.xml.XMLSafeReader.<init>(XMLSafeReader.java:25)
     [echo] 	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:423)
     [echo] 	at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:139)
     [echo] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:3833)
     [echo] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContent(ServiceBuilder.java:3756)
     [echo] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:544)
     [echo] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:430)
     [echo] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:146)
     [echo] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [echo] 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     [echo] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [echo] 	at java.lang.reflect.Method.invoke(Method.java:597)
     [echo] 	at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
     [echo] 	at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [echo] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:764)
     [echo] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:218)
     [echo] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:132)
     [echo] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:105)
     [echo] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
     [echo] 	at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
     [echo] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     [echo] 	at java.lang.reflect.Method.invoke(Method.java:597)
     [echo] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [echo] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [echo] 	at org.apache.tools.ant.Target.execute(Target.java:357)
     [echo] 	at org.apache.tools.ant.Target.performTasks(Target.java:385)
     [echo] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
     [echo] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
     [echo] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [echo] 	at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
     [echo] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
     [echo] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:423)
     [echo] 	at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:137)
    [mkdir] Created dir: D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\docroot\WEB-INF\service-classes
compile-java:
      [zip] Warning: skipping zip archive D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\docroot\WEB-INF\lib\MySamplePortlet-portlet-service.jar because no files were included.
   [delete] Deleting directory D:\liferay-6.1.0-ce-b4-21dec\plugins-sdk-6.1.0-ce-b4\portlets\MySamplePortlet-portlet\docroot\WEB-INF\service-classes
BUILD SUCCESSFUL
Total time: 6 seconds[/color]

</init></init></init></init>


Thanks,
Kiran
thumbnail
Subhash Pavuskar, modificado 11 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

Regular Member Postagens: 234 Data de Entrada: 13/03/12 Postagens Recentes
Hi,
Can you share your service.xml file ?
thumbnail
Hung Quang, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Postagens: 11 Data de Entrada: 08/04/13 Postagens Recentes
i have same error
my service.xml


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
<service-builder package-path="com.telsoft.portal">
<author>Administrator</author>
<namespace>Portal</namespace>

<entity name="Attachment" local-service="true" remote-service="true"
table="Attachment">

<!-- Primary key fields -->
<column name="attachmentId" type="long" primary="true" />

<!-- Audit fields -->
<column name="groupId" type="long" />
<column name="companyId" type="long" />

<!-- Other fields -->
<column name="entryId" type="long" />
<column name="entryClass" type="String" />
<column name="fileEntryId" type="long" />
<column name="folderId" type="long" />
<column name="fileName" type="String" />
<column name="imageId" type="long" />
<column name="extension" type="String" />

<!-- Sorting -->

<!-- Finder methods -->
<finder name="Entry" return-type="Collection">
<finder-column name="entryId" />
<finder-column name="entryClass" />
</finder>

<finder name="C_F_N" return-type="Attachment">
<finder-column name="entryClass" />
<finder-column name="folderId" />
<finder-column name="fileName" />
</finder>

</entity>

<entity name="PortletFolder" local-service="true"
remote-service="true" table="PortletFolder">
<!-- Primary key fields -->
<column name="id" type="long" primary="true" />

<!-- Other fields -->
<column name="portletId" type="String" />
<column name="folderId" type="long" />
<column name="description" type="String" />

<finder name="PortletId" return-type="Collection">
<finder-column name="portletId" />
</finder>

<finder name="FolderId" return-type="Collection">
<finder-column name="folderId" />
</finder>

<finder name="P_F" return-type="PortletFolder">
<finder-column name="portletId" />
<finder-column name="folderId" />
</finder>

<reference package-path="com.liferay.counter" entity="Counter" />
</entity>

<exceptions></exceptions>
</service-builder>


help me!
thumbnail
David H Nebinger, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Hung Quang:
i have same error


I doubt it, since the OP's stack trace indicates he was using 6.1 beta 4...
thumbnail
Hung Quang, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Postagens: 11 Data de Entrada: 08/04/13 Postagens Recentes
David H Nebinger:
Hung Quang:
i have same error


I doubt it, since the OP's stack trace indicates he was using 6.1 beta 4...



Thanks for reply!

I using 6.1.1 and I create a ext-plugin

I write service.xml, I run build-service. I have problem

Buildfile: D:\LIFERAY\Sdk liferay\liferay-plugins-sdk-6.1.1\ext\Vasportal-ext\build.xml
build-service:
     [echo] .
     [echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
     [echo] versions. EXT plugins are designed to override the portal's core code that
     [echo] cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
     [echo] are not meant to contain new custom services. Please migrate your service.xml to
     [echo] a portlet plugin.
     [echo] 		
     [java] Loading jar:file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
     [java] May 4, 2013 1:50:44 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [java] INFO: Global shared lib directory /D:/LIFERAY/Sdk liferay/liferay-plugins-sdk-6.1.1/lib/
     [java] May 4, 2013 1:50:44 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [java] INFO: Global lib directory /D:/LIFERAY/Tomcat Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/lib/ext/
     [java] May 4, 2013 1:50:44 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [java] INFO: Portal lib directory /D:/LIFERAY/Tomcat Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/
     [java] May 4, 2013 1:50:44 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
     [java] INFO: Properties for portal loaded from [file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-ext.properties, jar:file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties, jar:file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties]
     [java] Loading jar:file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
     [java] Loading jar:file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
     [java] Loading file:/D:/LIFERAY/Tomcat%20Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/webapps/ROOT/WEB-INF/classes/portal-ext.properties
     [java] java.lang.NullPointerException
     [java] 	at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
     [java] 	at com.liferay.util.xml.XMLSafeReader.<init>(XMLSafeReader.java:25)
     [java] 	at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:409)
     [java] 	at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:4002)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContent(ServiceBuilder.java:3925)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:559)
     [java] 	at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:151)
     [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.ExecuteJava.run(ExecuteJava.java:217)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
     [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:392)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:413)
     [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)
BUILD SUCCESSFUL
Total time: 6 seconds
</init></init></init>


My service.xml

<!--?xml version="1.0" encoding="UTF-8"?-->

<service-builder package-path="com.telsoft.portal">
	<author>Administrator</author>
	<namespace>Portal</namespace>

	<entity name="Attachment" local-service="true" remote-service="true" table="Attachment">

		<!-- Primary key fields -->
		<column name="attachmentId" type="long" primary="true" />

		<!-- Audit fields -->
		<column name="groupId" type="long" />
		<column name="companyId" type="long" />

		<!-- Other fields -->
		<column name="entryId" type="long" />
		<column name="entryClass" type="String" />
		<column name="fileEntryId" type="long" />
		<column name="folderId" type="long" />
		<column name="fileName" type="String" />
		<column name="imageId" type="long" />
		<column name="extension" type="String" />

		<!-- Sorting -->

		<!-- Finder methods -->
		<finder name="Entry" return-type="Collection">
			<finder-column name="entryId" />
			<finder-column name="entryClass" />
		</finder>

		<finder name="C_F_N" return-type="Attachment">
			<finder-column name="entryClass" />
			<finder-column name="folderId" />
			<finder-column name="fileName" />
		</finder>

	</entity>

	<entity name="PortletFolder" local-service="true" remote-service="true" table="PortletFolder">
		<!-- Primary key fields -->
		<column name="id" type="long" primary="true" />

		<!-- Other fields -->
		<column name="portletId" type="String" />
		<column name="folderId" type="long" />
		<column name="description" type="String" />

		<finder name="PortletId" return-type="Collection">
			<finder-column name="portletId" />
		</finder>

		<finder name="FolderId" return-type="Collection">
			<finder-column name="folderId" />
		</finder>

		<finder name="P_F" return-type="PortletFolder">
			<finder-column name="portletId" />
			<finder-column name="folderId" />
		</finder>

		<reference package-path="com.liferay.counter" entity="Counter" />
	</entity>

	<exceptions></exceptions>
</service-builder>


Help me fix error!
Please!
thumbnail
David H Nebinger, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
See the warning message about using SB in an EXT plugin, how it's deprecated?

You should not be ignoring that error. Move your SB code to a separate plugin and try again.
thumbnail
Hung Quang, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Postagens: 11 Data de Entrada: 08/04/13 Postagens Recentes
David H Nebinger:
See the warning message about using SB in an EXT plugin, how it's deprecated?

You should not be ignoring that error. Move your SB code to a separate plugin and try again.



Thanks for reply David!

But I don't understand the separation? where is the separation in my ext-plugin project?
thumbnail
David H Nebinger, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
Hung Quang:
But I don't understand the separation? where is the separation in my ext-plugin project?


EXT plugins are meant for overriding core Liferay functionality. Adding your own service.xml layer is not overriding core functionality, it's extending it to cover new table(s) that are not part of the core.

Create a separate plugin to host your service.xml file, and strip your extension code out of the EXT plugin.

Trust me, you only want to use an EXT plugin where it is absolutely necessary. It is the most fragile plugin in the Liferay ecosystem as it is the most likely type of plugin that breaks during Liferay upgrades.

I'm willing to bet that whatever you're trying to do in an EXT plugin is better handled as a different type of plugin (or plugins) altogether.
thumbnail
Hung Quang, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Postagens: 11 Data de Entrada: 08/04/13 Postagens Recentes
David H Nebinger:
Hung Quang:
But I don't understand the separation? where is the separation in my ext-plugin project?


EXT plugins are meant for overriding core Liferay functionality. Adding your own service.xml layer is not overriding core functionality, it's extending it to cover new table(s) that are not part of the core.

Create a separate plugin to host your service.xml file, and strip your extension code out of the EXT plugin.

Trust me, you only want to use an EXT plugin where it is absolutely necessary. It is the most fragile plugin in the Liferay ecosystem as it is the most likely type of plugin that breaks during Liferay upgrades.

I'm willing to bet that whatever you're trying to do in an EXT plugin is better handled as a different type of plugin (or plugins) altogether.


You can give me a example about SB ext-plugin that run build-service will have not error null point emoticon
Prabhu Rajendran, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Mensagem: 1 Data de Entrada: 15/05/13 Postagens Recentes
Hi Hung Quang,

Are you able fix this issue? Please let me know the solution if it is resolved.

Thanks,
Prabhu
thumbnail
Abdollah Esmaeilpour, modificado 9 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

Junior Member Postagens: 60 Data de Entrada: 22/08/09 Postagens Recentes
I had a similar problem. I have specified a wrong path as service.file for "build-service" target in build.xml. By correcting the path, my problem was solved.
karthik reddy, modificado 10 Anos atrás.

issue : unable to generate the service builder classes in liferay 6.1

Junior Member Postagens: 60 Data de Entrada: 08/04/13 Postagens Recentes
Hi,
Please try it again.Your code is working fine in the version 6.1.1 GA2 version
thumbnail
Hung Quang, modificado 10 Anos atrás.

RE: issue : unable to generate the service builder classes in liferay 6.1

New Member Postagens: 11 Data de Entrada: 08/04/13 Postagens Recentes
give me your file build.username.properties in your SDK plugin, please!