After running Liferay/Tomcat combination through Eclipse, why does publishing fail and my portlet unregister every time I save?
I successfully set up a Tomcat server that runs Liferay through Eclipse. I'm working on a very simple portlet to learn more about the Liferay portal framework. Every time I make a modification to ANY file in my portlet and save, Eclipse attempts to republish or redeploy to the Tomcat server. Even on the most trivial change (changing one line a CSS file), an error occurs. The popup reads:
An internal error occurred during: "Publishing to Liferay v6.0 Server (Tomcat 6) at localhost...". org.eclipse.jst.server.tomcat.core.internal.ITomcatVersionHandler.prepareForServingDirectly(Lorg/eclipse/core/runtime/IPath;Lorg/eclipse/jst/server/tomcat/core/internal/TomcatServer;)Lorg/eclipse/core/runtime/IStatus
Also, the Eclipse console reads:
Apr 5, 2011 11:11:21 PM org.apache.catalina.loader.WebappClassLoader modified SEVERE: Resource '/W开发者_运维问答EB-INF/lib/commons-logging.jar' is missing Apr 5, 2011 11:11:21 PM org.apache.catalina.core.StandardContext reload INFO: Reloading this Context has started 23:11:21,080 INFO [ExtHotDeployListener:205] Extension environment for customer-portal-liferay-portlet will not be undeployed 23:11:21,081 INFO [PortletHotDeployListener:404] Unregistering portlets for customer-portal-liferay-portlet 23:11:21,082 INFO [PortletHotDeployListener:435] 1 portlet for customer-portal-liferay-portlet was unregistered
I think that the console error is a result of the previous error - I tried dropping in commons-logging.jar into /WEB-INF/lib/ and it just gets erased after the first error occurs.
One thing to note: after this error occurs, I can run "ant deploy" on my portlet and it deploys successfully. It's only during a save that it crashes.
I am using Ant for deploying . There are 2 ways of deploying :
- Drag the project build.xml into the view
- or Choose the build file from "Add Buildfiles" icon .
Now double click the ant file in the ant view to deploy it . Just double clicking runs the default ant target hence create the war file .
This is my best guess: In the Eclipse server view, have a look for the server that you have declared. At the beginning of that line on the far left side there is an arrow that you can click to open the server and see the projects that are deployed on this server. If any projects are listed here, Eclipse will rebuild and deploy it when anything changes. Personally I don'y like this, so select and delete the deployed projects so that they are no longer auto-deployed by Eclipse. The other way is to change the server so that it doesn't autodeploy, but I never use that feature anyway.
I'm not sure why autodeploying causes issues for you, it should be OK (although I have seen occasional problems when Liferay tries to read a WAR file while it is still being written) but I wouldn't worry if ant deploy
works without any problems.
The error you are seeing is because the Liferay IDE eclipse plugins had a version (1.2.2) which was incompatible with the recent version of Ecipse Helios SR2. Another version was release (1.2.3) of Liferay IDE eclipse plugins and it fixed the problem. So the solution should be to just update from the stable update-site URL to get the latest version. That will fix up the error and deployment should happen normally.
精彩评论