Combination View Flat View Tree View
Threads [ Previous | Next ]
toggle
Warren McCann
ext-plugin, initial deployment problem
July 29, 2011 3:14 PM
Answer

Warren McCann

Rank: Junior Member

Posts: 36

Join Date: November 19, 2010

Recent Posts

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
David H Nebinger
RE: ext-plugin, initial deployment problem
July 30, 2011 7:35 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7157

Join Date: September 1, 2006

Recent Posts

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
RE: ext-plugin, initial deployment problem
August 1, 2011 6:51 AM
Answer

Warren McCann

Rank: Junior Member

Posts: 36

Join Date: November 19, 2010

Recent Posts

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
David H Nebinger
RE: ext-plugin, initial deployment problem
August 1, 2011 8:13 AM
Answer

David H Nebinger

Rank: Liferay Legend

Posts: 7157

Join Date: September 1, 2006

Recent Posts

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
RE: ext-plugin, initial deployment problem
August 1, 2011 8:27 AM
Answer

Warren McCann

Rank: Junior Member

Posts: 36

Join Date: November 19, 2010

Recent Posts

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..
Mathieu Hicauber
RE: ext-plugin, initial deployment problem
November 19, 2012 7:52 AM
Answer

Mathieu Hicauber

Rank: Junior Member

Posts: 79

Join Date: December 22, 2010

Recent Posts

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.
Ankur Srivastava
RE: ext-plugin, initial deployment problem
July 7, 2014 12:36 PM
Answer

Ankur Srivastava

Rank: Junior Member

Posts: 53

Join Date: November 8, 2008

Recent Posts

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 ?
Ankur Srivastava
RE: ext-plugin, initial deployment problem
July 14, 2014 12:58 PM
Answer

Ankur Srivastava

Rank: Junior Member

Posts: 53

Join Date: November 8, 2008

Recent Posts

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.