Foren

Build service failed suddenly

sys oncloud, geändert vor 7 Jahren.

Build service failed suddenly

New Member Beiträge: 6 Beitrittsdatum: 20.03.13 Neueste Beiträge
Hi, I'm using liferay-plugins-sdk-6.2, the server builder works all the time, but since yesterday I add several methods in *LocalServiceImpl.java" and run build service again, it just fails! ( I promise the portal-impl.jar no touch),
I googled and no related message, anyone can give me some suggestion? thanks!

[Console output redirected to file:/home/resource/workspace/eclipse_liferay-2.2.4/.metadata/.plugins/com.liferay.ide.sdk.core/sdk.log]
Buildfile: /home/resource/portal/liferay-plugins-sdk-6.2/hooks/mes-portal-hook/build.xml
build-service:
[copy] Copying 14 files to /home/resource/portal/liferay-plugins-sdk-6.2/hooks/mes-portal-hook/docroot/WEB-INF/classes
[copy] Copied 11 empty directories to 5 empty directories under /home/resource/portal/liferay-plugins-sdk-6.2/hooks/mes-portal-hook/docroot/WEB-INF/classes
[java] Java Result: 1
[echo] Loading jar:file:/home/tool/liferay-portal-6.2-ce-ga5/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
[echo] Loading jar:file:/home/tool/liferay-portal-6.2-ce-ga5/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
[echo] Loading file:/home/tool/liferay-portal-6.2-ce-ga5/tomcat-7.0.62/webapps/ROOT/WEB-INF/classes/portal-ext.properties
[echo] Loading jar:file:/home/tool/liferay-portal-6.2-ce-ga5/tomcat-7.0.62/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/com/liferay/portal/tools/dependencies/portal-tools.properties
[echo] Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.liferay.portal.kernel.resiliency.spi.SPIRegistryUtil' defined in class path resource [META-INF/util-spring.xml]: Error setting property values; nested exception is org.springframework.beans.NotWritablePropertyException: Invalid property 'sPIRegistry' of bean class [com.liferay.portal.kernel.resiliency.spi.SPIRegistryUtil]: Bean property 'sPIRegistry' is not writable or has an invalid setter method. Did you mean 'SPIRegistry'?
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1279)
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1010)
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:472)
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
[echo] at java.security.AccessController.doPrivileged(Native Method)
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
[echo] at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
[echo] at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
[echo] at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
[echo] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
[echo] at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
[echo] at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
[echo] at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:728)
[echo] at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:380)
[echo] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
[echo] at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
[echo] at com.liferay.portal.spring.context.ArrayApplicationContext.<init>(ArrayApplicationContext.java:31)
[echo] at com.liferay.portal.spring.util.SpringUtil._loadContext(SpringUtil.java:74)
[echo] at com.liferay.portal.spring.util.SpringUtil.loadContext(SpringUtil.java:60)
[echo] at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:189)
[echo] at com.liferay.portal.util.InitUtil.initWithSpring(InitUtil.java:166)
[echo] at com.liferay.portal.tools.servicebuilder.ServiceBuilder.main(ServiceBuilder.java:199)
[echo] Caused by: org.springframework.beans.NotWritablePropertyException: Invalid property 'sPIRegistry' of bean class [com.liferay.portal.kernel.resiliency.spi.SPIRegistryUtil]: Bean property 'sPIRegistry' is not writable or has an invalid setter method. Did you mean 'SPIRegistry'?
[echo] at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:801)
[echo] at org.springframework.beans.BeanWrapperImpl.setPropertyValue(BeanWrapperImpl.java:651)
[echo] at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:78)
[echo] at org.springframework.beans.AbstractPropertyAccessor.setPropertyValues(AbstractPropertyAccessor.java:59)
[echo] at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1276)
[echo] ... 21 more

BUILD FAILED
/home/resource/portal/liferay-plugins-sdk-6.2/build-common-plugin.xml:443: The following error occurred while executing this line:
/home/resource/portal/liferay-plugins-sdk-6.2/build-common-plugin.xml:147: Service Builder generated exceptions.
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: Build service failed suddenly

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
Hey, "sys".

I don't know if you're aware, but you should not be building services in hooks. It's simply not supported.
sys oncloud, geändert vor 7 Jahren.

RE: Build service failed suddenly

New Member Beiträge: 6 Beitrittsdatum: 20.03.13 Neueste Beiträge
David H Nebinger:
Hey, "sys".

I don't know if you're aware, but you should not be building services in hooks. It's simply not supported.


Hi David,

Although hook, it also can add service builder, and it work in this way previously.

Thanks
thumbnail
David H Nebinger, geändert vor 7 Jahren.

RE: Build service failed suddenly

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
I feel that may be happenstance, but it truly is not supported.

A hook has no real runtime context, unlike a portlet plugin which does. Hooks usually run only within the ROOT web app context and don't really have a context on their own.

Although it might have worked in the past, as it is truly unsupported it does not surprise me that it doesn't work now.

Personally I usually use a separate portlet plugin project. I don't put a real portlet in there (I just leave the "hello world" sample that is generated by the sdk as a default), but it's enough of a runtime context to host the service implementation. If you need the service in a hook (i.e. a JSP hook), the service jar will have to be made global though so the service would be available to the ROOT context.