我使用 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
有什么问题吗?
答案 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