Foros de discusión

Can't deploy a hook

Martin Phee, modificado hace 12 años.

Can't deploy a hook

Junior Member Mensajes: 25 Fecha de incorporación: 9/05/11 Mensajes recientes
I'm trying to deploy a hook and keep getting these errors. I get the same error on 6.0.6 EE and 6.0.5.

15:16:57,229 INFO [HookHotDeployListener:406] Registering hook for test-hook
15:16:57,237 ERROR [HookHotDeployListener:439] Unable to read portal.properties
com.germinus.easyconf.ConfigurationNotFoundException: Error reading configuration for /opt/liferay-portal-6.0-ee-sp1/tomcat-6.0.29/webapps/test-hook/WEB-INF/classes/portal: The base properties file was not found
at com.germinus.easyconf.ComponentConfiguration.getProperties(ComponentConfiguration.java:143)
at com.liferay.portal.configuration.ConfigurationImpl.getComponentProperties(ConfigurationImpl.java:321)
at com.liferay.portal.configuration.ConfigurationImpl.printSources(ConfigurationImpl.java:373)
at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:134)
at com.liferay.portal.configuration.ConfigurationImpl.<init>(ConfigurationImpl.java:62)
at com.liferay.portal.configuration.ConfigurationFactoryImpl.getConfiguration(ConfigurationFactoryImpl.java:28)
at com.liferay.portal.kernel.configuration.ConfigurationFactoryUtil.getConfiguration(ConfigurationFactoryUtil.java:25)
at com.liferay.portal.deploy.hot.HookHotDeployListener.doInvokeDeploy(HookHotDeployListener.java:435)
at com.liferay.portal.deploy.hot.HookHotDeployListener.invokeDeploy(HookHotDeployListener.java:222)
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.check(HostConfig.java:1345)
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(Thread.java:662)
15:16:57,238 INFO [HookHotDeployListener:662] Hook for test-hook is available for use
thumbnail
Ronak Patel, modificado hace 12 años.

RE: Can't deploy a hook

New Member Mensajes: 19 Fecha de incorporación: 20/01/10 Mensajes recientes
Hi Martin,
Remove <portal-properties></portal-properties> tag from liferay-hook.xml file under WEB-INF, if you do not have any custom property to be set in portal.properties.
Re generate war file and deploy it.

Thanks,
Ronak
Martin Phee, modificado hace 12 años.

RE: Can't deploy a hook

Junior Member Mensajes: 25 Fecha de incorporación: 9/05/11 Mensajes recientes
I have this in my portal.properties file.
servlet.service.events.pre=com.liferay.portal.events.ServicePreAction,com.apolloglobal.liferay.pre.AddPermCheckerHook.AddCarbonPermissions

How else would I get liferay to call my hook?
thumbnail
Thiago Leão Moreira, modificado hace 12 años.

RE: Can't deploy a hook

Liferay Legend Mensajes: 1449 Fecha de incorporación: 10/10/07 Mensajes recientes
How is your liferay-hook.xml is configured?
Martin Phee, modificado hace 12 años.

RE: Can't deploy a hook

Junior Member Mensajes: 25 Fecha de incorporación: 9/05/11 Mensajes recientes
<hook>
<portal-properties>portal.properties</portal-properties>
</hook>

I have my file here: [app-root]/docroot/WEB-INF/src/portal.properties

IN my file I have:
servlet.service.events.pre=com.liferay.portal.events.ServicePreAction,com.apolloglobal.liferay.pre.AddPermCheckerHook.AddCarbonPermissions

I want the orignal to run and then mine. I've tried it with just my hook and get the same results.

thanks for help!
thumbnail
Ronak Patel, modificado hace 12 años.

RE: Can't deploy a hook

New Member Mensajes: 19 Fecha de incorporación: 20/01/10 Mensajes recientes
Can you check that the same is available in classes folder?
Looks like it is missing there.
Martin Phee, modificado hace 12 años.

RE: Can't deploy a hook

Junior Member Mensajes: 25 Fecha de incorporación: 9/05/11 Mensajes recientes
It's there, but liferay changes it. What's base.path supposed to reference?

servlet.service.events.pre=com.liferay.portal.events.ServicePreAction,com.apolloglobal.liferay.pre.AddPermCheckerHook.AddCarbonPermissions



base.path=/Users/mphee/development/app_servers/liferayDev/tomcat/webapps/add-perm-checker-hook/WEB-INF/classes/portal.properties
thumbnail
Ronak Patel, modificado hace 12 años.

RE: Can't deploy a hook

New Member Mensajes: 19 Fecha de incorporación: 20/01/10 Mensajes recientes
Try setting below in your portal.properties file in hook:

include-and-override=portlet-ext.properties.

base.path=[server location]/webapps/hook-name/WEB-INF/classes/portlet.properties

-
Ronak
Martin Phee, modificado hace 12 años.

RE: Can't deploy a hook

Junior Member Mensajes: 25 Fecha de incorporación: 9/05/11 Mensajes recientes
Same. I tried portal-ext.properties and portal.properties.

The base.path is set correctly by liferay to:
base.path=/Users/mphee/development/app_servers/liferayDev/tomcat/webapps/add-perm-checker-hook/WEB-INF/classes/portal.properties
thumbnail
Jose Herminio Parreno Piqueras, modificado hace 10 años.

RE: Can't deploy a hook

New Member Mensajes: 5 Fecha de incorporación: 26/01/12 Mensajes recientes
Well after struggling with this issue, I made this work as well:

What is really important is that portal.properties file exists in the final war file (WEB-INF/classes) of the pluggin hook.emoticon

If you are not using ant but Maven to build the hook pluggin (like me), be sure you include your properties file in the src/resource folder (that will be by default by maven moved to the WEB-INF/classes when building the war file)

It might sound trivial, but It took me time to figure this out.
Tan Dao, modificado hace 10 años.

RE: Can't deploy a hook

New Member Mensaje: 1 Fecha de incorporación: 14/04/14 Mensajes recientes
I faced this issue, and now I fond the solution.

For Maven project (like me as below, I put portal.properties in src/main/resource/) and it run normally

.......\WORKSPACE\EXAMPLE-01
|   .classpath
|   .project
|   pom.xml
+---src
|   |---main
|       +---java
|       |   |---com
|       |       |---lux
|       |           |---lr
|       |               |---hook
|       |                       LoginAction.java
|       |                       
|       +---resources
|       |      [b] portal.properties[/b]
|       |       
|       |---webapp
|           +---META-INF
|           |   |---custom-jsps
|           |       |---html
|           |           |---portal
|           |                   terms-of-use.jsp
|           |                   
|           |---WEB-INF
|               |   liferay-hook.xml
|               |   liferay-plugin-package.properties
|               |   web.xml
|               |   
|               |---src




<!--?xml version="1.0"?-->


<hook>
	<portal-properties>portal.properties</portal-properties>
	
    <custom-jsp-dir>/META-INF/custom_jsps</custom-jsp-dir>
</hook>
thumbnail
Ronak Patel, modificado hace 12 años.

RE: Can't deploy a hook

New Member Mensajes: 19 Fecha de incorporación: 20/01/10 Mensajes recientes
Can you please provide your liferay-hook.xml file?