I am trying to deploy Sonar (automatic code monitoring tool) on a Jetty 7 servlet container.
I would like to use the default config first (embedded Derby DB) as a POC and transition to a production grade DB later.
So far I have tried various ways to make this work (todo: document failed attempts) without any luck...
Did anyone managed to pull this off?
This is the exception I get by deploying in jetty/webapps and launching with
java -DOPTIONS=Server,deploy,jsp -jar start.jar etc/jetty.xml
org.picocontainer.PicoLifecycleException: PicoLifecycleException: method 'public void org.sonar.core.database.JndiDatabaseConnector.start()', instance 'org.sonar.core.database.JndiDatabaseConnector#1f1a3a8, 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
And this is what I get by deploying in webappls-plus and launching with:
java -DOPTIONS=Server,deploy,jsp -jar start.jar etc/jetty.xml etc/jetty-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)
Sonar tries to bind its JDBC datasource to JNDI. But it seems that Jetty 7 needs some extra-configuration to allow this. See this thread for more details.
I hope it helps.
Related
I'm exporting an .jar file into an .exe file, it's a console application and the command line should appears on clicking.
But I'm getting this error and dont know how to find the solution, I'm using exe4j.
Does it needs a lib or an option that I've missed?
Here's the stacktrace:
java.lang.NoClassDefFoundError: java/lang/ModuleLayer
at com.exe4j.runtime.jpms.ModuleHandler.findClass(ModuleHandler.java:17)
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.exe4j.runtime.LauncherEngine.launch(LauncherEngine.java:79)
at com.exe4j.runtime.WinLauncher.main(WinLauncher.java:94)
Caused by: java.lang.ClassNotFoundException: java.lang.ModuleLayer
at java.net.URLClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
... 7 more
I used spreadsheet view of controlsfx 8.0.6U25 with earlier jdk for my work and it worked good. Recently I updated to JDK 8U40 and controlsfx 8.20.8. Sadly, the spreadsheet view won't load. I get error in my IDE anytime I run the same project. Please, has anyone faced the same problem? What is the solution? Thank you.
Please find the error I get below. I made no changes before the update.
Exception in Application start method
java.lang.reflect.InvocationTargetException
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.sun.javafx.application.LauncherImpl.launchApplicationWithArgs(Unknown Source)
at com.sun.javafx.application.LauncherImpl.launchApplication(Unknown Source)
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 sun.launcher.LauncherHelper$FXHelper.main(Unknown Source)
Caused by: java.lang.RuntimeException: Exception in Application start method
at com.sun.javafx.application.LauncherImpl.launchApplication1(Unknown Source)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication$152(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$71/1915503092.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.InstantiationError: com.sun.javafx.scene.control.SelectedCellsMap
at impl.org.controlsfx.spreadsheet.SpreadsheetViewSelectionModel.<init>(SpreadsheetViewSelectionModel.java:198)
at org.controlsfx.control.spreadsheet.SpreadsheetView.<init>(SpreadsheetView.java:395)
at myStudentAssessNew.StudentAsessment$8.<init>(StudentAsessment.java:920)
at myStudentAssessNew.StudentAsessment.addhboxCenter(StudentAsessment.java:920)
at myStudentAssessNew.StudentAsessment.start(StudentAsessment.java:353)
at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$159(Unknown Source)
at com.sun.javafx.application.LauncherImpl$$Lambda$92/717936956.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$172(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$45/186276003.run(Unknown Source)
at com.sun.javafx.application.PlatformImpl.lambda$null$170(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$48/1232900564.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.javafx.application.PlatformImpl.lambda$runLater$171(Unknown Source)
at com.sun.javafx.application.PlatformImpl$$Lambda$46/237061348.run(Unknown Source)
at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(Unknown Source)
at com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at com.sun.glass.ui.win.WinApplication.lambda$null$145(Unknown Source)
at com.sun.glass.ui.win.WinApplication$$Lambda$36/2117255219.run(Unknown Source)
... 1 more
Exception running application myStudentAssessNew.StudentAsessment
Well, the solution rather looks simple. Since controlsfx project has not yet been updated to meet JDK 8u40 and above as at now, I just reinstalled the previous jdk (JDK 8u25) and I am okay now.
According to Rita Homepage you just have to download Rita.jar and
WordNet-3.1 and add both to thebuild path of your java project.
I did it like that and everytime i try to use it:
RiWordNet wordNet = new RiWordNet(Test.class.getResource("/WordNet-3.1").getPath());
I get:
java.lang.reflect.InvocationTargetException
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 rita.wordnet.jwnl.util.factory.Element.install(Unknown Source)
at rita.wordnet.jwnl.JWNL.initialize(Unknown Source)
at rita.RiWordNet.initWordNet(Unknown Source)
at rita.RiWordNet.<init>(Unknown Source)
at rita.RiWordNet.<init>(Unknown Source)
at de.hof.iisys.relationExtraction.analyzer.utils.Rita.main(Rita.java:13)
Caused by: rita.wordnet.jwnl.JWNLException: The properties file must specify a dictionary path
at rita.wordnet.jwnl.util.factory.AbstractValueParam.create(Unknown Source)
at rita.wordnet.jwnl.dictionary.FileBackedDictionary.installStatic(Unknown Source)
... 10 more
Caused by: rita.wordnet.RiWordNetError:
[ERROR] Couldn't find file: .\WordNet-3.1\dict\index.verb
at rita.wordnet.WordnetDictionaryFile.openFile(Unknown Source)
at rita.wordnet.jwnl.dictionary.file.AbstractDictionaryFile.open(Unknown Source)
at rita.wordnet.jwnl.dictionary.file.DictionaryCatalog.open(Unknown Source)
at rita.wordnet.jwnl.dictionary.file.DictionaryCatalogSet.open(Unknown Source)
at rita.wordnet.jwnl.dictionary.file_manager.FileManagerImpl.<init>(Unknown Source)
at rita.wordnet.jwnl.dictionary.file_manager.FileManagerImpl.create(Unknown Source)
at rita.wordnet.jwnl.util.factory.AbstractValueParam.create(Unknown Source)
... 11 more
The data files are no longer supplied as part of the installation. You need to download the WordNet version for your platform and then pass it to the constructor, as documented here.
I'm trying to install soapUI on my laptop and am getting the following error:
Starting Installer ...
java.lang.NoClassDefFoundError: java.awt.Container
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.init(Unknown Source)
at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.(Unknown Source)
at com.install4j.runtime.installer.frontend.headless.InstallerConsoleScreenExecutor.(Unknown Source)
at com.install4j.runtime.installer.Installer.getScreenExecutor(Unknown Source)
at com.install4j.runtime.installer.Installer.runInProcess(Unknown Source)
at com.install4j.runtime.installer.Installer.main(Unknown Source)
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.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
java.lang.NoClassDefFoundError: java.awt.Component
at javax.swing.ImageIcon$2.run(Unknown Source)
at javax.swing.ImageIcon$2.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.swing.ImageIcon.createNoPermsComponent(Unknown Source)
at javax.swing.ImageIcon.access$000(Unknown Source)
at javax.swing.ImageIcon$1.run(Unknown Source)
at javax.swing.ImageIcon$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at javax.swing.ImageIcon.(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.loadIcon(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.(Unknown Source)
at com.install4j.runtime.installer.helper.InstallerUtil.reportException(Unknown Source)
at com.install4j.runtime.installer.Installer.main(Unknown Source)
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.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
java.lang.NoClassDefFoundError: Could not initialize class java.awt.Toolkit
at javax.swing.ImageIcon.(Unknown Source)
at javax.swing.ImageIcon.(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.loadIcon(Unknown Source)
at com.install4j.runtime.installer.frontend.GUIHelper.(Unknown Source)
at com.install4j.runtime.installer.helper.InstallerUtil.reportException(Unknown Source)
at com.install4j.runtime.installer.Installer.main(Unknown Source)
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.exe4j.runtime.LauncherEngine.launch(Unknown Source)
at com.install4j.runtime.launcher.Launcher.main(Unknown Source)
Not sure what's going on. Any ideas would be much appreciated.
AFAIK SoapUI is distributed with its own JRE. From the stacktrace it appears that the application cannot find the runtime jar (rt.jar). Its probably easier to download a new copy of the test tool to resolve this.
If the JAVA_HOME environmental variable is that is set SoapUI uses the JRE installed at that location otherwise it uses its own copy. Its possible that JAVA_HOME is pointing to a JRE which has a corrupt runtime JAR file.
Try clearing this environmental variable or setting it to an another JRE
If you have Java correctly installed on your system, just use the zip version.
You may need to set your JAVA_HOME variable if you continue to see the same error.
Zip versions for every platform are available here.
Just extract the zip, and run bin/soapui.sh
My application was running fine until I upgraded my jre to 7u40. When my application is initializing, it's doing Logger.getLogger("ClassName"), and I'm getting the following exception.
java.lang.ExceptionInInitializerError
at java.util.logging.Logger.demandLogger(Unknown Source)
at java.util.logging.Logger.getLogger(Unknown Source)
at com.company.Application.Applet.<clinit>(Unknown Source)
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.sun.javaws.Launcher.executeApplication(Unknown Source)
at com.sun.javaws.Launcher.executeMainClass(Unknown Source)
at com.sun.javaws.Launcher.doLaunchApp(Unknown Source)
at com.sun.javaws.Launcher.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.NullPointerException
at java.util.logging.Logger.setParent(Unknown Source)
at java.util.logging.LogManager$6.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.doSetParent(Unknown Source)
at java.util.logging.LogManager.access$1100(Unknown Source)
at java.util.logging.LogManager$LogNode.walkAndSetParent(Unknown Source)
at java.util.logging.LogManager$LoggerContext.addLocalLogger(Unknown Source)
at java.util.logging.LogManager$LoggerContext.addLocalLogger(Unknown Source)
at java.util.logging.LogManager.addLogger(Unknown Source)
at java.util.logging.LogManager$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.util.logging.LogManager.<clinit>(Unknown Source)
The exception is coming from this line:
private static Logger logger = Logger.getLogger(Applet.class.getName());
Could it be because of any sideeffects with fix http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=8017174 ?
A workaround is to open the java control center and enable logging. This is a concern since by default "Enable Logging" is unchecked. If I select "Enable Logging", the application starts fine.
This problem seems to be fixed in java7 update 45.
Try to package java.util.logging.* with your app in a JAR, and make sure it's on the classpath. That way it is always available. Also, what does your logging.properties look like?