留言板

service-builder-import exception

rana datra,修改在12 年前。

service-builder-import exception

New Member 发布: 1 加入日期: 11-9-26 最近的帖子
Hi,

I have the following service.xml-file:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE service-builder PUBLIC "-//Liferay//DTD Service Builder 6.0.0//EN" "http://www.liferay.com/dtd/liferay-service-builder_6_0_0.dtd">
<service-builder package-path="de.my_stuff.service">
<author>me</author>
<namespace>AssociateService</namespace>

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

<!-- PK fields -->

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

<column name="street" type="String" />
<column name="plc" type="String" />
<column name="location" type="String" />
<column name="county" type="String" />
</entity>

</service-builder>

I'm trying to import a file with the service-builder-import tag:

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

The test.xml-file is in the same directory as the service.xml file but if I run the build service command (that one that comes with the eclipse-sdk) I'm getting the following exception:

"Nested exception: Element type "service-builder-import" must be declared." Then the builder ignores the imported file and moves on.

It doesn't matter if there's a file or not or if this file is written correctly. The exception is always the same.

What am I doing wrong?
thumbnail
Gregory Amerson,修改在12 年前。

RE: service-builder-import exception

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
Hello, I can't tell what could be wrong, it seems ok. I have attached an example project where I added a service builder import file and tested it locally and it works so you can use it to compare to what you have in your project.
Rana Datra,修改在12 年前。

RE: service-builder-import exception

New Member 帖子: 5 加入日期: 11-9-29 最近的帖子
I can't see any relevant difference.

And I'm not able to build your service.xml. the builder says null-pointer-exception.

"An internal error occurred during: "Build services".
java.lang.NullPointerException"

Also for some reason editing the service.xml-files takes forever. I mean, it takes nearly 30 seconds just to save the file.
thumbnail
Gregory Amerson,修改在12 年前。

RE: service-builder-import exception

Liferay Legend 帖子: 1123 加入日期: 10-2-16 最近的帖子
The NPE error is likely because your targeted runtime is not set to Liferay Runtime. Go to project properties > Targeted runtimes, and make sure Liferay v6.0 runtime is selected.
Mikko Torri,修改在12 年前。

RE: service-builder-import exception

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
Although service builder dtd defines service-builder-import for both 6.0.0 and 6.1.0 only 6.1.0 has mention of it in http://docs.liferay.com/portal/6.1/definitions/liferay-service-builder_6_1_0.dtd.html while http://docs.liferay.com/portal/6.0/definitions/liferay-service-builder_6_0_0.dtd.html does not have it.

So I suspect that is the case, since I can't run it either:
D:\liferay-plugins-sdk-6.0.6-20110225\portlets\service-builder-import-portlet>ant build-service
Buildfile: D:\liferay-plugins-sdk-6.0.6-20110225\portlets\service-builder-import-portlet\build.xml

build-service:
[java] Loading jar:file:/D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
[java] Loading file:/D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes/system-ext.properties
[java] Loading jar:file:/D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
[java] Loading file:/D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes/portal-ext.properties
[java] Loading jar:file:/D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
[java] 14:12:12,839 INFO [PortalImpl:278] Global lib directory /D:/liferay-portal-6.0.6/tomcat-6.0.29/lib/ext/
[java] 14:12:12,839 INFO [PortalImpl:298] Portal lib directory /D:/liferay-portal-6.0.6/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/
[java] com.liferay.portal.kernel.xml.DocumentException: Error on line 41 of document file:///D:/liferay-plugins-sdk-6.0.6-20110225/portlets/service-builder-import-portlet/docroot/WEB-INF/service.xml : Element type "service-builder-import" must be declared. Nested exception: Element type "service-builder-import" must be declared.
[java] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:338)
[java] at com.liferay.portal.kernel.xml.SAXReaderUtil.read(SAXReaderUtil.java:115)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:519)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.<init>(ServiceBuilder.java:404)
[java] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:176)
[java] Caused by: org.dom4j.DocumentException: Error on line 41 of document file:///D:/liferay-plugins-sdk-6.0.6-20110225/portlets/service-builder-import-portlet/docroot/WEB-INF/service.xml : Element type "service-builder-import" must be declared. Nested exception: Element type "service-builder-import" must be declared.
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:482)
[java] at org.dom4j.io.SAXReader.read(SAXReader.java:264)
[java] at com.liferay.portal.xml.SAXReaderImpl.read(SAXReaderImpl.java:335)
[java] ... 4 more
[mkdir] Created dir: D:\liferay-plugins-sdk-6.0.6-20110225\portlets\service-builder-import-portlet\docroot\WEB-INF\service-classes

compile-java:
[zip] Warning: skipping zip archive D:\liferay-plugins-sdk-6.0.6-20110225\portlets\service-builder-import-portlet\docroot\WEB-INF\lib\service-builder-import-portlet-service.jar because no files were included.
[delete] Deleting directory D:\liferay-plugins-sdk-6.0.6-20110225\portlets\service-builder-import-portlet\docroot\WEB-INF\service-classes

BUILD SUCCESSFUL
Total time: 5 seconds
Mikko Torri,修改在12 年前。

RE: service-builder-import exception

Junior Member 帖子: 33 加入日期: 11-5-10 最近的帖子
And by changing the dtd to reference 6.1.0 it will build ok with the 6.0.6 sdk, however it will not read the import files.
K. Behrends,修改在12 年前。

RE: service-builder-import exception

New Member 帖子: 4 加入日期: 12-1-6 最近的帖子
And the new 6.1.0 dtd has the json-enabled attribute removed, right?
thumbnail
shreyas bhargava,修改在9 年前。

RE: service-builder-import exception

New Member 帖子: 5 加入日期: 12-6-5 最近的帖子
it really work thank you