Eclipse WST: Webapp sometimes not deployed on Tomcat
I am using Eclipse WTP to develop my spring app and deploy it on a tomcat server.
Usually my web app is deployed on tomcat and everything works fine, but sometimes, I could say randomly, my web app is just not deployed and tomcat starts without any modules:
17.03.2011 14:04:31 org.apache.catalina.core.AprLifecycleListener init
INFO: The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path: [CUT BY ME]
17.03.2011 14:04:31 org.apache.tomcat.util.digester.SetPropertiesRule begin
WARNUNG: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:mywebapp' did not find a开发者_开发百科 matching property.
17.03.2011 14:04:31 org.apache.coyote.http11.Http11Protocol init
INFO: Initializing Coyote HTTP/1.1 on http-8080
17.03.2011 14:04:31 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 573 ms
17.03.2011 14:04:31 org.apache.catalina.core.StandardService start
INFO: Starting service Catalina
17.03.2011 14:04:31 org.apache.catalina.core.StandardEngine start
INFO: Starting Servlet Engine: Apache Tomcat/6.0.26
17.03.2011 14:04:31 org.apache.coyote.http11.Http11Protocol start
INFO: Starting Coyote HTTP/1.1 on http-8080
17.03.2011 14:04:31 org.apache.jk.common.ChannelSocket init
INFO: JK: ajp13 listening on /0.0.0.0:8009
17.03.2011 14:04:31 org.apache.jk.server.JkMain start
INFO: Jk running ID=0 time=0/34 config=null
17.03.2011 14:04:31 org.apache.catalina.startup.Catalina start
INFO: Server startup in 438 ms
If the app is deployed I see a much longer log and the server needs a much longer time to start, so I can definately be sure that no app is deployed.
To get rid of this problem I am currently randomly removing and adding my app again and restarting eclipse until it finally works. This is, of course, not a solution, so maybe someone has an idea why things go wrong.
Thanks!
EDIT: Now I found out that the problem occurs sometimes under these circumstances: I change something in a resource file (JS/HTML), the file is repusblished, but not only this file but also some class files are republished. Suddenly after this happens, not all class files are present any more and the server is missing some classes.
Only stoppping the server, removing the app and closing eclipse works here.
EDIT 2: I could now further go into the problem. It seems that the eclipse auto publish functionality has some problems. If I totally switch off automatic republishing and republish manually, everything works out well.
I found a possible answer: One solution is to use the clean function for the webserver.
Right-click on the server to open the context menu and click clean. That worked so far under all circumstances for me ...
Today, as I run my webapp on tomcat via eclipse I get the problem you notified. I inspect the problem and I find that the webapp isn't loaded even if manually deployed on the file system tomcat installation. I check the .war file and that WebContent folder isn't included in the package. So the problem is about the packaging operation: I solved it as follows: R-click on the project ---> properties ----> Deploy Assemply. Check the parameters, are they ok? I missed the WebContent folder! So I added it (mapping to "/" deploy path) and the problem is fixed.
Hope it helps.
I have the same problem, and it seems to be important to clear the server after the app is removed (before redeploying it).
精彩评论