org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class
The problem is that there is no class called com.service.SempediaSearchManager
on your webapp's classpath. The most likely root causes are:
the fully qualified classname is incorrect in
/WEB-INF/Sempedia-service.xml
; i.e. the class name is something else,the class is not in your webapp's
/WEB-INF/classes
directory tree or a JAR file in the/WEB-INF/lib
directory.
EDIT : The only other thing that I can think of is that the ClassDefNotFoundException
may actually be a result of an earlier class loading / static initialization problem. Check your log files for the first stack trace, and look the nested exceptions, i.e. the "caused by" chain. [If a class load fails one time and you or Spring call Class.forName()
again for some reason, then Java won't actually try to load a second time. Instead you will get a ClassDefNotFoundException
stack trace that does not explain the real cause of the original failure.]
If you are still stumped, you should take Eclipse out of the picture. Create the WAR file in the form that you are eventually going to deploy it, then from the command line:
manually shutdown Tomcat
clean out your Tomcat webapp directory,
copy the WAR file into the webapp directory,
start Tomcat.
If that doesn't solve the problem directly, look at the deployed webapp directory on Tomcat to verify that the "missing" class is in the right place.
I got the same error and the cause was the directory:
U:.....WEB\WebRoot\WEB-INF\classes\com\yourcompany\cc\dao
was corrupted(directory or file not readable or damaged).. solved with
- renaming the directory WEB-INF\classes as WEB-INF\classes_old
- Eclipse's Project menu--> Clean (to recreate directories)
- redeploy --> restart server.