Foren

"Hot deploy" does not work (Lifray/Jboss)

Hubert Felber, geändert vor 13 Jahren.

"Hot deploy" does not work (Lifray/Jboss)

Regular Member Beiträge: 157 Beitrittsdatum: 23.11.09 Neueste Beiträge
Hi
I use Liferay 6.05 with Jboss 5.1.We develop our porlet using plugin sdk.

If I do a "hot deploy" of a modified portlet war, I get lots of ClassNotFound and NoClassDefFound, I always have to restart server.

Does this work for anybody? What do I miss, that this does not work for me?

Thank you
Hubert
Nicholas Tenczar, geändert vor 13 Jahren.

RE: "Hot deploy" does not work (Lifray/Jboss)

Junior Member Beiträge: 53 Beitrittsdatum: 15.07.10 Neueste Beiträge
It is hard to say what could be going wrong. You haven't given a lot of information on your problem. I can see this being caused by a number of issues.

1. If you include portal-impl.jar in your portlet. Most classes in portal-impl.jar are defined as singletons so you shouldn't be creating new instances of them anyway. Removing portal-impl.jar could solve this issue.

2. You may be duplicating classes on the classpath. For instance if you include the same jar in the global lib directory and in your plugins WEB-INF/lib then you might see errors like that.

Again these are merely guesses. I'm rather surprised that restarting the server fixes these issues. If you can provide more specific details about your plugin then I might be able to provide more help.
Hubert Felber, geändert vor 13 Jahren.

RE: "Hot deploy" does not work (Lifray/Jboss)

Regular Member Beiträge: 157 Beitrittsdatum: 23.11.09 Neueste Beiträge
Nicholas,

After hot deploy the first error I get is:

14:15:07,242 ERROR [jsp] org.apache.commons.logging.LogConfigurationException: User-specified log class 'org.apache.commons.logging.impl.Log4JLogger' cannot be found or is not useable.

I don't include portal-impl.jar neither have I duplicates in classpath.
I am not surprised that restarting the server fixes the issue, because I don't add any jars, just recompile the portlet with plugin SDK and hot deploy it. I suspect an issue with the classloader, but have no further idea.
Nicholas Tenczar, geändert vor 13 Jahren.

RE: "Hot deploy" does not work (Lifray/Jboss)

Junior Member Beiträge: 53 Beitrittsdatum: 15.07.10 Neueste Beiträge
I'm not familiar with JBoss, but I experienced a similar issue when Tomcat would lock certain jars because it forcibly removed some threads that were identified as causing memories leaks. Check your logs for classes/threads that are being forcibly removed, those jars may be being locked, and won't be available when you go to hot deploy the portlet.
thumbnail
Olaf Kock, geändert vor 13 Jahren.

RE: "Hot deploy" does not work (Liferay/Jboss)

Liferay Legend Beiträge: 6403 Beitrittsdatum: 23.09.08 Neueste Beiträge
You can't just dump the plugins SDK output WAR files to an appserver, unless you build them with "ant direct-deploy". They need to get through Liferay's deploy process. This is what happens when you drop them into the "deploy" folder of the tomcat bundle.

This process will inject some declarations to web.xml as well as some dependencies (the missing dependencies are probably what causes your ClassNotFoundExceptions).

I'm not familiar with JBoss and if something similar to the tomcat-bundle-hotdeploy is available there, but if you just deploy to JBoss, you should build your plugins with "direct-deploy". This includes the Liferay deployment process and necessary injections.
Hubert Felber, geändert vor 13 Jahren.

RE: "Hot deploy" does not work (Liferay/Jboss)

Regular Member Beiträge: 157 Beitrittsdatum: 23.11.09 Neueste Beiträge
Olaf
I did not directly dump to appserver, I always dropped the war in liferay deploy directory where it was regularly deployed by liferay. This never works.

I tried the "ant direct-deploy" and could not notice any difference in build process between "deploy" and "direct-deploy". The war is identical. As far as I know, "direct-deploy" can only be used for the EXT plugin, where it is mandantory.

When executing "ant -v -d direct-deploy" I notice the message:
"Property "app.server.tomcat.lib.global.dir" has not been set" but I am building for Jboss.
It seams that the wrong parameter is passed to the build procces.

[java] '-Ddeployer.app.server.type=jboss'
....
[java] '-Ddeployer.file.pattern=MyPortlet-portlet-*.war'
[java] '-Ddeployer.tomcat.lib.dir=${app.server.tomcat.lib.global.dir}'

Seams that the build process for "direct-deploy" was only testet with tomcat?
Using "ant deploy" I produce a MyPortlet-portlet-6.0.5.1.war", which I deploy to the deploy Dir. After deployment I have MyPortlet-portlet.war without version numer in the app servers deploy Dir.

Using "ant direct-deploy" I expect a MyPortlet-portlet.war with all set (web.xml, dependent jars, etc) that I can directly copy to the app servers deploy Dir.

But the "ant direct-deploy" process does not produce a war which meets these requirements.



btw
I use Liferay 6.05 / JBoss 5.1
Christoph Habenschuss, geändert vor 12 Jahren.

RE: "Hot deploy" does not work (Lifray/Jboss)

New Member Beiträge: 5 Beitrittsdatum: 12.10.11 Neueste Beiträge
Hi all!

We encountered the same problem and I posted some details and a solution here: http://www.liferay.com/community/forums/-/message_boards/message/6999111

Regards, Christoph