2009-06-04 64 views
2

我想在Jetty 7 servlet容器上部署Sonar(自動代碼監視工具)。有沒有人在Jetty 7上成功部署Sonar?

我想首先使用默認配置(嵌入式Derby DB)作爲POC和過渡到生產的DB級以後。

到目前爲止,我已經想盡各種辦法,使這項工作(TODO:文件失敗的嘗試),沒有任何運氣...

這兒還有沒有人設法拉這一關?

這是例外,我得到在碼頭/ webapps中部署和使用

的Java -DOPTIONS =服務器啓動,部署,JSP的罐子start.jar等/的jetty.xml

org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.core.database.JndiDatabaseConnector.start()', instance '[email protected], java.lang.RuntimeException: wrapper 
     at org.picocontainer.monitors.NullComponentMonitor.lifecycleInvocationFailed(NullComponentMonitor.java:76) 
     at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:129) 
     at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:115) 
     at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.start(ReflectionLifecycleStrategy.java:89) 
     at org.picocontainer.injectors.AbstractInjector.start(AbstractInjector.java:131) 
     at org.picocontainer.behaviors.AbstractBehavior.start(AbstractBehavior.java:173) 
     at org.picocontainer.behaviors.Stored$RealComponentLifecycle.start(Stored.java:134) 
     at org.picocontainer.behaviors.Stored.start(Stored.java:111) 
     at org.picocontainer.DefaultPicoContainer.startAdapters(DefaultPicoContainer.java:882) 
     at org.picocontainer.DefaultPicoContainer.start(DefaultPicoContainer.java:630) 
     at org.sonar.core.Application.start(Application.java:57) 
     at org.sonar.web.listeners.ApplicationListener.contextInitialized(ApplicationListener.java:42) 
     at org.eclipse.jetty.server.handler.ContextHandler.startContext(ContextHandler.java:627) 
     at org.eclipse.jetty.servlet.ServletContextHandler.startContext(ServletContextHandler.java:189) 
     at org.eclipse.jetty.webapp.WebAppContext.startContext(WebAppContext.java:1200) 
     at org.eclipse.jetty.server.handler.ContextHandler.doStart(ContextHandler.java:585) 
     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:334) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.server.Server.doStart(Server.java:221) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:979) 
     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 org.eclipse.jetty.start.Main.invokeMain(Main.java:248) 
     at org.eclipse.jetty.start.Main.start(Main.java:637) 
     at org.eclipse.jetty.start.Main.main(Main.java:138) 
Caused by: java.lang.RuntimeException: wrapper 
     at org.picocontainer.lifecycle.ReflectionLifecycleStrategy.monitorAndThrowReflectionLifecycleException(ReflectionLifecycleStrategy.java:127) 
     ... 32 more 
Caused by: org.sonar.commons.database.JndiException: Can not bind JDBC datasource to JNDI 
     at org.sonar.core.database.JndiDatabaseConnector.createAndBindDatasource(JndiDatabaseConnector.java:124) 
     at org.sonar.core.database.JndiDatabaseConnector.start(JndiDatabaseConnector.java:69) 
     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 org.picocontainer.lifecycle.ReflectionLifecycleStrategy.invokeMethod(ReflectionLifecycleStrategy.java:110) 
     ... 31 more 
Caused by: javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial 
     at javax.naming.spi.NamingManager.getInitialContext(Unknown Source) 
     at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source) 
     at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source) 
     at javax.naming.InitialContext.lookup(Unknown Source) 
     at org.sonar.core.database.JndiDatabaseConnector.createJNDISubContexts(JndiDatabaseConnector.java:177) 
     at org.sonar.core.database.JndiDatabaseConnector.createAndBindDatasource(JndiDatabaseConnector.java:118) 
     ... 37 more 

而這就是我得到的webappls加部署,並與發射:

的Java -DOPTIONS =服務器,部署,JSP -jar小號tart.jar等/的jetty.xml等/碼頭-plus.xml

java.lang.ClassNotFoundException: org.eclipse.jetty.plus.webapp.EnvConfiguration 
     at java.net.URLClassLoader$1.run(Unknown Source) 
     at java.security.AccessController.doPrivileged(Native Method) 
     at java.net.URLClassLoader.findClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at java.lang.ClassLoader.loadClass(Unknown Source) 
     at org.eclipse.jetty.util.Loader.loadClass(Loader.java:90) 
     at org.eclipse.jetty.util.Loader.loadClass(Loader.java:70) 
     at org.eclipse.jetty.webapp.WebAppContext.loadConfigurations(WebAppContext.java:796) 
     at org.eclipse.jetty.webapp.WebAppContext.doStart(WebAppContext.java:297) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164) 
     at org.eclipse.jetty.server.handler.ContextHandlerCollection.doStart(ContextHandlerCollection.java:161) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerCollection.doStart(HandlerCollection.java:164) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.server.handler.HandlerWrapper.doStart(HandlerWrapper.java:92) 
     at org.eclipse.jetty.server.Server.doStart(Server.java:221) 
     at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:55) 
     at org.eclipse.jetty.xml.XmlConfiguration.main(XmlConfiguration.java:979) 
     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 org.eclipse.jetty.start.Main.invokeMain(Main.java:248) 
     at org.eclipse.jetty.start.Main.start(Main.java:637) 
     at org.eclipse.jetty.start.Main.main(Main.java:138) 

回答

4

聲納試圖綁定其JDBC數據源到JNDI。但似乎Jetty 7需要一些額外配置才能實現。有關更多詳細信息,請參見thread

我希望它有幫助。

+0

謝謝,我也偶然發現了這個帖子。代表太低而不滿意;-) – dimdm 2009-06-09 13:35:19

相關問題