开发者

deploying gwt web application on jetty

开发者 https://www.devze.com 2023-01-31 21:48 出处:网络
Hi I am deploying my web application created in Gwt on the jetty. I have used mongodb as my database.After starting the server it starts deploying the weapp.war

Hi I am deploying my web application created in Gwt on the jetty. I have used mongodb as my database.After starting the server it starts deploying the weapp.war and gives following error -

694 [main] INFO org.mortbay.log - Extract /usr/share/jetty/webapps/myapp.war to /tmp/Jetty_0_0_0_0_8090_myapp.war__myapp__n6yltk/webapp
3567 [main] WARN org.mortbay.log - failed Startup: java.lang.LinkageError: loader constraint violation: loader (instance of org/mortbay/jetty/webapp/WebAppClassLoader) previously initiated loading for a different type with name "javax/management/MBeanServer"
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:634)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLC开发者_开发问答lassLoader.java:277)
    at java.net.URLClassLoader.access$000(URLClassLoader.java:73)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:212)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:392)
    at org.mortbay.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:363)
    at com.mongodb.DBPortPool$Holder.get(DBPortPool.java:58)
    at com.mongodb.DBTCPConnector._set(DBTCPConnector.java:458)
    at com.mongodb.DBTCPConnector.<init>(DBTCPConnector.java:46)
    at com.mongodb.Mongo.<init>(Mongo.java:137)
    at com.mongodb.Mongo.<init>(Mongo.java:123)


one of the jar in your classpath contains javax/management/MBeanServer. That is why you have got this exception. For example jboss-jmx.jar contains this class, if this jar is included in your classpath,you should remove it.


That is a class loading issue between the web class loader and the system class loader. You might want to check this great speech about ClassLoader out. http://www.zeroturnaround.com/blog/video-do-you-really-get-class-loaders-a-jazoon-talk-by-jevgeni-kabanov/


Check if you have log4j dependency in your pom.xml. The log4j has a dependency to jmxri which needs to be excluded. Once you exclude this, the error gets resolved

0

精彩评论

暂无评论...
验证码 换一张
取 消