Foren

Liferay 6 Login Pre (Hook) ClassCast Exception

thumbnail
Andew Jardine, geändert vor 13 Jahren.

Liferay 6 Login Pre (Hook) ClassCast Exception

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hey Guys,

(Yet another)Liferay newbie here. I'm working with v6, running on Tomcat. I should mention that I am using a development licensed version of EE (incase that matters). I've installed the Liferay IDE plugin in Eclipse (Helios 64-bit)... all this running on Windows 7 x64.

Here is what I have done.
1. Create a new plug-in project -- specific for hooks
2. Created a new hook
3. Created a custom class MyLogin which implements the AutoLogin interface.
4. Ran the build as well as deploy and everything seems to go fine.

I start the server and I get an error (I get the same error while hot deploying with the server running)...


Dec 23, 2010 5:04:14 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
17:04:14,690 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
17:04:14,691 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
17:04:14,793 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
17:04:14,802 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)

.. I've followed others examples and I can't see what I am doing wrong. Can someone provide me a little guidance?

A.
thumbnail
Abhishek Saxena, geändert vor 13 Jahren.

RE: Liferay 6 Login Pre (Hook) ClassCast Exception

Regular Member Beiträge: 130 Beitrittsdatum: 17.06.09 Neueste Beiträge
Hi Andrew ,
Please attach more logs ,I will try to dig more to find out the cause of exception .
From first look at the logs you have attached ,exception can be due to

> Wrong DTD being used
try checking the DTD version being used in liferay-hook.xml


reference
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">

> Try adding -------- portal-kernal.jar in WEB-INF/lib folder.

The steps you have mentioned for creating hooks are fine and the IDE integrationis fine as logs show hot deployment of hook which is failing
Try deploying a custom hook manually or existing community hook manually to chek if the deployment is allowing hot deployment of hooks

Wiki Article on hooks



Sample hook
thumbnail
Andew Jardine, geändert vor 13 Jahren.

RE: Liferay 6 Login Pre (Hook) ClassCast Exception

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
Hi Abhishek,

Thanks for taking the time to help me trouble shoot this problem. I had a look at the liferay-hook.xml and the DTD that is set for the !DOCTYPE is the following...

<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">

I think that this is correct since I am using v6 of the portal itself and from what I have read, the way hooks are handled in v6 is different than v5 (namely the DTD's have changed significantly). I'll have a look at your other suggestions now ... in the meantime, here is the full dump of output that occurs when I try to do an ant deploy to the server while it is in a started state. (this is from the console in eclipse).

the content of my portal.properties file is minimal -- and was generated by the IDE

<?xml version="1.0"?>
<!DOCTYPE hook PUBLIC "-//Liferay//DTD Hook 6.0.0//EN" "http://www.liferay.com/dtd/liferay-hook_6_0_0.dtd">

<hook>
<portal-properties>portal.properties</portal-properties>
</hook>

--[ log starts here ]-------------

Dec 23, 2010 4:32:42 PM org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: C:\Program Files\Java\jre6\bin;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files (x86)\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\NTRU Cryptosystems\NTRU TCG Software Stack\bin\;C:\Program Files\Wave Systems Corp\Gemalto\Access Client\v5\;C:\Program Files\WIDCOMM\Bluetooth Software\;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Endeca\PlatformServices\6.1.0\perl;C:\Endeca\PlatformServices\6.1.0\perl\5.8.3\bin;C:\Endeca\PlatformServices\6.1.0\bin;C:\Endeca\PlatformServices\6.1.0\utilities;C:\Program Files\TortoiseSVN\bin;c:\Program Files (x86)\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\Tools\Binn\;c:\Program Files\Microsoft SQL Server\100\DTS\Binn\;C:\ant\apache-ant-1.8.1\bin;C:\Program Files\Java\jdk1.6.0_22\bin;C:\Program Files\MySQL\MySQL Server 5.5\bin;C:\Program Files (x86)\QuickTime\QTSystem\
Dec 23, 2010 4:32:43 PM org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
Dec 23, 2010 4:32:43 PM org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 590 ms
Dec 23, 2010 4:32:43 PM org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
Dec 23, 2010 4:32:43 PM org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.29
Dec 23, 2010 4:32:43 PM org.apache.catalina.startup.HostConfig deployDescriptor
INFO: Deploying configuration descriptor ROOT.xml
Loading jar:file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/system.properties
Loading jar:file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/portal-impl.jar!/portal.properties
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes/portal-ext.properties
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/portal-ide.properties
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ROOT/WEB-INF/classes/portal-developer.properties
16:32:53,439 INFO [DialectDetector:69] Determining dialect for MySQL 5
16:32:53,549 INFO [DialectDetector:49] Using dialect org.hibernate.dialect.MySQLDialect
16:32:57,387 INFO [PortalImpl:277] Global lib directory /C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/lib/ext/
16:32:57,390 INFO [PortalImpl:297] Portal lib directory /C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ROOT/WEB-INF/lib/
16:33:04,162 INFO [DialectDetector:69] Determining dialect for MySQL 5
16:33:04,168 INFO [DialectDetector:49] Using dialect org.hibernate.dialect.MySQLDialect
Starting Liferay Portal Enterprise Edition 6.0 EE (Bunyan / Build 6010 / September 7, 2010)
16:33:17,690 INFO [BaseDB:403] Database does not support case sensitive queries
16:33:30,193 INFO [PluginPackageUtil:1109] Reloading repositories
16:33:34,570 INFO [HotDeployUtil:69] Initializing hot deploy manager 207538650
16:33:35,824 INFO [AutoDeployDir:105] Auto deploy scanner started for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy
Dec 23, 2010 4:33:37 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory Andrew-portlet
16:33:39,847 INFO [PortletHotDeployListener:220] Registering portlets for Andrew-portlet
16:33:39,918 INFO [PortletHotDeployListener:379] 1 portlet for Andrew-portlet is available for use
Dec 23, 2010 4:33:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory ehealth-hook
16:33:40,488 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
16:33:40,614 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:791)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:771)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:546)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1041)
at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:964)
at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:502)
at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1277)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:321)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1053)
at org.apache.catalina.core.StandardHost.start(StandardHost.java:785)
at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1045)
at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:445)
at org.apache.catalina.core.StandardService.start(StandardService.java:519)
at org.apache.catalina.core.StandardServer.start(StandardServer.java:710)
at org.apache.catalina.startup.Catalina.start(Catalina.java:581)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289)
at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 28 more
Dec 23, 2010 4:33:40 PM org.apache.catalina.startup.HostConfig deployDirectory
INFO: Deploying web application directory tunnel-web
Dec 23, 2010 4:33:43 PM org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
Dec 23, 2010 4:33:43 PM org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
Dec 23, 2010 4:33:43 PM org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/46 config=null
Dec 23, 2010 4:33:43 PM org.apache.catalina.startup.Catalina start
INFO: Server startup in 60216 ms
16:33:46,327 INFO [AutoDeployDir:167] Processing ehealth-hook-6.0.5.1.war
16:33:46,335 INFO [HookAutoDeployListener:43] Copying web plugin for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war
Expanding: C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war into C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223163346341
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223163346341\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223163346341\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223163346341\META-INF
Copying 13 files to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Deleting directory C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223163346341
16:33:47,872 INFO [HookAutoDeployListener:49] Hook for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war copied successfully. Deployment will start in a few seconds.
Dec 23, 2010 4:33:53 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
16:33:53,145 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
16:33:53,146 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
16:33:53,569 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
16:33:53,580 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 15 more
17:04:12,960 INFO [AutoDeployDir:167] Processing ehealth-hook-6.0.5.1.war
17:04:12,961 INFO [HookAutoDeployListener:43] Copying web plugin for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war
Expanding: C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war into C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223170412968
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223170412968\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223170412968\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223170412968\META-INF
Copying 13 files to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Deleting directory C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223170412968
17:04:13,527 INFO [HookAutoDeployListener:49] Hook for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war copied successfully. Deployment will start in a few seconds.
Dec 23, 2010 5:04:14 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
17:04:14,690 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
17:04:14,691 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
17:04:14,793 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
17:04:14,802 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 15 more
17:31:19,158 INFO [PluginPackageUtil:1230] Checking for available updates
17:31:19,161 INFO [PluginPackageUtil:1274] Finished checking for available updates in 1 ms
17:38:07,441 INFO [AutoDeployDir:167] Processing ehealth-hook-6.0.5.1.war
17:38:07,442 INFO [HookAutoDeployListener:43] Copying web plugin for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war
Expanding: C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war into C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223173807448
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223173807448\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223173807448\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223173807448\META-INF
Copying 13 files to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Deleting directory C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223173807448
17:38:07,747 INFO [HookAutoDeployListener:49] Hook for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war copied successfully. Deployment will start in a few seconds.
Dec 23, 2010 5:38:15 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
17:38:15,560 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
17:38:15,561 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
17:38:15,827 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
17:38:15,843 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 15 more
17:45:32,860 INFO [AutoDeployDir:167] Processing ehealth-hook-6.0.5.1.war
17:45:32,861 INFO [HookAutoDeployListener:43] Copying web plugin for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war
Expanding: C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war into C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223174532864
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223174532864\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223174532864\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223174532864\META-INF
Copying 13 files to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Deleting directory C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223174532864
17:45:33,108 INFO [HookAutoDeployListener:49] Hook for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war copied successfully. Deployment will start in a few seconds.
Dec 23, 2010 5:45:36 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
17:45:36,039 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
17:45:36,041 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
17:45:36,143 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
17:45:36,165 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 15 more
18:51:53,603 INFO [AutoDeployDir:167] Processing ehealth-hook-6.0.5.1.war
18:51:53,605 INFO [HookAutoDeployListener:43] Copying web plugin for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war
Expanding: C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war into C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223185153635
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223185153635\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223185153635\WEB-INF\classes
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223185153635\META-INF
Copying 13 files to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Copying 1 file to C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\webapps\ehealth-hook
Deleting directory C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\tomcat-6.0.29\temp\20101223185153635
18:51:54,191 INFO [HookAutoDeployListener:49] Hook for C:\endeca.work\projects\eHealth\liferay-portal-6.0.2\deploy\ehealth-hook-6.0.5.1.war copied successfully. Deployment will start in a few seconds.
Dec 23, 2010 6:51:57 PM org.apache.catalina.startup.HostConfig checkResources
INFO: Reloading context [/ehealth-hook]
18:51:57,825 INFO [ExtHotDeployListener:205] Extension environment for ehealth-hook will not be undeployed
18:51:57,826 INFO [HookHotDeployListener:744] Hook for ehealth-hook was unregistered
18:51:57,918 INFO [HookHotDeployListener:397] Registering hook for ehealth-hook
Loading file:/C:/endeca.work/projects/eHealth/liferay-portal-6.0.2/tomcat-6.0.29/webapps/ehealth-hook/WEB-INF/classes/portal.properties
18:51:57,925 ERROR [HotDeployUtil:112] com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
com.liferay.portal.kernel.deploy.hot.HotDeployException: Error registering hook for ehealth-hook
at com.liferay.portal.kernel.deploy.hot.BaseHotDeployListener.throwHotDeployException(BaseHotDeployListener.java:45)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:224)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._doFireDeployEvent(HotDeployUtil.java:109)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil._fireDeployEvent(HotDeployUtil.java:183)
at com.liferay.portal.kernel.deploy.hot.HotDeployUtil.fireDeployEvent(HotDeployUtil.java:38)
at com.liferay.portal.kernel.servlet.HookContextListener.contextInitialized(HookContextListener.java:36)
at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4135)
at org.apache.catalina.core.StandardContext.start(StandardContext.java:4630)
at org.apache.catalina.startup.HostConfig.checkResources(HostConfig.java:1244)
at org.apache.catalina.startup.HostConfig.check(HostConfig.java:1342)
at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:303)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.core.ContainerBase.backgroundProcess(ContainerBase.java:1337)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1601)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.processChildren(ContainerBase.java:1610)
at org.apache.catalina.core.ContainerBase$ContainerBackgroundProcessor.run(ContainerBase.java:1590)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: com.health.security.EHealthLogin cannot be cast to com.liferay.portal.kernel.events.Action
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvent(HookHotDeployListener.java:1015)
at com.liferay.portal.deploy.hot.HookHotDeployListener.initEvents(HookHotDeployListener.java:1065)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:467)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:221)
... 15 more
thumbnail
Aritz Galdos, geändert vor 13 Jahren.

RE: Liferay 6 Login Pre (Hook) ClassCast Exception

Expert Beiträge: 416 Beitrittsdatum: 15.05.07 Neueste Beiträge
HI Andrew:

I guess you want to implement a custom action hook so you can "inject" some custom logic just before login action.

I am just guessing but I think you class is not extendig "com.liferay.portal.kernel.events.Action" as is mentioned in the doc. As I understood, your class is implementing AutoLogin instead.

Please, refere to action hook doc

Hope this helps,

Aritz Galdos
thumbnail
Andew Jardine, geändert vor 13 Jahren.

RE: Liferay 6 Login Pre (Hook) ClassCast Exception

Liferay Legend Beiträge: 2416 Beitrittsdatum: 22.12.10 Neueste Beiträge
I'll be damed. That fixed it. I guess I was mixing a little of 5.0 with a little 6.0. I'll be more careful in future.
asif aftab, geändert vor 10 Jahren.

RE: Liferay 6 Login Pre (Hook) ClassCast Exception

Regular Member Beiträge: 123 Beitrittsdatum: 02.09.13 Neueste Beiträge
Thanks
Your advice really help me and it is the precise remedy of my problem.
The solution is,
we have to implement Action class which is abstract class so implement all methods and then write your code, my code is

public class PostLoginEvent extends Action {
public PostLoginEvent() {
super();
}

public void run(HttpServletRequest arg0, HttpServletResponse arg1)
throws ActionException {
System.out.println("$$$$$$$$$$$$$ new implemented method");
}
}

where PostLoginEvent is my class name.
When we try to override event by using hook then our class implement SimpleAction class and at the time of hook deployment we get error unable to cast to com.liferay.portal.kernel.events.Action class. So to resolve this we have to implement com.liferay.portal.kernel.events.Action class.