在碼頭上部署 gwt Web 應用程序 (deploying gwt web application on jetty)


問題描述

在碼頭上部署 gwt Web 應用程序 (deploying gwt web application on jetty)

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(URLClassLoader.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)

參考解法

方法 1:

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. 

方法 2:

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/

方法 3:

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

(by azhar_salatiGursel KocaRichard ChuoSneha Nilakandan)

參考文件

  1. deploying gwt web application on jetty (CC BY-SA 3.0/4.0)

#gwt #mongoDB #jetty #scala






相關問題

通過 GWT-RPC 發送持久的 JDO 實例 (Sending persisted JDO instances over GWT-RPC)

GWT:帶有 db 變量的屬性文件的安全位置 (GWT: Safe place for properties file with db variables)

paket khusus dalam toples eksternal GWT (specific packages in a external jar GWT)

在 gwt 框架中使用參數更改 url (Changing url with parameters in gwt framework)

通過 JavaScript 在標題或 HTML 中動態包含腳本元素 (Dynamically include script element in header or HTML by JavaScript)

Java如何在構造函數中將接口作為參數傳遞? (Java How do I pass interface as parameter in Constructor?)

如何更改 gwt 面板的內容? (How to change the content of a gwt panel?)

內容類型是“應用程序/x-www-form-urlencoded”。預期的“文本/x-gwt-rpc” (Content-Type was 'application/x-www-form-urlencoded'. Expected 'text/x-gwt-rpc')

如何從谷歌應用引擎調用我的應用網址 (How to call my app url from google app engine)

GXT NumberField 不可編輯 (GXT NumberField not editable)

在碼頭上部署 gwt Web 應用程序 (deploying gwt web application on jetty)

在 gwt 中使用 html5 畫布畫一個圓圈? (draw a circle using html5 canvas in gwt?)







留言討論