2 Replies Latest reply on Nov 22, 2011 3:31 AM by liny liny

    AjaxMQServlet and Tomcat 7 problem

    liny liny Newbie

      Hi,

       

      I downloaded "activemq-web-demo-5.5.1.war" from http://repo1.maven.org/maven2/org/apache/activemq/activemq-web-demo/5.5.1/ and put into Tomcat webapps directory, but has below error:

       

       

      Nov 22, 2011 1:08:11 PM org.apache.catalina.core.StandardContext listenerStart

       

       

      SEVERE: Error configuring application listener of class org.apache.activemq.web.SessionListener

       

       

      java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder at org.slf4j.LoggerFactory.getSingleton(LoggerFactory.java:230) at org.slf4j.LoggerFactory.bind(LoggerFactory.java:121) at org.slf4j.LoggerFactory.performInitialization(LoggerFactory.java:112) at org.slf4j.LoggerFactory.getILoggerFactory(LoggerFactory.java:275) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:248) at org.slf4j.LoggerFactory.getLogger(LoggerFactory.java:261) at org.apache.activemq.web.SessionListener.<clinit>(SessionListener.java:28) at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39) at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27) at java.lang.reflect.Constructor.newInstance(Constructor.java:513) at java.lang.Class.newInstance0(Class.java:355) at java.lang.Class.newInstance(Class.java:308) at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4150) at org.apache.catalina.core.StandardContext.start(StandardContext.java:4705) at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:799) at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:779) at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:601) at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:943) at org.apache.catalina.startup.HostConfig.deployWARs(HostConfig.java:778) at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:504) at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1317) at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:324) at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:142) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1065) at org.apache.catalina.core.StandardHost.start(StandardHost.java:840) at org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1057) at org.apache.catalina.core.StandardEngine.start(StandardEngine.java:463) at org.apache.catalina.core.StandardService.start(StandardService.java:525) at org.apache.catalina.core.StandardServer.start(StandardServer.java:754) at org.apache.catalina.startup.Catalina.start(Catalina.java:595) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:289) at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:414)

       

       

      Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1680) at org.apache.catalina.loader.WebappClassLoader.loadClass(WebappClassLoader.java:1526) ... 37 more

       

       

      Does anyone deploy it without problem in Tomcat 7?

        • 1. Re: AjaxMQServlet and Tomcat 7 problem
          liny liny Newbie

          Hi,

           

          SLF4J said 1.5.11 is not compatible with Java 6, so I remove 1.5.11 with slf4j-api-1.6.4.jar, logback-classic-1.0.0.jar, and logback-core-1.0.0.jar.

          Tomcat also told me that servlet-api-2.5.jar won't be loaded.

          Now I am facing below:

           

          SEVERE: Servlet.service() for servlet AjaxServlet threw exception

          java.lang.IllegalStateException: !(Jetty || Servlet 3.0 || ContinuationFilter)

          at org.eclipse.jetty.continuation.ContinuationSupport.getContinuation(ContinuationSupport.java:145)

          at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:304)

          at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:241)

          at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:617)

          at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45)

          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)

          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)

          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)

          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)

          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)

          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)

          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)

          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:291)

          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:859)

          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:602)

          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)

          at java.lang.Thread.run(Thread.java:662)

          • 2. Re: AjaxMQServlet and Tomcat 7 problem
            liny liny Newbie

            Hi,

             

            I check source code of "org.apache.activemq.web.SessionFilter" and found this filter is needed.So I modified web.xml of web demo application as below:

                <filter>

            <filter-name>session</filter-name>

            <filter-class>org.apache.activemq.web.SessionFilter</filter-class>

            </filter>

            <filter>

            <filter-name>ContinuationFilter</filter-name>

            <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class></filter>

                

            <filter-mapping>

            <filter-name>session</filter-name>

            <url-pattern>/*</url-pattern></filter-mapping>

            <filter-mapping>

            <filter-name>ContinuationFilter</filter-name>

            <url-pattern>/*</url-pattern>    </filter-mapping>

            OK~Now AJAX stock portfolio demo works with Tomcat 6.Then I copied same web demo application to webapps directory of Tomcat7, but got below error:

            +SEVERE: Servlet.service() for servlet in context with path /activemq-web-demo-5.5.1 threw exception

            java.lang.IllegalStateException: Not supported. at org.apache.catalina.connector.Request.startAsync(Request.java:1638) at org.apache.catalina.connector.Request.startAsync(Request.java:1631) at org.apache.catalina.connector.RequestFacade.startAsync(RequestFacade.java:1024) at org.eclipse.jetty.continuation.Servlet3Continuation.suspend(Servlet3Continuation.java:184) at org.apache.activemq.web.MessageListenerServlet.doMessages(MessageListenerServlet.java:321) at org.apache.activemq.web.MessageListenerServlet.doGet(MessageListenerServlet.java:241) at org.apache.activemq.web.AjaxServlet.doGet(AjaxServlet.java:47) at javax.servlet.http.HttpServlet.service(HttpServlet.java:621) at javax.servlet.http.HttpServlet.service(HttpServlet.java:722) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:304) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.eclipse.jetty.continuation.ContinuationFilter.doFilter(ContinuationFilter.java:112) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.activemq.web.SessionFilter.doFilter(SessionFilter.java:45) at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243) at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210) at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:224) at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175) at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:472) at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:164) at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:100) at org.apache.catalina.valves.AccessLogValve.invoke(AccessLogValve.java:929) at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118) at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:405) at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:279) at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:515) at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:302) at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) at java.lang.Thread.run(Thread.java:662)+

             

            Still don't know why...

            Any help is appreciated.