Forums

Home » Liferay Portal » English » 3. Development

Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Marcin sa
Override methods in xxxLocalServiceImpl
December 18, 2012 2:15 PM
Answer

Marcin sa

Rank: New Member

Posts: 21

Join Date: June 27, 2012

Recent Posts

Hi,
how to override protected methods from xxxLocalService. I'm trying to extend LocalServiceWrapper but have errors:

 1ERROR [pool-2-thread-4][HotDeployImpl:191] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for Calendar-hook
 2com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for Calendar-hook
 3    at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:46)
 4    at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:276)
 5    at com.liferay.portal.deploy.hot.HotDeployImpl.doFireDeployEvent(HotDeployImpl.java:188)
 6    at com.liferay.portal.deploy.hot.HotDeployImpl.fireDeployEvent(HotDeployImpl.java:96)
 7    at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:27)
 8    at com.liferay.portal.kernel.servlet.PluginContextListener.fireDeployEvent(PluginContextListener.java:151)
 9    at com.liferay.portal.kernel.servlet.PluginContextListener.doPortalInit(PluginContextListener.java:141)
10    at com.liferay.portal.kernel.util.BasePortalLifecycle.portalInit(BasePortalLifecycle.java:42)
11    at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:64)
12    at com.liferay.portal.kernel.util.PortalLifecycleUtil.register(PortalLifecycleUtil.java:56)
13    at com.liferay.portal.kernel.util.BasePortalLifecycle.registerPortalLifecycle(BasePortalLifecycle.java:52)
14    at com.liferay.portal.kernel.servlet.PluginContextListener.contextInitialized(PluginContextListener.java:103)
15    at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4779)
16    at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5273)
17    at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
18    at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:895)
19    at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:871)
20    at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
21    at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1099)
22    at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1621)
23    at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
24    at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
25    at java.util.concurrent.FutureTask.run(FutureTask.java:138)
26    at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
27    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
28    at java.lang.Thread.run(Thread.java:619)
29Caused by: java.lang.NoClassDefFoundError: com/liferay/portlet/calendar/service/impl/CalEventLocalServiceImpl
30    at java.lang.ClassLoader.defineClass1(Native Method)
31    at java.lang.ClassLoader.defineClassCond(ClassLoader.java:632)
32    at java.lang.ClassLoader.defineClass(ClassLoader.java:616)
33    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:141)
34    at org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2889)
35    at org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1170)
36    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
37    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
38    at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:603)
39    at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:273)
40    ... 24 more
41Caused by: java.lang.ClassNotFoundException: com.liferay.portlet.calendar.service.impl.CalEventLocalServiceImpl
42    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1711)
43    at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1556)
44    ... 34 more
Amos Fong
RE: Override methods in xxxLocalServiceImpl
December 20, 2012 5:42 PM
Answer

Amos Fong

LIFERAY STAFF

Rank: Liferay Legend

Posts: 1912

Join Date: October 7, 2008

Recent Posts

Hi Marcin,

You can't override protected methods from a hook. You only have access to the service interface. If you want to this in a hook, you'll need to duplicate the protected methods and only override the public methods. The other option is to use an ext-plugin instead.