Fórum

Getting NPE during creating multiple service.xml !!!

Virat sen, modificado 10 Anos atrás.

Getting NPE during creating multiple service.xml !!!

Junior Member Postagens: 57 Data de Entrada: 21/07/13 Postagens Recentes
Hi All,

I am getting NullPointerException when i want use multiple service.xml file using <service-builder-import > in parent file.

Exception as follows :

[echo] java.lang.NullPointerException
[echo] at com.liferay.portal.kernel.io.unsync.UnsyncStringReader.<init>(UnsyncStringReader.java:34)
[echo] at com.liferay.util.xml.XMLSafeReader.<init>(XMLSafeReader.java:25)
[echo] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:409)
[echo] at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:155)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:4002)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContentDocument(ServiceBuilder.java:4020)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder._getContent(ServiceBuilder.java:3925)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:559)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:151)

code :


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.test" >
<author>Admin</author>
<namespace>abc</namespace>


<entity name="Book" local-service="true" remote-service="false">

<column name="bookId" type="long" primary="true" id-type="increment"/>

<column name="btitle" type="String"/>
<column name="bauthor" type="String"/>

</entity>

<service-builder-import file="service1.xml"/>

</service-builder>


service1.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.test1" >


<entity name="Member" local-service="true" remote-service="false">

<column name="MemId" type="long" primary="true"/>

<column name="mname" type="String"/>
<column name="mtype" type="String"/>

</entity>


</service-builder>



Please help at earliest....

Thanks,
Virat
thumbnail
Zsigmond Rab, modificado 10 Anos atrás.

RE: Getting NPE during creating multiple service.xml !!!

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Virat,

if you haven't solved yet...

In theory, the NPE can come there only if the content is null. The content can be null if it gets a null value back during it's being read. Are you sure about that the service1.xml is on the right place?

Regards,
Zsigmond
Virat sen, modificado 10 Anos atrás.

RE: Getting NPE during creating multiple service.xml !!!

Junior Member Postagens: 57 Data de Entrada: 21/07/13 Postagens Recentes
Zsigmond Rab:
Hi Virat,

if you haven't solved yet...

In theory, the NPE can come there only if the content is null. The content can be null if it gets a null value back during it's being read. Are you sure about that the service1.xml is on the right place?

Regards,
Zsigmond



Hi Zsigmond,

Thanks for your reply.
Yes.
I put service1.xml in the same location of service.xml 's default location defined by LDS

as well as i mentioned in service.xml as following code :

<service-builder-import file="service1.xml"/>

Hope,its correct.
Please correct me if i am wrong.

Thanks,
thumbnail
Zsigmond Rab, modificado 10 Anos atrás.

RE: Getting NPE during creating multiple service.xml !!!

Liferay Master Postagens: 728 Data de Entrada: 05/01/10 Postagens Recentes
Hi Virat,

have you tried to debug what is the problem? I think, that would be the most efficient way.

Regards,
Zsigmond