Error casting servlet: "main" to javax.servlet.Servlet
Please suggest me to resoleve the error.In my project using struts,spring.I am getting this error when running the apps.
<Error> <HTTP> <BEA-101126> <[ServletContext(id=15938176,name=efund,context- path=/efund)] Error casting servlet: "main" to javax.servlet.Servlet
java.lang.ClassCastException
at javax.xml.parsers.DocumentBuilderFactory.newInstance(Unknown Source)
at org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:134)
<BEA-101216> <Servlet: "action" failed to preload on startup in Web application: "efund".
javax.开发者_开发技巧servlet.ServletException
Please let me know , what is the problem in my project ?
Thank you in advance.
Looks pretty straightforward to me. The class com.thetravel.ld.tools.efund.servlets.HIMain is registered as a servlet called "main", but it doesn't implement javax.servlet.Servlet (i.e. it isn't a servlet).
Either HIMain doesn't extend GenericServlet or HttpServlet, or your application is including its own copy of the Servlet API. The latter can cause classloading problems like this one.
Make sure you don't have servlet-api.jar (or something like it) in your application.
加载中,请稍侯......
精彩评论