xml - java.lang.NoClassDefFoundError: javax/servlet/AsyncListener -
i new spring-mvc , developing simple spring application,while running application getting following exception java.lang.noclassdeffounderror: javax/servlet/asynclistener ,can guide me come out of problem
java.lang.noclassdeffounderror: javax/servlet/asynclistener @ java.lang.classloader.defineclass1(native method) @ java.lang.classloader.defineclasscond(unknown source) @ java.lang.classloader.defineclass(unknown source) @ java.security.secureclassloader.defineclass(unknown source) @ org.apache.catalina.loader.webappclassloader.findclassinternal(webappclassloader.java:1850) @ org.apache.catalina.loader.webappclassloader.findclass(webappclassloader.java:890) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1354) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1233) @ java.lang.class.getdeclaredmethods0(native method) @ java.lang.class.privategetdeclaredmethods(unknown source) @ java.lang.class.getdeclaredmethods(unknown source) @ org.springframework.core.type.standardannotationmetadata.hasannotatedmethods(standardannotationmetadata.java:159) @ org.springframework.context.annotation.configurationclassutils.isliteconfigurationcandidate(configurationclassutils.java:104) @ org.springframework.context.annotation.configurationclassutils.checkconfigurationclasscandidate(configurationclassutils.java:87) @ org.springframework.context.annotation.configurationclasspostprocessor.processconfigbeandefinitions(configurationclasspostprocessor.java:233) @ org.springframework.context.annotation.configurationclasspostprocessor.postprocessbeandefinitionregistry(configurationclasspostprocessor.java:203) @ org.springframework.context.support.abstractapplicationcontext.invokebeanfactorypostprocessors(abstractapplicationcontext.java:622) @ org.springframework.context.support.abstractapplicationcontext.refresh(abstractapplicationcontext.java:451) @ org.springframework.web.servlet.frameworkservlet.configureandrefreshwebapplicationcontext(frameworkservlet.java:634) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:591) @ org.springframework.web.servlet.frameworkservlet.createwebapplicationcontext(frameworkservlet.java:648) @ org.springframework.web.servlet.frameworkservlet.initwebapplicationcontext(frameworkservlet.java:511) @ org.springframework.web.servlet.frameworkservlet.initservletbean(frameworkservlet.java:452) @ org.springframework.web.servlet.httpservletbean.init(httpservletbean.java:133) @ javax.servlet.genericservlet.init(genericservlet.java:212) @ org.apache.catalina.core.standardwrapper.loadservlet(standardwrapper.java:1173) @ org.apache.catalina.core.standardwrapper.load(standardwrapper.java:993) @ org.apache.catalina.core.standardcontext.loadonstartup(standardcontext.java:4149) @ org.apache.catalina.core.standardcontext.start(standardcontext.java:4458) @ org.apache.catalina.core.containerbase.start(containerbase.java:1045) @ org.apache.catalina.core.standardhost.start(standardhost.java:722) @ org.apache.catalina.core.containerbase.start(containerbase.java:1045) @ org.apache.catalina.core.standardengine.start(standardengine.java:443) @ org.apache.catalina.core.standardservice.start(standardservice.java:516) @ org.apache.catalina.core.standardserver.start(standardserver.java:710) @ org.apache.catalina.startup.catalina.start(catalina.java:583) @ sun.reflect.nativemethodaccessorimpl.invoke0(native method) @ sun.reflect.nativemethodaccessorimpl.invoke(unknown source) @ sun.reflect.delegatingmethodaccessorimpl.invoke(unknown source) @ java.lang.reflect.method.invoke(unknown source) @ org.apache.catalina.startup.bootstrap.start(bootstrap.java:288) @ org.apache.catalina.startup.bootstrap.main(bootstrap.java:413) caused by: java.lang.classnotfoundexception: javax.servlet.asynclistener @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1387) @ org.apache.catalina.loader.webappclassloader.loadclass(webappclassloader.java:1233) ... 42 more
this web.xml
<?xml version="1.0" encoding="utf-8"?> <web-app xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:web="http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" xsi:schemalocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd" id="webapp_id" version="2.5"> <display-name>loginform</display-name> <servlet> <servlet-name>dispatcher</servlet-name> <servlet-class>org.springframework.web.servlet.dispatcherservlet </servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>dispatcher</servlet-name> <url-pattern>/forms/*</url-pattern> </servlet-mapping> <welcome-file-list> <welcome-file>index.jsp</welcome-file> </welcome-file-list> </web-app>
this dispatcher-servlet.xml
<?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:p="http://www.springframework.org/schema/p" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemalocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd "> <!-- enable annotation driven controllers, validation etc... --> <mvc:annotation-driven /> <context:component-scan base-package="controller.*" /> <bean id="viewresolver" class="org.springframework.web.servlet.view.internalresourceviewresolver"> <property name="prefix"> <value>/web-inf/views/</value> </property> <property name="suffix"> <value>.jsp</value> </property> </bean> <bean id="messagesource" class="org.springframework.context.support.reloadableresourcebundlemessagesource"> <property name="basename" value="/web-inf/messages" /> </bean> </beans>
more mvc problem seems problem lib files in tomcat.please verify server lib files ensure jar there resolving class.
Comments
Post a Comment