Fórumok

Nyitólap » Liferay Portal » English » 3. Development

Kombinált nézet Egyszerű nézet Fa-nézet
Szálak [ Előző | Következő ]
toggle
Rico D'Amore
service builder not generating content for sql directory
2012. április 10. 11:47
Válasz

Rico D'Amore

Rangsorolás: New Member

Hozzászólások: 13

Csatlakozás dátuma: 2012. március 29.

Legújabb hozzászólások

Hi,
My question revolves around the service builder. I have written a service.xml file with the intention of connecting to a different db than lportal. However, before I have gotten to the part where I create an ext-spring.xml file and my jdbc.properties file, I'm noticing that my build-services command is creating my WEB-INF/sql directory, but not putting anything in the files within that directory.

Here is the output from my service-builder task execution: I should mention that I'm using the jsf facet for liferay.

[Console output redirected to file:/Users/Rico/Documents/workspace/liferay/.metadata/.plugins/com.liferay.ide.eclipse.sdk/sdk.log]
Buildfile: /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/build.xml
build-service:
Loading jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Apr 10, 2012 6:17:24 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Global lib directory /usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/lib/ext/
Apr 10, 2012 6:17:24 PM com.liferay.portal.kernel.log.Jdk14LogImpl info
INFO: Portal lib directory /usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/
18:17:24,541 INFO [EasyConf:122] Refreshed the configuration of all components
18:17:24,933 INFO [ConfigurationLoader:56] Properties for jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal loaded from [jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties, jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties]
Loading jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/local/Portal-Dev/bundles/liferay/tomcat-7.0.23/webapps/ROOT/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/lib/util-java.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
Building Kid
Deleting: /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/ServiceBuilder.temp
Created dir: /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/service-classes
compile-java:
Copied 7 empty directories to 4 empty directories under /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/service-classes
Compiling 14 source files to /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/service-classes
Building zip: /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/lib/TagMyVideo-portlet-service.jar
Deleting directory /usr/local/Portal-Dev/plugins/portlets/TagMyVideo-portlet/docroot/WEB-INF/service-classes
BUILD SUCCESSFUL
Total time: 11 seconds


As we can see above the sql directory is indeed being created and everything else that service-builder is being done without any trouble. But the files in the WEB-INF/sql directory are empty.

Can anyone comment on this? Here is my service.xml file:

<?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.tagmyvideo.kid">
<author>Rico</author>
<namespace>kid</namespace>

<entity name="Kid"
local-service="true"
remote-service="false"
data-source="myAppDataSource"
session-factory="myAppSessionFactory"
tx-manager="myAppTransactionManager">

<!-- PK fields -->

<column name="kidId" type="long" primary="true" />
<column name="kidFirstName" type="String"/>
<column name="kidLastName" type="String"/>
<column name="kidAge" type="String"/>
<column name="kidEmail" type="String"/>
<column name="dateEntered" type="Date"/>


<!-- Order -->

<order>
<order-column name="kidId" order-by="asc"/>

</order>

<!-- Finder methods -->

<finder name="KidAge" return-type="Collection">
<finder-column name="kidAge"/>
</finder>
</entity>
</service-builder>

Thank you!
David H Nebinger
RE: service builder not generating content for sql directory
2012. április 10. 12:54
Válasz

David H Nebinger

Rangsorolás: Liferay Legend

Hozzászólások: 4550

Csatlakozás dátuma: 2006. szeptember 1.

Legújabb hozzászólások

Does it work if you take out the undefined data-source, session-factory, and tx-manager beans?
Rico D'Amore
RE: service builder not generating content for sql directory
2012. április 10. 13:27
Válasz

Rico D'Amore

Rangsorolás: New Member

Hozzászólások: 13

Csatlakozás dátuma: 2012. március 29.

Legújabb hozzászólások

Hi,

No, I tried that just recently, but to no avail. However, I was suspecting that the project was in some way corrupt. I had been messing around with it for hours, and I felt that a fresh project might do the trick.

I created a new project, and before creating the ext-spring.xml, I created the service.xml and ran it. It worked. I have a feeling that I had old corrupt project data somewhere.

So short story is I found a work-around, but I don't know how it became corrupted to begin with. I wonder where I could look for files etc... that could be cleaned. I looked in the plugins directory within the sdk, and didn't find anything, but that by no means is where I was supposed to look. I completely wiped out the old project.

So, good news for the project, bad news for my understanding of how the issue was created (by me)....
Jyothi Rajesh
RE: service builder not generating content for sql directory
2013. március 4. 1:03
Válasz

Jyothi Rajesh

Rangsorolás: New Member

Hozzászólások: 2

Csatlakozás dátuma: 2012. november 22.

Legújabb hozzászólások

Hi,

We had a similar problem in our project. We were using a different database than the default one and the tables.sql was being generated as a 0KB file.

Here is what I found out. This is Liferay version 6.0.5 and I am not sure if this has been fixed in 6.1
"ServiceBuilder has a line in the _createSQLTables function as follows:
if (!entity.isDefaultDataSource()) {
continue;
}
"
Since we specify a different dataSource attribute for this entity in the service.xml file, this attribute is set to false for this entity. So, the tables never get generated!!!!

I searched for this quite a lot and then had to rely on the source. I debugged Service Builder when I ran the ant script to build the services and that is when I found this out!

Hope this gets fixed soon!

Thanks and Regards,
Jyothi