爱国者
爱国者

Reputation: 4348

liferay hook deployment - event class not found exception

I create a hook plugin with liferay-sdk-6.0.6 and define a servlet.service.events.pre event handler :

<service>
    <service-type>servlet.service.events.pre</service-type>
    <service-impl>com.ggd543.liferay.ServicePreAction</service-impl>
</service>

When i deploy it onto liferay-6.0.6-ce bundled jboss 5.1.0 GA, I got the following error:

Caused by: java.lang.ClassNotFoundException: application.startup.events
    at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
    at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:569)
    at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:218)
    ... 68 more

Is there any wrong in my liferay-hook.xml ?

Upvotes: 0

Views: 1721

Answers (1)

Sandeep Nair
Sandeep Nair

Reputation: 3660

Yes. From Liferay 6 you dont define events like that in liferay-hook.xml. You have to create property hook and define your event in the property file. Some thing like below

liferay-hook.xml

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

</hook>

portal.properties

servlet.service.events.pre=com.ggd543.liferay.ServicePreAction

Upvotes: 3

Related Questions