unable to deploy struts2 war on tomcat7 - deployment

I feel really stupid right now but I've been struggling all day long and I don't have a clue, some help would be kindly appreciated :)
I've developped a struts2 webapp which works fine when I run it through eclipse (indigo sr2) related to my servelt server apache tomcat 7.0.27 installed on my own computer. All I do is : right click on the folder of my webapp --> run as --> run on server. Then it runs nicely either in eclipse browser, or in other browser (chrome, firefox) when I copy and path the url adress of my servlets.
Now all I'd like to do is make it run without eclipse. So I exported my webapp in a .war file (right click on the webapp folder --> export --> War file), and tried to deploy it using the app manager tomcat web interface : all it asked me to do was to browse for the war file through my computer and to click on the deploy button. Easy going so far !
Then my webapp appears in the applications tab of the app manager interface, but when I click on the "run" button, all I get is this message :
Failure : application for the context path /MMSProject could not start
(the original message is in French, I did not find how to change tomcat7 language, so this might not be the exact message you'd have in english, I hope this translation is close enough. MMSProject is the name of my webapp).
Therefore, I downloaded some struts2 webapp examples on the struts2 website and tried to deploy struts2-blank on tomcat7 using the same process. This one works perfectly fine : I can run it from tomcat app manager. So I guess my problem comes from my own war file and not from tomcat itself, but since it's generated by eclipse it seems weird to me that this part of the process could go wrong.
And so I'm stuck with that. Would you guys know :
How can I get more information about what's going wrong (I looked in tomcat logs but did not find any error message). This could help me a lot to solve the problem !
Any reason for what my webapp would run from eclipse but not directly from tomcat ?
How can I make it run from tomcat ? :)
Thank you very much in advance for any help ! I'm kind of desperate right now, did not think deployment would be such a pain !
EDIT :
I've double checked tomcat's log and actually found this in catalina.[date].log:
Grave: Error filterStart
juin 21, 2012 1:48:42 PM org.apache.catalina.core.StandardContext startInternal
Severe: Context [/MMSproject] startup failed due to previous errors
juin 21, 2012 1:48:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Grave: The web application [/MMSproject] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#2de3bcb5]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#427a269c]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
juin 21, 2012 1:48:42 PM org.apache.catalina.loader.WebappClassLoader checkThreadLocalMapForLeaks
Grave: The web application [/MMSproject] created a ThreadLocal with key of type [com.opensymphony.xwork2.inject.ContainerImpl$10] (value [com.opensymphony.xwork2.inject.ContainerImpl$10#617ceddc]) and a value of type [java.lang.Object[]] (value [[Ljava.lang.Object;#50e43884]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.
and this in localhost.[date].localhost :
juin 21, 2012 1:48:42 PM org.apache.catalina.core.StandardContext filterStart
SEVERE: Exception starting filter struts2
java.lang.NullPointerException
at com.opensymphony.xwork2.util.FileManager$FileRevision.needsReloading(FileManager.java:209)
at com.opensymphony.xwork2.util.FileManager.fileNeedsReloading(FileManager.java:60)
at com.opensymphony.xwork2.config.providers.XmlConfigurationProvider.needsReload(XmlConfigurationProvider.java:325)
at org.apache.struts2.config.StrutsXmlConfigurationProvider.needsReload(StrutsXmlConfigurationProvider.java:168)
at com.opensymphony.xwork2.config.ConfigurationManager.conditionalReload(ConfigurationManager.java:220)
at com.opensymphony.xwork2.config.ConfigurationManager.getConfiguration(ConfigurationManager.java:61)
at org.apache.struts2.dispatcher.Dispatcher.getContainer(Dispatcher.java:774)
at org.apache.struts2.dispatcher.FilterDispatcher.init(FilterDispatcher.java:191)
at org.apache.catalina.core.ApplicationFilterConfig.initFilter(ApplicationFilterConfig.java:277)
at org.apache.catalina.core.ApplicationFilterConfig.getFilter(ApplicationFilterConfig.java:258)
at org.apache.catalina.core.ApplicationFilterConfig.setFilterDef(ApplicationFilterConfig.java:382)
at org.apache.catalina.core.ApplicationFilterConfig.(ApplicationFilterConfig.java:103)
at org.apache.catalina.core.StandardContext.filterStart(StandardContext.java:4638)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5294)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.manager.ManagerServlet.start(ManagerServlet.java:1247)
at org.apache.catalina.manager.HTMLManagerServlet.start(HTMLManagerServlet.java:747)
at org.apache.catalina.manager.HTMLManagerServlet.doPost(HTMLManagerServlet.java:222)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:641)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:722)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.CsrfPreventionFilter.doFilter(CsrfPreventionFilter.java:186)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.filters.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:108)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:225)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:581)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:927)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:999)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:565)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:307)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)

Ok, so I found the anwser and wanted to post it in order to help someone who would have te same issue !
It's a tiny detail but it may save you a lot of struggling and praying time once you know it: before deploying don't forget to switch the struts devMode to false (in struts.xml file) if you had decided to use it at the begining of you development (ie : maybe some few hard coding weeks ago !).
So basically this is what you wanna have in struts.xml :
<constant name="struts.devMode" value="false" />
instead of :
<constant name="struts.devMode" value="true" />
Good luck everybody !

Related

gwt server not found after deployment

I've a strange problem. I created the plain vanilla Greetings example with the webAppCreator of gwt. That means I created a project called Test and after that I did not modify it in any way. Then I created a war file with "ant war" and deployed this on my local tomcat 7. The server starts fine and the Grettings page is loaded properly. But, when clicking on the Send button I get the following error:
There a no error messages in the tomcat logs. However in the development mode the stuff works fine. I'm using gwt 2.5. Any idea what could cause this problem?
Edit: Maybee this gives some further insights:
I found a stack trace:
java.lang.UnsupportedClassVersionError: com/server/GreetingServiceImpl : Unsupported major.minor version 51.0 (unable to load class com.server.GreetingServiceImpl)
org.apache.catalina.loader.WebappClassLoader.findClassInternal(WebappClassLoader.java:2908)
org.apache.catalina.loader.WebappClassLoader.findClass(WebappClassLoader.java:1173)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1681)
org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1559)
org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:461)
org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929)
org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1002)
org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:585)
org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:895)
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:918)
java.lang.Thread.run(Thread.java:680)
But what does it mean?
Okay, I found the problem.
The error UnsupportedClassVersionError means that I tried to run a compiled java file with an older runtime, i.e. I compiled the servlets with java 7 and tried to run them with java 6.
I repaired this by setting the correct JAVA_HOME path to my .bash_profiles file like this
export JAVA_HOME=/path/to/java_7/Home
That was it, now everything runs fine. Thanks for reading anyway.

Exception java.lang.NoClassDefFoundError in Dynamic Web Application, Eclipse, JSF [duplicate]

This question already has answers here:
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
(2 answers)
Closed 7 years ago.
when I'm running my appication everything is ok to moment when I press the button and I'm redirecting to another xhtml page. Then eclipse console until I stop server display:
SEVERE: Servlet.service() for servlet [Faces Servlet] in context with path [/ChatAzure] threw exception [javax/servlet/jsp/jstl/core/Config] with root cause
java.lang.NoClassDefFoundError: javax/servlet/jsp/jstl/core/Config
at com.sun.faces.application.view.JspViewHandlingStrategy.executePageToBuildView(JspViewHandlingStrategy.java:345)
at com.sun.faces.application.view.JspViewHandlingStrategy.buildView(JspViewHandlingStrategy.java:154)
at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:100)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:101)
at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:139)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:594)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:169)
at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:168)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:98)
at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:928)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:407)
at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:987)
at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:539)
at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:298)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:662)
I use:
eclipse, jsf2-1-7, jstl-1.2.jar, Tomcat v0.7.
I don't know what's wrong, I need help.
The mentioned class is part of JSTL. This is normally already provided by a full fledged Java EE container, but not in Tomcat as being a barebones JSP/Servlet container. You'd need to supply JSTL yourself along with the web application. It has ultimately to be placed in the webapp's runtime classpath.
You correctly mentioned jstl-1.2.jar (I assume that it's exactly the one as you could find in our JSTL wiki page), but this problem indicates that it has apparently not been placed at the right place. You need to place it in /WEB-INF/lib folder of the web project. This folder is covered by webapp's default runtime classpath. Nothing more needs to be done. If you have ever fiddled in the project's Build Path properties in an attempt to solve it, you should undo all those attempts.
Unrelated to the concrete problem: why are you still using legacy JSP? It has been deprecated and succeeded by Facelets (XHTML) since JSF 2.0. Make sure that you're reading up to date JSF 2.x resources and not JSF 1.x ones while learning JSF.

Tomcat 7 in Eclipse Indigo: javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found

I am trying to configure Tomcat 7 in Eclipse Indigo, i added the Tomcat plugin from http://www.eclipsetotale.com/tomcatPlugin.html#A3 into eclipse\plugins folder.
Now when i start tomcat i am getting the below error:
Feb 13, 2012 4:23:35 PM org.apache.catalina.startup.ContextConfig webConfig
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
at org.apache.naming.resources.BaseDirContext.listBindings(BaseDirContext.java:733)
at org.apache.naming.resources.ProxyDirContext.listBindings(ProxyDirContext.java:546)
at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1197)
at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:825)
at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:300)
at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:897)
at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:873)
at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1095)
at org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.java:1617)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Feb 13, 2012 4:23:35 PM org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
SEVERE: Unable to determine URL for WEB-INF/classes
javax.naming.NameNotFoundException: Resource /WEB-INF/classes not found
This is actually a bug in Tomcat 7.0.25 and fixed in Tomcat 7.0.26. See also issue 52511. Please note that you can just continue using your web application! This log is purely informal and does not block Tomcat from starting and functioning. It's caused by a change in the way how Tomcat scans annotated classes. This stacktrace will be printed when you don't have any classes in your Eclipse project and hence the /WEB-INF/classes remains empty.
Upgrading to Tomcat 7.0.26 will hide this log. You can also just ignore it altogether and continue using Tomcat as usual.
As per the comments,
i Installed Eclipse for Java EE, in that in the server tab i added the server , when i run the server and try to open the localhost:8080 in the browser, it did not give me the welcome page, therefore i added the plugin in the eclipse plugins, now it gives me the welcome page in browser but adding to that it gives above error in console.
What did it give instead? A server-specific 404 error page or a browser specific "Connection timeout" page? If 404, then the server runs perfectly fine, it's just the URL which did not point anything. Note that Eclipse does by default not deploy Tomcat's own homepage, simply because that's not useful at all while developing. It will only deploy Tomcat's own homepage when you configure Eclipse to take over Tomcat installation instead of using its engine:
You need to let the URL point to the real URL of the deployed web project. It defaults to the project name which is configureable in project's properties. If the project name is for example "Playground", then you need to open http://localhost:8080/Playground instead. If you want to have it on domain root, then you need to change the Context root in Web Project Settings to /:
Last but not least, I recommend to remove that Sysdeo plugin which you installed without any necessary reason. It is not in any way better than the Eclipse-builtin plugin.
See also:
Tomcat started in Eclipse but unable to connect to http://localhost:8085/

Eclipse tomcat error: Document base does not exist or is not a readable directory

13-dic-2011 17.00.36 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: /usr/lib/jvm/java-6-openjdk/jre/lib/amd64/server:/usr/lib/jvm/java-6-openjdk/jre/lib/amd64:/usr/lib/jvm/java-6-openjdk/jre/../lib/amd64:/usr/java/packages/lib/amd64:/usr/lib/jni:/lib:/usr/lib
13-dic-2011 17.00.36 org.apache.tomcat.util.digester.SetPropertiesRule begin
AVVERTENZA: [SetPropertiesRule]{Server/Service/Engine/Host/Context} Setting property 'source' to 'org.eclipse.jst.jee.server:Preventivi' did not find a matching property.
13-dic-2011 17.00.36 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8080"]
13-dic-2011 17.00.36 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["http-bio-8443"]
13-dic-2011 17.00.37 org.apache.coyote.AbstractProtocol init
INFO: Initializing ProtocolHandler ["ajp-bio-8009"]
13-dic-2011 17.00.37 org.apache.catalina.startup.Catalina load
INFO: Initialization processed in 983 ms
13-dic-2011 17.00.37 org.apache.catalina.core.StandardService startInternal
INFO: Starting service Catalina
13-dic-2011 17.00.37 org.apache.catalina.core.StandardEngine startInternal
INFO: Starting Servlet Engine: Apache Tomcat/7.0.23
13-dic-2011 17.00.37 org.apache.catalina.core.StandardContext resourcesStart
GRAVE: Error starting static Resources
java.lang.IllegalArgumentException: Document base /home/claudio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/Preventivi does not exist or is not a readable directory
at org.apache.naming.resources.FileDirContext.setDocBase(FileDirContext.java:140)
at org.apache.catalina.core.StandardContext.resourcesStart(StandardContext.java:4880)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5060)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1525)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1515)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
at java.util.concurrent.FutureTask.run(FutureTask.java:166)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
at java.lang.Thread.run(Thread.java:636)
13-dic-2011 17.00.37 org.apache.catalina.core.StandardContext startInternal
GRAVE: Error in resourceStart()
13-dic-2011 17.00.37 org.apache.catalina.core.StandardContext startInternal
GRAVE: Error getConfigured
13-dic-2011 17.00.37 org.apache.catalina.core.StandardContext startInternal
GRAVE: Context [/Preventivi] startup failed due to previous errors
13-dic-2011 17.00.37 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8080"]
13-dic-2011 17.00.37 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["http-bio-8443"]
13-dic-2011 17.00.37 org.apache.coyote.AbstractProtocol start
INFO: Starting ProtocolHandler ["ajp-bio-8009"]
13-dic-2011 17.00.37 org.apache.catalina.startup.Catalina start
INFO: Server startup in 319 ms
I've run my webapp project in Eclipse, but today I received the message in console.
Tomcat return me a 404 page error. Maybe the problem is that the folder where I would write doesn't exist. Where is the trick?
The easiest solution (and what worked for me) was to delete my tomcat server from the "Servers" view in Eclipse, then create a new server and add all the appropriate modules to it.
Sometimes tomcat gets confused and the easiest/least time consuming way to resolve things is to start over.
i have the same error, just run this maven command repeatedly and solve the problem.
mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0
eclipse was not recognizing that this was a web project, so never deploy the application.
I had the same problem using Tomcat 7 & Eclipse Mars.
I solved it as follows:
stop Tomcat
open server.xml
Ctrl + Shift + R > type "server.xml" > Open
search for "<Context docBase"
Ctrl + F > type "<Context" > Find
remove all <Context .../> tags from here:
<?xml version="1.0" encoding="UTF-8"?>
...
<Server port="8005" shutdown="SHUTDOWN">
...
<Service name="Catalina">
...
<Engine defaultHost="localhost" name="Catalina">
...
<Host appBase="webapps" autoDeploy="true" name="localhost" unpackWARs="true">
...
<!-- Remove the following lines! -->
<Context docBase="App1" path="/App1" reloadable="true" source="org.eclipse.jst.j2ee.server:App1" />
<Context docBase="App2" path="/App2" reloadable="true" source="org.eclipse.jst.j2ee.server:App2" />
</Host>
</Engine>
</Service>
</Server>
probably at the end of the last line that has to be removed is </Host> (don't remove </Host>!)
Go to Servers tab > right click on the project(s) > Remove > OK
Right click on the project > Run As > Run on Server > Finish
Now it should work!
If you check the server.xml file, you'll see that a new correct "<Context ... />" line was generated.
This might be late but for the benefit of the those who might encounter the same problem in the future, I'll share what I experienced.
I got this problem after I deleted the WebContent folder of the Dynamic Web Project I just created in place of webapp folder which is the standard folder of my company. I found out that, in Project Properties > Deployment Assembly, WebContent folder is still used as the root of the web application (Deploy Path : "/"). Thus, Eclipse doesn't copy the project to .metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps because the root specified in Deployment Assembly does not exist anymore.
I fixed it by editing that entry then correcting it with the folder I am using in place of the default WebContent (the webapp folder)
If using Eclipse STS
open the server view
select the server that you're trying to publish to
right click -> clean
I had this problem come up a couple of times and this always seemed to fix it. I suppose the other solutions work too but they seem more complicated to me.
This could happen because "Tomcat\conf\Catalina" folder.
Please delete this folder.
Looking at the exception you get, this looks like a problem with publishing your WEB-App (eg. Eclipse WTP could mess something up). First things that come in my mind:
Check your Tomcat server settings: go to Servers - double click on your server. Get your 'Server Locations - Server Path' and check if it exists and check the user/group read/write permissions.
eg. ls -lh somepath/.medadata/.plugins/.org.eclipse.wst.server.core/tmp0
You must be owner or at least in same group for the folder.
Clean the eclipse workspace. (Project - clean all)
Clean/Republish your wep-app (right click on server, clean, publish).
Check if the application is published, there should be a folder named Preventini in /home/claudio/workspace/.metadata/.plugins/org.eclipse.wst.server.core/tmp0/wtpwebapps/
Also check the permissions here again (see above).
Happened to me a couple of times.
Windows > Show view > Servers>
A List of servers will be displayed at bottom
Right click on it and delete.
Now while running your project, Manually re select the server from list of existing servers and run.
I got this problem when I imported a project and run it with Tomcat. I fixed it when I opened .project file and added some code:
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
I had to remove an offending project/module from the tomcat config view, under the modules tab.
i have solved this error by adding removing and adding again the jar files from WebContent/WEB-INF/lib folder. and i did the same in properties of project ie(Right click on project->Build Path->configure build Path) by selecting Add External Jar option.
Go to Tomcat Manager
Select web app -> undeploy it
Today I was working with some other project and getting some errors in starting server (tomcat7), so first I cleaned the server and tried but no luck, then I deleted the server and made new one.
The project on which I was working was started working fine, but another project started giving me the same exception, I again deleted the server and tried but the same case, even I was unable to hit the tomcat landing page i.e. localhost:8888/. I really don't know how and why all that happened.
I tried several things like clean,add/remove then I started searching SO.
After some research I thought to give one more chance then I started server again this time both of my projects started working fine but still getting 404 on tomcat page
As a trivial problem, the project that you're trying to start can be closed (this could be missable, if you have many projects into the workspace!). Just do right click -> Open Project, in this case.
I came across this problem today, then solve it by editing the server.xml in directory of %tomcat_home%\conf, just as below:
<Context docBase="E:\apache-tomcat-7.0.52\webapps\ROOT" path="/ROOT" reloadable="true" source="org.eclipse.jst.j2ee.server:pc-ui"/>
I don't know whether it is MyEclipse that have genarated the "Context" element in element of "Host", but I change it according to the error info diaplayed in IDE console.
I got this error a few times. I got it because my project wasn't building correctly after running the "mvn eclipse:eclipse" line. Make sure your project is being built correctly, then add and remove the project from the server.
This could happen if you execute maven to build a java project
mvn eclipse:eclipse
Instead of executing maven to build a web java project as:
mvn eclipse eclipse -Dwtpversion=2.0
You can look into tomcat\conf\Catalina\localhost,if you can see the xml file which its name matches your error message.You can just delete the xml file and restart your tomcat.
Try , right click tomcat --> Add / Remove , then in opened window , remove All projects in Configured side..
Then restart tomcat .
Before adopting any other solution, make sure that the project is open.

Tomcat not starting

i always get the following error when trying to start Tomcat in eclipse (or also from the terminal with this specific war file)the build using ant is successful of course:
08.08.2011 08:21:02 org.apache.catalina.core.StandardContext loadOnStartup
SCHWERWIEGEND: Servlet threw load() exception
java.lang.ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1678)
at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1523)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:169)
at com.oroad.stxx.plugin.StxxPlugin.initRequestProcessorClass(StxxPlugin.java:153)
at com.oroad.stxx.plugin.StxxPlugin.init(StxxPlugin.java:102)
at org.apache.struts.action.ActionServlet.initModulePlugIns(ActionServlet.java:1158)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:473)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1216)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1135)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1031)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:4957)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5284)
at org.apache.catalina.core.StandardContext$3.call(StandardContext.java:5279)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
It runs perfectly on a pc using linux and eclipse galileo, but not on my mac using eclipse indigo. the libraries are all in place..does anyone have an idea what the problem might be?
Looks like I syncyronisation problem I often have.
Refresh the Workspace
Project Build (most time not needed) - But make sure that there are no build errors
Then run the two tasks from the Servers/(tomcat) Context menu
Clean...
Clean Tomcat Working Directory
If this all does not help, then Remove the application from the Server, clean the Server and Deploy the application again to the server.
The class StxxDelegatingRequestProcessor is missing in your classpath -> "ClassNotFoundException: dea.alo.aloWeb.spring.StxxDelegatingRequestProcessor"
I think you copied the struts conf from a site but not the class :)