java - Grails project - Servlet call - ClassNotFoundException: javax.servlet.AsyncContext -


i using

  • intellij idea ultimate 12..4
  • grails 2.2.0 ,
  • grails.servlet.version = "2.5" in buildconfig.groovy file

and implemented simple servlet post request. using restclient post request found these scenariol

scenario:

  • when use locally works fine. url: localhost:9090/testproject/api/testreport

  • but when deploy in local server follwing error messages shown url:192.168.1.10:9090/testproject/api/testreport

local server configuration localhost has....

code:    error errors.grailsexceptionresolver  - classnotfoundexception occurred when processing request: [post] /testproject/api/testreport         javax.servlet.asynccontext. stacktrace follows:         java.lang.classnotfoundexception: javax.servlet.asynccontext                 @ java.lang.class.privategetdeclaredmethods(class.java:2442)                 @ java.lang.class.getdeclaredmethods(class.java:1808)                 @ org.codehaus.groovy.util.lazyreference.getlocked(lazyreference.java:46)                 @ org.codehaus.groovy.util.lazyreference.get(lazyreference.java:33)                 @ org.grails.jaxrs.support.converterutils.jsontomap(converterutils.groovy:94)                 @ org.grails.jaxrs.support.domainobjectreadersupport.readfromjson(domainobjectreadersupport.groovy:124)                 @ org.grails.jaxrs.support.domainobjectreadersupport.readfrom(domainobjectreadersupport.groovy:93)                 @ com.sun.jersey.spi.container.containerrequest.getentity(containerrequest.java:474)                 @ com.sun.jersey.server.impl.model.method.dispatch.entityparamdispatchprovider$entityinjectable.getvalue(entityparamdispatchprovider.java:123)                 @ com.sun.jersey.server.impl.inject.injectablevaluesprovider.getinjectablevalues(injectablevaluesprovider.java:46)                 @ com.sun.jersey.server.impl.model.method.dispatch.abstractresourcemethoddispatchprovider$entityparamininvoker.getparams(abstractresourcemethoddispatchprovider.java:153)                 @ com.sun.jersey.server.impl.model.method.dispatch.abstractresourcemethoddispatchprovider$typeoutinvoker._dispatch(abstractresourcemethoddispatchprovider.java:183)                 @ com.sun.jersey.server.impl.model.method.dispatch.resourcejavamethoddispatcher.dispatch(resourcejavamethoddispatcher.java:75)                 @ com.sun.jersey.server.impl.uri.rules.httpmethodrule.accept(httpmethodrule.java:288)                 @ com.sun.jersey.server.impl.uri.rules.resourceclassrule.accept(resourceclassrule.java:108)                 @ com.sun.jersey.server.impl.uri.rules.righthandpathrule.accept(righthandpathrule.java:147)                 @ com.sun.jersey.server.impl.uri.rules.rootresourceclassesrule.accept(rootresourceclassesrule.java:84)                 @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1469)                 @ com.sun.jersey.server.impl.application.webapplicationimpl._handlerequest(webapplicationimpl.java:1400)                 @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1349)                 @ com.sun.jersey.server.impl.application.webapplicationimpl.handlerequest(webapplicationimpl.java:1339)                 @ com.sun.jersey.spi.container.servlet.webcomponent.service(webcomponent.java:416)                 @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:537)                 @ com.sun.jersey.spi.container.servlet.servletcontainer.service(servletcontainer.java:699)                 @ org.grails.jaxrs.web.jaxrscontext$jaxrsserviceimpl.process(jaxrscontext.java:192)                 @ org.grails.jaxrs.jaxrscontroller$_closure1.docall(jaxrscontroller.groovy:48)                 @ grails.plugin.cache.web.filter.pagefragmentcachingfilter.dofilter(pagefragmentcachingfilter.java:195)                 @ grails.plugin.cache.web.filter.abstractfilter.dofilter(abstractfilter.java:63)                 @ org.grails.jaxrs.web.jaxrsfilter.dofilterinternal(jaxrsfilter.java:46)                 @ java.lang.thread.run(thread.java:722) 

after couple of days of searching , integrating found solution .....

  1. why classnotfoundexception exception occurs here article real ...

    http://javarevisited.blogspot.com/2011/08/classnotfoundexception-in-java-example.html

  2. the main reason of problem shows log java.lang.classnotfoundexception: javax.servlet.asynccontext

    it means not finding asynccontext class provided javax.servlet-3.0 . in servlet 2.5 missing.

i running apache tomcat 7 in localhost, in local server 192.168.1.10 running apache tomcat 6 . in given link apache doc says servlet version.

 solution either upgrade apache tomcat 6 apache tomcat 7  or posting file javax.servlet-3.0 in apache tomcat 6 lib folder.  [here][3] jar file. 

Comments

Popular posts from this blog

Android layout hidden on keyboard show -

google app engine - 403 Forbidden POST - Flask WTForms -

c - Why would PK11_GenerateRandom() return an error -8023? -