Forums

Home » Liferay IDE » English

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Ohad Raz
Service Builder does not generates code
October 28, 2012 11:36 PM
Answer

Ohad Raz

Rank: New Member

Posts: 23

Join Date: June 27, 2012

Recent Posts

Hi,

I read about the service builder, and it sound like a great tool.
So I've tried it, but it won't work...
I created a new Liferay project, created a service.xml in the docroot/WEB-INF/ directory, and have it's content to be:
 1
 2<?xml version="1.0" encoding="UTF-8"?>
 3<!DOCTYPE service-builder PUBLIC
 4          "-//Liferay//DTD Service Builder 6.1.0//EN"
 5          "http://www.liferay.com/dtd/liferay-service-builder_6_1_0.dtd">
 6
 7<service-builder package-path="poc.carrier">
 8   <author><![CDATA[<a href="ohad.raz@orbitz.com">Raz, Ohad</a>]]></author>
 9   <namespace>carrier</namespace>
10
11   <entity name="AirCarrier" table="PP_AIR_CARRIER" local-service="true"
12      remote-service="true" cache-enabled="true">
13
14      <!-- PK fields -->
15      <column db-name="PP_AIR_CARRIER_ID" name="airCarrierID" type="long" primary="true" />
16
17      <!-- Audit fields -->
18      <column db-name="CREATE_DATE" name="createDate" type="Date" />
19      <column db-name="MODIFIED_DATE" name="modifiedDate" type="Date" />
20
21      <!-- Other fields -->
22      <column db-name="CARRIER_CODE" name="carrierCode" type="String" />
23      <column db-name="CARRIER_NAME" name="carrierName" type="String" />
24
25      <!-- Order -->
26      <order by="asc">
27         <order-column name="carrierCode" />
28      </order>
29
30      <!-- Finder methods -->
31      <finder name="carrierCode" return-type="Collection">
32         <finder-column name="carrierCode" />
33      </finder>
34   </entity>
35</service-builder>


Now when I try running the plug-in's "Build Services" it gives me the following error:
 1
 2[Console output redirected to file:/home/oraz/projects/partner-portal/.metadata/.plugins/com.liferay.ide.eclipse.sdk/sdk.log]
 3Buildfile: /home/oraz/projects/partner-portal/liferay-sdk/portlets/carrier-service-builder-poc-portlet/build.xml
 4build-service:
 5     [java] org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portlet.documentlibrary.util.DLProcessorRegistryUtil' defined in class path resource [META-INF/util-spring.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dLProcessorRegistry' of bean class [com.liferay.portlet.documentlibrary.util.DLProcessorRegistryUtil]: Bean property 'dLProcessorRegistry' is not writable or has an invalid setter method. Did you mean 'DLProcessorRegistry'?
 6     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:194)
 7     [java]     at org.apache.tools.ant.taskdefs.Java.run(Java.java:771)
 8     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:221)
 9     [java]     at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
10     [java]     at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
11     [java]     at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:291)
12     [java]     at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
13     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
14     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
15     [java]     at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
16     [java]     at org.apache.tools.ant.Task.perform(Task.java:348)
17     [java]     at org.apache.tools.ant.Target.execute(Target.java:392)
18     [java]     at org.apache.tools.ant.Target.performTasks(Target.java:413)
19     [java]     at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1399)
20     [java]     at org.apache.tools.ant.Project.executeTarget(Project.java:1368)
21     [java]     at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
22     [java]     at org.eclipse.ant.internal.launching.remote.EclipseDefaultExecutor.executeTargets(EclipseDefaultExecutor.java:32)
23     [java]     at org.apache.tools.ant.Project.executeTargets(Project.java:1251)
24     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.run(InternalAntRunner.java:424)
25     [java]     at org.eclipse.ant.internal.launching.remote.InternalAntRunner.main(InternalAntRunner.java:138)
26     [java] Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portlet.documentlibrary.util.DLProcessorRegistryUtil' defined in class path resource [META-INF/util-spring.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'dLProcessorRegistry' of bean class [com.liferay.portlet.documentlibrary.util.DLProcessorRegistryUtil]: Bean property 'dLProcessorRegistry' is not writable or has an invalid setter method. Did you mean 'DLProcessorRegistry'?
27     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1125)
28     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:857)
29     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:423)
30     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
31     [java]     at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
32     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
33     [java]     at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
34     [java]     at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
35     [java]     at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
36     [java]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
37     [java]     at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:76)
38     [java]     at com.liferay.portal.spring.context.ArrayApplicationContext.<init>(ArrayApplicationContext.java:31)
39     [java]     at com.liferay.portal.spring.util.SpringUtil.loadContext(SpringUtil.java:56)
40     [java]     at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:161)
41     [java]     at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:117)
42     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
43     [java]     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
44     [java]     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
45     [java]     at java.lang.reflect.Method.invoke(Method.java:597)
46     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:217)
47     [java]     at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:152)
48     [java]     ... 19 more
49     [java] Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'dLProcessorRegistry' of bean class [com.liferay.portlet.documentlibrary.util.DLProcessorRegistryUtil]: Bean property 'dLProcessorRegistry' is not writable or has an invalid setter method. Did you mean 'DLProcessorRegistry'?
50     [java]     at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:793)
51     [java]     at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:645)
52     [java]     at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
53     [java]     at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
54     [java]     at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1122)
55     [java]     ... 39 more
56     [java] Java Result: -1
57     [echo] ${service.test.output}
58    [mkdir] Created dir: /home/oraz/projects/partner-portal/liferay-sdk/portlets/carrier-service-builder-poc-portlet/docroot/WEB-INF/service-classes
59compile-java:
60      [zip] Warning: skipping zip archive /home/oraz/projects/partner-portal/liferay-sdk/portlets/carrier-service-builder-poc-portlet/docroot/WEB-INF/lib/carrier-service-builder-poc-portlet-service.jar because no files were included.
61   [delete] Deleting directory /home/oraz/projects/partner-portal/liferay-sdk/portlets/carrier-service-builder-poc-portlet/docroot/WEB-INF/service-classes
62BUILD SUCCESSFUL
63Total time: 4 seconds


So I dug into it, and realized that I had an artifact (say A1) that went right into the ${CATALINA_HOME}/lib/ext directory, that had a dependency of the complete spring artifacts. This yields that all spring jars were in the ${CATALINA_HOME}/lib/ext directory (including spring-context.jar).
I figure that when Service Builder executes, it tries to create a spring context, and seems to fail.
Anyway, that notorious A1 artifact actually uses only spring-beans (and spring-core by dependency), so I could replace the complete spring jars with only those specific two (i.e., spring-beans.jar and spring-core.jar).
Once I did that, the server succeeded to got up and run OK, and the Service Builder successfully generated its code.
So I guess my issue is solved.

However,
Shouldn't it be treated as a bug of Liferay IDE?
I mean, regardless of the artifacts one have in ${CATALINA_HOME/lib/ext} directory, one would expect Service Builder to be able to generate its code.

Cheers,
Ohad
Gregory Amerson
RE: Service Builder does not generates code
October 29, 2012 2:30 AM
Answer

Gregory Amerson

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1028

Join Date: February 16, 2010

Recent Posts

Hi Ohad,

Thanks for this report. Please do open up a ticket in jira using the LPS project. And then for the component choose service builder. Thanks again for taking the time to report this issue.
Ohad Raz
RE: Service Builder does not generates code
October 29, 2012 11:55 AM
Answer

Ohad Raz

Rank: New Member

Posts: 23

Join Date: June 27, 2012

Recent Posts

Filed IDE-720.

Cheers,
Ohad