You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@zookeeper.apache.org by david pocivalnik <dp...@gmail.com> on 2013/02/05 16:44:35 UTC

zookeeper + slf4j issue in webapp

Hi,

I'm having troubles with ZooKeeper (the static initialization of the 
slf4j logger) when I'm in a webapp.

I use GWT and HBase. When initializing HBaseAdmin at some point 
Zookeeper gets initialized and the error
NoClassDefFound rises, org/slf4j.LoggerFactory

I copied the static-block from ZooKeeper.java into a new class I 
created, adapted it and added the references to the libraries, all 
within a typical java project, and it worked fine. When just using this 
newly created class with the static block within my webapp I again get 
the error.

Do you have any idea why? the version of zookeeper is 3.4.3, hbase 
0.92.1 and the corresponding libraries that come with hbase, so there 
shouldn't be any other problem. GWT is in dev mode, and running on Jetty.

here is the whole stack trace. thanks for any hints.

BR

com.google.gwt.user.server.rpc.UnexpectedException: Service method 
'public abstract java.lang.String *********Service.startup(boolean)' 
threw an unexpected exception: java.lang.NoClassDefFoundError: 
org/slf4j/LoggerFactory
	at 
com.google.gwt.user.server.rpc.RPC.encodeResponseForFailure(RPC.java:389)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:579)
	at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processCall(RemoteServiceServlet.java:208)
	at 
com.google.gwt.user.server.rpc.RemoteServiceServlet.processPost(RemoteServiceServlet.java:248)
	at 
com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet.doPost(AbstractRemoteServiceServlet.java:62)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
	at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487)
	at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362)
	at 
org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216)
	at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181)
	at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:729)
	at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at 
org.mortbay.jetty.handler.RequestLogHandler.handle(RequestLogHandler.java:49)
	at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152)
	at org.mortbay.jetty.Server.handle(Server.java:324)
	at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505)
	at 
org.mortbay.jetty.HttpConnection$RequestHandler.content(HttpConnection.java:843)
	at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:647)
	at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211)
	at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380)
	at 
org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395)
	at 
org.mortbay.thread.QueuedThreadPool$PoolThread.run(QueuedThreadPool.java:488)
Caused by: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
	at *********MyDummy.<clinit>(MyDummy.java:15)
	at *********UiBiz.initialize(UiBiz.java:91)
	at *********ServiceImpl.startup(ServiceImpl.java:27)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
	at java.lang.reflect.Method.invoke(Unknown Source)
	at com.google.gwt.user.server.rpc.RPC.invokeAndEncodeResponse(RPC.java:561)
	... 22 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.net.URLClassLoader$1.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(Unknown Source)
	at 
com.google.gwt.dev.shell.jetty.JettyLauncher$WebAppContextWithReload$WebAppClassLoaderExtension.findClass(JettyLauncher.java:372)
	at 
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:366)
	at 
org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:337)
	... 30 more