Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » Java Development Tools (JDT) » Tomcat in Eclipse is suddenly failing to find Spring ApplicationListener class
Tomcat in Eclipse is suddenly failing to find Spring ApplicationListener class [message #1742936] Thu, 08 September 2016 16:26 Go to next message
David M. Karr is currently offline David M. KarrFriend
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 Go to previous messageGo to next message
David M. Karr is currently offline David M. KarrFriend
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.
Re: Tomcat in Eclipse is suddenly failing to find Spring ApplicationListener class [message #1742944 is a reply to message #1742940] Thu, 08 September 2016 17:41 Go to previous message
David M. Karr is currently offline David M. KarrFriend
Messages: 813
Registered: July 2009
Senior Member
Sigh. WTF. I just tried creating a new server, including a new "Server runtime environment", just in case, added the project to the server, then copied the server config files that I need to the new server definition and set one required property for my app in the new Tomcat run configuration and starting the server. It worked.

Anyone have any ideas of what might have really gone wrong here?
Previous Topic:Problem running java application on Ubuntu
Next Topic:How get actual dimensions of e component with miglayout
Goto Forum:
  


Current Time: Sun Oct 13 16:11:41 GMT 2024

Powered by FUDForum. Page generated in 0.04212 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top