Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Hung Quang
Service Builder Error java.lang.nullPointerException in ext plugin
May 3, 2013 9:54 PM
Answer

Hung Quang

Rank: New Member

Posts: 11

Join Date: April 8, 2013

Recent Posts

Hi everybody!

I create ext-plugin


My service.xml



 1<?xml version="1.0" encoding="UTF-8"?>
 2<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.1.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
 3<service-builder package-path="com.telsoft.portal">
 4    <author>Administrator</author>
 5    <namespace>Portal</namespace>
 6
 7    <entity name="Attachment" local-service="true" remote-service="true"
 8        table="Attachment">
 9
10        <!-- Primary key fields -->
11        <column name="attachmentId" type="long" primary="true" />
12
13        <!-- Audit fields -->
14        <column name="groupId" type="long" />
15        <column name="companyId" type="long" />
16
17        <!-- Other fields -->
18        <column name="entryId" type="long" />
19        <column name="entryClass" type="String" />
20        <column name="fileEntryId" type="long" />
21        <column name="folderId" type="long" />
22        <column name="fileName" type="String" />
23        <column name="imageId" type="long" />
24        <column name="extension" type="String" />
25
26        <!-- Sorting -->
27
28        <!-- Finder methods -->
29        <finder name="Entry" return-type="Collection">
30            <finder-column name="entryId" />
31            <finder-column name="entryClass" />
32        </finder>
33
34        <finder name="C_F_N" return-type="Attachment">
35            <finder-column name="entryClass" />
36            <finder-column name="folderId" />
37            <finder-column name="fileName" />
38        </finder>
39
40    </entity>
41
42    <entity name="PortletFolder" local-service="true"
43        remote-service="true" table="PortletFolder">
44        <!-- Primary key fields -->
45        <column name="id" type="long" primary="true" />
46
47        <!-- Other fields -->
48        <column name="portletId" type="String" />
49        <column name="folderId" type="long" />
50        <column name="description" type="String" />
51
52        <finder name="PortletId" return-type="Collection">
53            <finder-column name="portletId" />
54        </finder>
55
56        <finder name="FolderId" return-type="Collection">
57            <finder-column name="folderId" />
58        </finder>
59
60        <finder name="P_F" return-type="PortletFolder">
61            <finder-column name="portletId" />
62            <finder-column name="folderId" />
63        </finder>
64
65        <reference package-path="com.liferay.counter" entity="Counter" />
66    </entity>
67
68    <exceptions></exceptions>
69</service-builder>


When i build-service i have problem

 1Buildfile: D:\LIFERAY\Sdk liferay\liferay-plugins-sdk-6.1.1\ext\Vasportal-ext\build.xml
 2build-service:
 3     [echo] .
 4     [echo] WARNING: Support for ServiceBuilder in EXT plugins will be deprecated in future
 5     [echo] versions. EXT plugins are designed to override the portal's core code that
 6     [echo] cannot be done with hooks, layout templates, portlets, or themes. EXT plugins
 7     [echo] are not meant to contain new custom services. Please migrate your service.xml to
 8     [echo] a portlet plugin.
 9     [echo]         
10     [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
11     [java] May 4, 2013 11:32:26 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
12     [java] INFO: Global shared lib directory /D:/LIFERAY/Sdk liferay/liferay-plugins-sdk-6.1.1/lib/
13     [java] May 4, 2013 11:32:26 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
14     [java] INFO: Global lib directory /D:/LIFERAY/Tomcat Liferay/liferay-portal-6.1.1-ce-ga2/tomcat-7.0.27/lib/ext/
15     [java] May 4, 2013 11:32:26 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
16     [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/
17     [java] May 4, 2013 11:32:26 AM com.liferay.portal.kernel.log.Jdk14LogImpl info
18     [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]
19     [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
20     [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
21     [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
22     [java] java.lang.NullPointerException
23     [java]     at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
24     [java]     at com.liferay.util.xml.XMLSafeReader.<init>(XMLSafeReader.java:25)
25     [java]     at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:409)
26     [java]     at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
27     [java]     at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:4002)
28     [java]     at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContent(ServiceBuilder.java:3925)
29     [java]     at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:559)
30     [java]     at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:151)
31     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
32     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
33     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
34     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
35     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
36     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
37     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
38     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
39     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
40     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
41     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
42     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
43     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
44     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
45     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
46     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
47     [java]     at org.apache.tools.ant.Target.execute(Target.java:392)
48     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:413)
49     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
50     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
51     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
52     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
53     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
54     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
55     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
56BUILD SUCCESSFUL
57Total time: 6 seconds


I user SDK 6.1.1 and Tomcat 7.0.27

I have tried about this problem
Please help me!
Attachment

Attachments: portal-ext.png (220.9k)
David H Nebinger
RE: Service Builder Error java.lang.nullPointerException in ext plugin
May 5, 2013 8:18 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 6134

Join Date: September 1, 2006

Recent Posts

As stated in your other post about this, you should listen to the warning about SB in an EXT being deprecated and move it to a separate plugin.