掲示板

service-builder-import exception

12年前 に rana datra によって更新されました。

service-builder-import exception

New Member 投稿: 1 参加年月日: 11/09/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
12年前 に Gregory Amerson によって更新されました。

RE: service-builder-import exception

Liferay Legend 投稿: 1123 参加年月日: 10/02/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.
12年前 に Rana Datra によって更新されました。

RE: service-builder-import exception

New Member 投稿: 5 参加年月日: 11/09/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
12年前 に Gregory Amerson によって更新されました。

RE: service-builder-import exception

Liferay Legend 投稿: 1123 参加年月日: 10/02/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.
12年前 に Mikko Torri によって更新されました。

RE: service-builder-import exception

Junior Member 投稿: 33 参加年月日: 11/05/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
12年前 に Mikko Torri によって更新されました。

RE: service-builder-import exception

Junior Member 投稿: 33 参加年月日: 11/05/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.
12年前 に K. Behrends によって更新されました。

RE: service-builder-import exception

New Member 投稿: 4 参加年月日: 12/01/06 最新の投稿
And the new 6.1.0 dtd has the json-enabled attribute removed, right?
thumbnail
9年前 に shreyas bhargava によって更新されました。

RE: service-builder-import exception

New Member 投稿: 5 参加年月日: 12/06/05 最新の投稿
it really work thank you