3
votes

I deploy my Maven webapp using Spring MVC in Eclipse Tomcat. Everything works OK for quite a week. Suddenly, today I modify a properties file, rebuild and redeploy the webapp. There's a class not found error:

SEVERE: Error configuring application listener of class org.jasig.cas.client.session.SingleSignOutHttpSessionListener
java.lang.ClassNotFoundException: org.jasig.cas.client.session.SingleSignOutHttpSessionListener

Look at publish folder (tmp0) of Tomcat server plugin located in workspace folder, there are no jars in WEB-INF/lib any more. I don't know why? I have rebuilt/deployed it many times today, and have found no problem.

Could someone give an advice? Thanks very much.

EDIT:

I can't find a right solution for this problem, though I temporarily bypass it by removing the web app from Tomcat Server, do a clean up, then add it back again.

2
What are the changes you have made in properties file, can you show? - Riddhish.Chaudhari
I added an entry in classpath:application.properties. I argue that's not problem because before that I have had add another and no problem occurs. casClient.afterLogoutUrl=http%3A%2F%2Flocalhost%3A8084%2Fmyweb - bnguyen82
may be .class file broken or problem in jar - Riddhish.Chaudhari
I have also the same problem. web-inf/lib folder is empty. m2e-wtp version is 0.16. m2e version is 1.0.200. Cleaning glassfish and redeploying does not work for me. - Deniz
Be make sure that you remove web app before doing a clean up. That's the right way for my case with Tomcat. - bnguyen82

2 Answers

1
votes

Do you have m2eclipse WTP integration installed? There are few things you could try:

  • Maven->Update project configuration
  • Close and open project
  • Remove project from Tomcat instance in WTP, Clean up and add it back.

Depending on your version of Eclipse and m2eclipse/m2e and WTP the integration could be finicky sometimes.

0
votes
  • Is this option enabled? ProjectName (right-click) > Maven > Enable Dependency Management You should have in ProjectName > properties > Java Build Path > Libraries an item called Maven2 Dependencies
  • Is your M2_REPO variable set? Window > Preferences > Java > Build Path > Classpath Variables

If it's all ok, check the war that Maven is creating to see if the libs are there and in the correct folder (web-inf\libs). Check the maven output when generating the war.