Foros de discusión

ext-plugin, initial deployment problem

Warren McCann, modificado hace 12 años.

ext-plugin, initial deployment problem

Junior Member Mensajes: 36 Fecha de incorporación: 19/11/10 Mensajes recientes
Hi All:

I have to unfortunately resort to posting. I'm using Liferay 6.0.6 with Tomcat 6018.

I'm starting my production deployment and I'm working with a straight from Liferay 6.0.6 WAR from scratch. The first thing I obviously wanted to do was deploy my required ext plugin before progressing forward. Please bear in mind that this has been successfully deployed and redeployed in a development and test environment for months.

Production is a remote server (as are the others), so I do not have the luxury of utilizing ANT at the moment. I've built the ext plugin on my local machine and bundled as a WAR. I had to modify the "ProtectedServletRequest.java" class and this is included in the ext-service. This is all by memory as I no longer have access to my work computer (on my drive home I figured the best thing to do was post).

I started up Tomcat and and deployed the ext WAR. I received the std out message of "general ext pluging has been successfully deployed, please restart" as I typically have seen. I restarted the server, saw the ext plugin become loaded again and then I deployed a Hook that relies on that code change. I hit the server to execute the code that was just deployed and the server is not recognizing the changes in the ProtectedServletRequest class.

I double checked all the deployed artifacts and inspected lib/ext/ext-geneneral-service.jar to ensure the class was there and I also confirmed the source within the webapps/general-ext/src folder (please bear in mind the ext webapp folder may not be right, memory isn't working)

So, I removed all of the ext-plugin artifacts from the server (lib/ext, web-inf/ext-general.xml, web-inf/lib/ext-*.jar, hook web app, ext web app) as they apply to the ext plugin and re-tried the same deployment process. I additionally removed all of the files within tomcat-home/work and tomcat-home/temp, with no luck.

I then proceeded to try to directly copy all of the files to the server (with a proper server state) and I still did not have any luck. I'm at a loss.

Page 55 within the developers guide, first paragraph for deploying an ext states "..makes changes to the web application itself". Does anyone know what other changes are made?

First thing Monday morning I'm going to redeploy the basic web application and try again, however, I'd like to understand how the basic install got "corrupted" or "changed" so that I cannot deploy the ext-plugin properly. The answer of "redeploy the entire application" doesn't necessarily sit well with me or within the administration steps for the Liferay instance.

Sorry for the length. Thanks in advance ..
-Warren
thumbnail
David H Nebinger, modificado hace 12 años.

RE: ext-plugin, initial deployment problem

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
When the ext plugin is deployed, LR will copy files in the ext into the ROOT webapp. For files that replace an existing LR file, the existing file is renamed (for restoration when the ext plugin is removed), and the new file copied in. Jars and other files in the WEB-INF directory are also copied to ROOT/WEB-INF, but in these cases sometimes they end up overwriting existing files.

I would suggest a couple of things. If you need the ext plugin and also the hook, I'd move the hook code into the ext plugin, as there's no real advantage to keeping them separate.

Also try doing your ext plugin deployment locally, mirroring what you were doing in production. You can test out the actual deployment and determine if there was actually a deployment issue.

Finally, when ext undeployments go wrong, they can leave artifacts around that you may or may not be aware of. If at all possible, I'd suggest starting the prod environment over from a clean slate. It may be a pain, but I think it would save you some headaches later on...
Warren McCann, modificado hace 12 años.

RE: ext-plugin, initial deployment problem

Junior Member Mensajes: 36 Fecha de incorporación: 19/11/10 Mensajes recientes
Thanks for the response Dave.

So I undeployed everything and started from scratch. I also deleted the temp/* and work/* files.

Unfortunately, I hit the same results. The class loader was not picking up my ext-general-service.jar class override the to "ProtectedServletRequest". The appropriate jar was in tomcat-home/lib/ext.

So, given my frustration, I shut the server down grabbed the portal-service.jar and expanded it in a temp directory. I replaced the portal-services.jar's "ProtectedServletRequest.class" with my ext "ProtectedServletRequest.class". I jar'd the portal-service.jar back up with my change, copied it over the original and started the server back up.

It's working, yay! But, I don't like it.

Anyone have any suggestions on how to troubleshoot why the classloader won't recognize my ext-service changes? I have not had ANY troubles with this until now. Figures it's for production.

Please keep in mind that we have been deploying and redeploying on our development and test servers without any issue for about 5 months now...

Thanks,
Warren
thumbnail
David H Nebinger, modificado hace 12 años.

RE: ext-plugin, initial deployment problem

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
In a bundle-based Liferay, portal-service.jar is actually a shared jar rather than in WEB-INF/lib. You mentioned that you had deployed the Liferay WAR directly, so I'm guessing you did not deploy a bundle in production?

Which app server are you using in production?
Warren McCann, modificado hace 12 años.

RE: ext-plugin, initial deployment problem

Junior Member Mensajes: 36 Fecha de incorporación: 19/11/10 Mensajes recientes
We're using Tomcat 6. We didn't use the bundled version and are using the basic WAR: liferay-portal-6.0.6-20110225.war. The dependent global JAR are located within "tomcat-home/lib/ext".

Correct, on the shared jar. I have no issues with the EXT jars located in webapps/ROOT/WEB-INF/classes. This is specifically about the global class loader for the portal-service.jar and the EXT jar that overrides a class within the portal-service.jar.

I apologize for not making this clearer..
thumbnail
Mathieu Hicauber, modificado hace 11 años.

RE: ext-plugin, initial deployment problem

Junior Member Mensajes: 79 Fecha de incorporación: 22/12/10 Mensajes recientes
Hi,

Did you ever find a solution about that ?

Same issue here : trying to override a class located in the service jar, OK on local and some integration server, but fails on production server...

Thank you,

Mathieu.
thumbnail
Ankur Srivastava, modificado hace 9 años.

RE: ext-plugin, initial deployment problem

Junior Member Mensajes: 58 Fecha de incorporación: 9/11/08 Mensajes recientes
We are also facing similar problem. The changes work on local, on which I am using Tomcat, but don't reflect on an environment which is using WebSphere.

Any suggestions ?
thumbnail
Ankur Srivastava, modificado hace 9 años.

RE: ext-plugin, initial deployment problem

Junior Member Mensajes: 58 Fecha de incorporación: 9/11/08 Mensajes recientes
Ankur Srivastava:
We are also facing similar problem. The changes work on local, on which I am using Tomcat, but don't reflect on an environment which is using WebSphere.

Any suggestions ?


Just to answer my question, it was a classloading problem on WebSphere. Got fixed by renaming the modified files.