liferay钩子部署 - 事件类未找到异常

时间:2012-07-04 09:07:18

标签: java hook liferay jboss5.x liferay-6

我使用 liferay-sdk-6.0.6 创建一个hook插件,并定义一个servlet.service.events.pre事件处理程序:

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

当我将它部署到liferay-6.0.6-ce捆绑的jboss 5.1.0 GA时,我收到以下错误:

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

我的liferay-hook.xml有什么问题吗?

1 个答案:

答案 0 :(得分:3)

是。从Liferay 6开始,你不要在liferay-hook.xml中定义类似的事件。您必须创建属性钩子并在属性文件中定义事件。有些事情如下

<强>的liferay-hook.xml

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

</hook>

<强> portal.properties

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