Tomcat in Eclipse is suddenly failing to find Spring ApplicationListener class [message #1742936] |
Thu, 08 September 2016 16:26 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
Just yesterday I was having no problems running my WAR in Tomcat (TomEE 7.0.1) in Eclipse Neon. I haven't made any real changes to this application in a while, but now when Tomcat starts up, it's failing to find the Spring ApplicationListener class. I've examined the Maven-built WAR file, and the appropriate "spring-context" jar file is in WEB-INF/lib, just like always. I have no red marks or errors in Eclipse, except for the failure to start up Tomcat.
The most recent change I believe I made was changing the web.xml back to the 3.1 namespace and version. I had set it to 2.5 for a while to allow it to run in an instance of WebLogic that apparently didn't grok 3.1. I had been running it with 3.1 in Tomcat for quite a while, went to 2.5 for a while (which worked fine in Tomcat), and now I'm trying to go back to 3.1. Curiously, when I try to set the 2.5 version and namespace, I get an unhelpful error saying "Cannot change version of project facet Dynamic Web Module to 2.5", with no other information.
I'm not sure how to move forward here, or just to get back to where I was before, where everything was working fine.
|
|
|
Re: Tomcat in Eclipse is suddenly failing to find Spring ApplicationListener class [message #1742940 is a reply to message #1742936] |
Thu, 08 September 2016 17:01 |
David M. Karr Messages: 813 Registered: July 2009 |
Senior Member |
|
|
I determined a little more information.
I checked the Run Configuration, and I noticed the "wtp.deploy" property pointing to ".plugins\org.eclipse.wst.server.core\tmp0\wtpwebapps" in my workspace. I checked the subfolder of that for my project. I first noticed that the last modtime of the directory is from 3 days ago, and the WEB-INF/lib directory had very few jars in it, and it didn't have the "spring-context" jar.
I also noticed that when I view the server in the "Servers" tab, it shows the deployed WAR, but it also has an arrow showing other contents, and in that it shows two of many jars that the WAR is using, being "log4j-web" and "spring-web". Those two jars are seen in that "wtpwebapps" directory that I mentioned earlier, along with a couple of other jars.
I've also tried right-clicking on the app in the "Servers" tab and remove the project, and then readding it. No change.
I now just tried removing the project again from the server entry, then exiting Eclipse, and manually removing that subdir from the "wtpwebapps" directory mentioned above, and then restarting Eclipse, and then readding the project to the server. I note again that in the "Add and Remove" dialog, when I see the project in the left column, it shows subcontents again, and it shows those two jars I mentioned earlier. I finished readding the project and restarting the server, but there's still no change.
I then inspected the contents of that "wtpwebapps" directory, and it doesn't even include the old copy of the war. It's as if the Tomcat instance isn't using that folder.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04212 seconds