简体   繁体   中英

When I deploy two portlets one after another in liferay the second deployed portlet is undeploying the first deployed portlet in liferay

When I am deploying two portlets in liferay 6.0.6 on tomcat server one after another portlet, the second deploying portlet is undeploying the first deployed portlet and vice versa happening when changing its order:

Stacktrace:

 2ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for abc-portlet
 3com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering plugins for abc-portlet
 4    at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
 5    at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:161)
 6    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
 7    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:182)
 8    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
 9    at com.liferay.portal.kernel.servlet.PortletContextListener.doPortalInit(PortletContextListener.java:99)
10    at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
11    at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:52)
12    at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:50)
13    at com.liferay.portal.kernel.servlet.PortletContextListener.contextInitialized(PortletContextListener.java:55)
14    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
15    at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
16    at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
17    at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
18    at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
19    at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
20    at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
21    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
22    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
23    at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
24    at java.lang.Thread.run(Thread.java:744)
25Caused by: com.liferay.portal.OldServiceComponentException: Build namespace abc has build number 20 which is newer than 4
26    at com.liferay.portal.service.impl.ServiceComponentLocalServiceImpl.initServiceComponent(ServiceComponentLocalServiceImpl.java:128)
27    at sun.reflect.GeneratedMethodAccessor689.invoke(Unknown Source)
28    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
29    at java.lang.reflect.Method.invoke(Method.java:606)
30    at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:309)
31    at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)
    at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:110)
    at com.liferay.portal.dao.jdbc.aop.DynamicDataSourceTransactionInterceptor.invoke(DynamicDataSourceTransactionInterceptor.java:44)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
    at com.liferay.portal.spring.aop.ChainableMethodAdvice.invoke(ChainableMethodAdvice.java:58)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89)
    at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)
    at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:202)
    at com.sun.proxy.$Proxy74.initServiceComponent(Unknown Source)
    at com.liferay.portal.service.ServiceComponentLocalServiceUtil.initServiceComponent(ServiceComponentLocalServiceUtil.java:243)
    at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.initServiceComponent(PluginPackageHotDeployListener.java:306)
    at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.doInvokeDeploy(PluginPackageHotDeployListener.java:217)
    at com.liferay.portal.deploy.hot.PluginPackageHotDeployListener.invokeDeploy(PluginPackageHotDeployListener.java:158)
    ... 19 more
09:02:30,390 INFO  [HookHotDeployListener:394] Registering hook for abc-portlet
09:02:34,913 INFO  [HookHotDeployListener:649] Hook for abc-portlet is available for use

Any Solution?

Looking at stack trace

Caused by: com.liferay.portal.OldServiceComponentException: Build namespace abc has build number 20 which is newer than 4

it seems you need to update build number.

Either change in service.properties or update build number in release_ table for particular portlet

you can refer to below Link

http://itsliferay.blogspot.co.uk/2012/04/build-number-deployment-error.html

I have found the solution after lots of digging and fixed the issue, you can fix this via following steps:

  1. before deployment of any portlet need to delete entry of pre-deployed portlets in lportal database from servicecomponent table via following command : eg: DELETE FROM servicecomponent WHERE buildNamespace = 'abc';

  2. Now re-deploy your portlet will not throw exception: Caused by: com.liferay.portal.OldServiceComponentException: Build namespace abc has build number 20 which is newer than 4

Caused by: com.liferay.portal.OldServiceComponentException: Build namespace yourProject has build number x which is newer than y

Solution: go to service.properties change the build.number=x

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM