Quantcast

activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

liny
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?
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

liny
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)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

liny
Hi,

For "java.lang.IllegalStateException: !(Jetty || Servlet 3.0 || ContinuationFilter)",
I did below change in web.xml of web demo:
<!--      <filter-class>org.apache.activemq.web.SessionFilter</filter-class>-->
      <filter-class>org.eclipse.jetty.continuation.ContinuationFilter</filter-class>

Strange!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

liny
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 [AjaxServlet] 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...
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: activemq-web-demo-5.5.1.war occurs "java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder"

liny
Hi,

I put "servlet-api-2.5.jar" back to lib of web demo and restarted Tomcat7.
Unlucky, got below error:
INFO: validateJarFile(C:\taapp\opt\apache-tomcat-7.0.20\webapps\activemq-web-demo-5.5.1\WEB-INF\lib\servlet-api-2.5.jar) - jar not loaded. See Servlet Spec 2.3, section 9.7.2. Offe
nding class: javax/servlet/Servlet.class
Nov 22, 2011 2:40:50 PM org.apache.catalina.session.StandardManager doLoad
SEVERE: IOException while loading persisted sessions: java.io.InvalidClassException: org.apache.activemq.web.WebClient; unable to create instance
java.io.InvalidClassException: org.apache.activemq.web.WebClient; unable to create instance
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1738)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
        at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1600)
        at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1073)
        at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
        at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
        at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:470)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
        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:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: java.lang.reflect.InvocationTargetException
        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.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:924)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1736)
        ... 39 more
Caused by: java.lang.IllegalStateException: initContext(ServletContext) not called
        at org.apache.activemq.web.WebClient.<init>(WebClient.java:93)
        ... 45 more
Nov 22, 2011 2:40:50 PM org.apache.catalina.session.StandardManager startInternal
SEVERE: Exception loading sessions from persistent storage
java.io.InvalidClassException: org.apache.activemq.web.WebClient; unable to create instance
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1738)
        at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1328)
        at java.io.ObjectInputStream.readObject(ObjectInputStream.java:350)
        at org.apache.catalina.session.StandardSession.readObject(StandardSession.java:1600)
        at org.apache.catalina.session.StandardSession.readObjectData(StandardSession.java:1073)
        at org.apache.catalina.session.StandardManager.doLoad(StandardManager.java:284)
        at org.apache.catalina.session.StandardManager.load(StandardManager.java:204)
        at org.apache.catalina.session.StandardManager.startInternal(StandardManager.java:470)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5241)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:812)
        at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:787)
        at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:607)
        at org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java:1055)
        at org.apache.catalina.startup.HostConfig.deployDirectories(HostConfig.java:978)
        at org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:472)
        at org.apache.catalina.startup.HostConfig.start(HostConfig.java:1322)
        at org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:311)
        at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
        at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
        at org.apache.catalina.util.LifecycleBase.setStateInternal(LifecycleBase.java:389)
        at org.apache.catalina.util.LifecycleBase.setState(LifecycleBase.java:334)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1041)
        at org.apache.catalina.core.StandardHost.startInternal(StandardHost.java:774)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.ContainerBase.startInternal(ContainerBase.java:1033)
        at org.apache.catalina.core.StandardEngine.startInternal(StandardEngine.java:291)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardService.startInternal(StandardService.java:443)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.core.StandardServer.startInternal(StandardServer.java:727)
        at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:148)
        at org.apache.catalina.startup.Catalina.start(Catalina.java:621)
        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:322)
        at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:450)
Caused by: java.lang.reflect.InvocationTargetException
        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.io.ObjectStreamClass.newInstance(ObjectStreamClass.java:924)
        at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1736)
        ... 39 more
Caused by: java.lang.IllegalStateException: initContext(ServletContext) not called
        at org.apache.activemq.web.WebClient.<init>(WebClient.java:93)
        ... 45 more
Loading...