So I'm just exporting a basic program with one library tornadofx-1.7.11.jar plus the standard Kotlin library. I've exported it fully using this guide. I tried running it in the command line, but received this error:
Exception in thread "main" java.lang.NoClassDefFoundError: kotlin/jvm/internal/Intrinsics
at main.app.AppKt.main(app.kt)
Caused by: java.lang.ClassNotFoundException: kotlin.jvm.internal.Intrinsics
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)
... 1 more
I've looked up my issue here, and it said that my error has to do with a broken class path. I have no idea what I'm doing with regards to class paths, but the guide mentioned earlier stated to just put the names of all jars. If you really want it, here's my class path: tornadofx-1.7.11.jar. Just that one line. I'm not sure if I should add more, but I did it like the example showed.
If needed, I'm running on Intellij IDEA version 2017.2.6.IC-172.4574.11.
You need to add the kotlin stdlib to the classpath to to run it from the command line.
Something like:
java --class-path tornadofx-1.7.11.jar stdlib.jar -jar myprogram.jar
Running it from InteliJ is simpler since it configures it on its own.
Related
I am trying to run liquibase update in Windows by providing the details such as classpath, dialect,url,user, password and I am getting an sl4j.Logger class not found exception.
The command looks like this
java -jar liquibase.jar update --classpath=mypath ...
The sl4j jar is present in the lib package of my liquibase.
What should I do to solve the error.
The error log is as follows:-
Exception in thread "main" java.lang.NoClassDefFoundError:
org/slf4j/LoggerFactory at
liquibase.logging.core.Slf4JLoggerFactory.getLog(Slf4JLoggerFactory.java:9)
at liquibase.logging.LogService.getLog(LogService.java:39)
at liquibase.integration.commandline.Main.<clinit>(Main.java:61)
Caused by: java.lang.ClassNotFoundException: org.slf4j.LoggerFactory
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)
... 3 more
When I try to run through bat file with the command
liquibase update --changeLogFile=C:\Desktop\migrate\update-test\changelog\databasechangelog.xml --driver=org.hibernate.dialect.PostgreSQLDialect --classpath=C:\Desktop\migrate\update-test\postgresql --url=jdbc:postgresql://myserver:5432/ --username=postgres --password=postgres --logLevel=debug
, I am getting unexpected params error
unexpected command parameters: [--changeLogFile=C:Desktop\migrate\update-test\changelog\databasechangelog.xml, --driver=org.hibernate.dialect.PostgreSQLDialect, --classpath=C:\migrate\update-test\postgresql, --url=jdbc:postgresql://myserver.COM:5432/, --username=postgres, --password=postgres]
What have I done wrong here?
In the future, it is helpful if you include the full error in your question.
That said, you might be seeing the same thing as in this question: unable to use liquibase standalone shell script
I am facing an error whenever I run the cucumber program by Junit. Here the errors. Any help will be awesome
But in a program, there is no error.
java.lang.NoClassDefFoundError: cucumber/io/ResourceLoader
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
at java.lang.Class.getConstructor0(Unknown Source)
at java.lang.Class.getConstructor(Unknown Source)
at cucumber.runtime.Reflections.hasConstructor(Reflections.java:53)
at cucumber.runtime.Reflections.instantiateSubclasses(Reflections.java:)
at cucumber.runtime.Runtime.loadBackends(Runtime.java:87)
at cucumber.runtime.Runtime.<init>(Runtime.java:41)
at cucumber.api.junit.Cucumber.createRuntime(Cucumber.java:84)
at cucumber.api.junit.Cucumber.<init>(Cucumber.java:63)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(UnknownSource)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at org.junit.internal.requests.ClassRequest.buildRunner(ClassRequest.java:33)
at org.junit.internal.requests.ClassRequest.getRunner(ClassRequest.java:28)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createUnfilteredTest(JUnit4TestLoader.java:90)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.createTest(JUnit4TestLoader.java:76)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestLoader.loadTests(JUnit4TestLoader.java:49)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:525)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:763)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:463)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:209)
Caused by: java.lang.ClassNotFoundException: cucumber.io.ResourceLoader
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)
... 23 more
I want to run my program but the system gives an error.
Please make sure you have the correct Cucumber dependency / dependencies.
You can find which ones you need and their latest version in the docs
If you are using multiple Cucumber dependencies, please make sure to use the same version for all, to avoid conflicts.
Here are the minimum dependencies needed to get your Cucumber running:
Cucumber-java (1.2.2) | Cucumber-junit (1.2.2) | Cucumber-picocontainer (1.2.2) |junit (4.12)
Maven manages the rest of the dependencies. Make sure you have the latest dependencies, and that you are not mixing and matching versions (all shall follow 1.2.2/4.0.0 version)
Please share your POM.XML dependencies.
You're probably missing the cucumber-core.jar from your classpath
Hope yours is NOT a maven project or you didnt add cucumber-core dependency in your pom.xml. I can see the solution already provided by #funkyjelly, please go through that.
I am adding a formula in a transformation in kettle. In the properties of that formula, when I click on formula textfield, I get an error:
org.eclipse.swt.SWTError: No more handles [MOZILLA_FIVE_HOME=''] (java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so)
at org.eclipse.swt.SWT.error(Unknown Source)
at org.eclipse.swt.browser.Mozilla.initMozilla(Unknown Source)
at org.eclipse.swt.browser.Mozilla.create(Unknown Source)
at org.eclipse.swt.browser.Browser.<init>(Unknown Source)
at org.pentaho.libformula.ui.editor.LibFormulaEditor.<init>(LibFormulaEditor.java:198)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog$3.widgetSelected(FormulaDialog.java:219)
at org.pentaho.di.ui.core.widget.TableView.editText(TableView.java:1940)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1895)
at org.pentaho.di.ui.core.widget.TableView.edit(TableView.java:1867)
at org.pentaho.di.ui.core.widget.TableView.editSelected(TableView.java:1326)
at org.pentaho.di.ui.core.widget.TableView.access$3000(TableView.java:107)
at org.pentaho.di.ui.core.widget.TableView$26.mouseDown(TableView.java:949)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.trans.steps.formula.FormulaDialog.open(FormulaDialog.java:282)
at org.pentaho.di.ui.spoon.delegates.SpoonStepsDelegate.editStep(SpoonStepsDelegate.java:136)
at org.pentaho.di.ui.spoon.Spoon.editStep(Spoon.java:7835)
at org.pentaho.di.ui.spoon.trans.TransGraph.editStep(TransGraph.java:2749)
at org.pentaho.di.ui.spoon.trans.TransGraph.mouseDoubleClick(TransGraph.java:705)
at org.eclipse.swt.widgets.TypedListener.handleEvent(Unknown Source)
at org.eclipse.swt.widgets.EventTable.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Widget.sendEvent(Unknown Source)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Unknown Source)
at org.eclipse.swt.widgets.Display.readAndDispatch(Unknown Source)
at org.pentaho.di.ui.spoon.Spoon.readAndDispatch(Spoon.java:1221)
at org.pentaho.di.ui.spoon.Spoon.waitForDispose(Spoon.java:7044)
at org.pentaho.di.ui.spoon.Spoon.start(Spoon.java:8304)
at org.pentaho.di.ui.spoon.Spoon.main(Spoon.java:580)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.pentaho.commons.launcher.Launcher.main(Launcher.java:134)
Caused by: java.lang.UnsatisfiedLinkError: Could not load SWT library. Reasons:
no swt-mozilla-gtk-3740 in java.library.path
no swt-mozilla-gtk in java.library.path
/home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk-3740.so: libxpcom.so: cannot open shared object file: No such file or directory
Can't load library: /home/ron/.swt/lib/linux/x86/libswt-mozilla-gtk.so
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
at org.eclipse.swt.internal.Library.loadLibrary(Unknown Source)
... 35 more
When I am checking /home/ron/.swt/lib/linux/ it has the file libswt-mozilla-gtk-3740.so
Kindly help me with the solution
There are several issues that can prevent this functionality to work.
The root cause is that Pentaho uses SWT functionality that requires one of two browsers that installed in the operating system. Refer to this faq (http://www.eclipse.org/swt/faq.php#browserlinux).
In my case, we must choose whether we want to use WebKitGTK (webkit) or Mozilla Firefox (mozilla) by adding a VM option to the java command line :
-Dorg.eclipse.swt.browser.DefaultType=mozilla
In my system, Ubuntu 14.04, the webkit browser causes an error in libsoup, so I need to set this to mozilla. For reference see https://bugs.launchpad.net/ubuntu-gnome/+bug/1163501 for libsoup error in Eclipse which also uses SWT, similar to Pentaho.
Then, we need mozilla firefox to be present in the system, and also the mozilla XUL runner library. Install firefox first :
apt-get install firefox
Install XUL runner 1.9.2 because 2.0.0 or later is said to be incompatible (see http://jira.pentaho.com/browse/PDI-8730).
wget http://ftp.mozilla.org/pub/mozilla.org/xulrunner/nightly/2012/03/2012-03-02-03-32-11-mozilla-1.9.2/xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
tar -xjf xulrunner-1.9.2.28pre.en-US.linux-x86_64.tar.bz2
mv xulrunner /opt/xulrunner-1.9.2
Configure the xulrunner path using this VM option :
-Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2
We also need to configure LD_LIBRARY_PATH and MOZILLA_FIVE_HOME to point to the xulrunner :
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
The final setting in spoon.sh is :
(spoon.sh, about line 13)
MOZILLA_FIVE_HOME=/opt/xulrunner-1.9.2
LD_LIBRARY_PATH=${MOZILLA_FIVE_HOME}:${LD_LIBRARY_PATH}
(spoon.sh, about line 184)
if [ -z "$PENTAHO_DI_JAVA_OPTIONS" ]; then
PENTAHO_DI_JAVA_OPTIONS="-Xmx512m -XX:MaxPermSize=256m -Dorg.eclipse.swt.browser.DefaultType=mozilla -Dorg.eclipse.swt.browser.XULRunnerPath=/opt/xulrunner-1.9.2"
fi
You can also fix this issue by replacing the SWT jar and SWT-GTK jar in Kettle's libswt folder.
Diethard Steiner described the simple process on his blog, using the JAR files from Eclipse:
http://diethardsteiner.github.io/pdi/2015/06/07/Fixing-PDI-GLib-CRITICAL.html
This way you don't have to mess with start script; but keep in mind that the change will be overwritten by an update, too.
Using grails 1.3.7 i have no problem compiling and running my project from my STS.
The error listed below occurs after packaging the WAR and trying to deply it from apache tomcat. This problem has not occured before and i have had success deploying it to apache tomcat in the same fashion before. (Using apache-tomcat-7.0.26).
In regards to the error:
at BootstrapResources.run(BootstrapResources.groovy:23) row 23 points to:
def twitterbootstrapPlugin = applicationContext.pluginManager.getGrailsPlugin('twitter-bootstrap')
row 23 --> twitterbootstrapPluginDir = applicationContext.getResource(twitterbootstrapPlugin.pluginPath).file
ERROR [pool-2-thread-1] (DefaultGrailsPluginManager.java:818) - Error configuring dynamic methods for plugin [resources:1.1.6]: Cannot get property 'pluginPath' on null object java.lang.NullPointerException: Cannot get property 'pluginPath' on null object
at BootstrapResources.run(BootstrapResources.groovy:23)
at org.grails.plugin.resource.module.ModuleDeclarationsFactory$_getModuleDeclarations_closure2.doCall(ModuleDeclarationsFactory.groovy:43)
at org.grails.plugin.resource.module.ModuleDeclarationsFactory.getModuleDeclarations(ModuleDeclarationsFactory.groovy:38)
at org.grails.plugin.resource.module.ModuleDeclarationsFactory.getModuleDeclarations(ModuleDeclarationsFactory.groovy)
at org.grails.plugin.resource.module.ModuleDeclarationsFactory$getModuleDeclarations.call(Unknown Source)
at org.grails.plugin.resource.ResourceProcessor.loadModules(ResourceProcessor.groovy:720)
at org.grails.plugin.resource.ResourceProcessor.this$2$loadModules(ResourceProcessor.groovy)
at org.grails.plugin.resource.ResourceProcessor$this$2$loadModules.callCurrent(Unknown Source)
at org.grails.plugin.resource.ResourceProcessor.reloadAll(ResourceProcessor.groovy:1056)
at org.grails.plugin.resource.ResourceProcessor$reloadAll.call(Unknown Source)
at ResourcesGrailsPlugin$_closure3.doCall(ResourcesGrailsPlugin.groovy:172)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
The latest additions to the project has been spring-security-core, but i cant see how this could be an issue.
Anyone has any ideas?
This is probably not a generic solution for this problem, but for my project this was an issue of my maven packaging not including all the needed plugins for successful deployment.
For some reason having defined my plugins within my BuildConfig.groovy file as follows:
plugins{
build ':whateverplugin:0.1'
compile ':whateverplugin:0.1'
runtime ':whateverplugin:0.1'
test ':whateverplugin:0.1'
}
The plugins were not including in the war packaging when packaging my project issuing the command:
mvn package -Dmaven.skip.test=true
When running a Maven2 job on a slave instance (Master on AIX 5.3; slave on Windows 2008(R2)), I get the following message (complete stack trace pasted in below): "java.lang.ClassNotFoundException: Classloading from system classloader disabled". This happens with the first job after the slave instance is started (it's running as a Windows service). After that, I get a "java.lang.NoClassDefFoundError: Could not initialize class hudson.maven.MavenModuleSetBuild" error.
If I create a freestyle job, and include the maven command as a batch command to run on the slave, it works fine. The Maven2 job appears to locate Maven on the slave machine, but it apparently can't find the maven-plugin (probably due to the classloading error).
I've searched and posted a ticket to the jenkins-ci site, but no luck as of yet. Has anyone run into this problem?
Stacktrace:
Found mavenVersion 2.2.1 from file jar:file:/C:/apache-maven-2.2.1/lib/maven-2.2.1-uber.jar!/META-INF/maven/org.apache.maven/maven-core/pom.properties
Parsing POMs
ERROR: Failed to parse POMs
hudson.util.IOException2: remote file operation failed: c:\jenkins-slave\workspace\AO_SISO_AT-smoketest-CIT1 at hudson.remoting.Channel#7b827b82:10.40.163.105
at hudson.FilePath.act(FilePath.java:752)
at hudson.FilePath.act(FilePath.java:738)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.parsePoms(MavenModuleSetBuild.java:817)
at hudson.maven.MavenModuleSetBuild$RunnerImpl.doRun(MavenModuleSetBuild.java:617)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:429)
at hudson.model.Run.run(Run.java:1374)
at hudson.maven.MavenModuleSetBuild.run(MavenModuleSetBuild.java:467)
at hudson.model.ResourceController.execute(ResourceController.java:88)
at hudson.model.Executor.run(Executor.java:145)
Caused by: java.io.IOException: Remote call on 10.40.163.105 failed
at hudson.remoting.Channel.call(Channel.java:652)
at hudson.FilePath.act(FilePath.java:745)
... 8 more
Caused by: java.lang.ExceptionInInitializerError
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1236)
at hudson.maven.MavenModuleSetBuild$PomParser.invoke(MavenModuleSetBuild.java:1110)
at hudson.FilePath$FileCallableWrapper.call(FilePath.java:1956)
at hudson.remoting.UserRequest.perform(UserRequest.java:118)
at hudson.remoting.UserRequest.perform(UserRequest.java:48)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
at java.util.concurrent.FutureTask.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at hudson.remoting.Engine$1$1.run(Engine.java:60)
at java.lang.Thread.run(Unknown Source)
Caused by: com.thoughtworks.xstream.XStream$InitializationException: Could not instantiate converter : com.thoughtworks.xstream.converters.extended.DurationConverter : null
at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:735)
at com.thoughtworks.xstream.XStream.setupConverters(XStream.java:699)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:445)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:385)
at com.thoughtworks.xstream.XStream.<init>(XStream.java:323)
at hudson.util.XStream2.<init>(XStream2.java:62)
at hudson.model.Run.<clinit>(Run.java:1867)
... 13 more
Caused by: java.lang.reflect.InvocationTargetException
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
at java.lang.reflect.Constructor.newInstance(Unknown Source)
at com.thoughtworks.xstream.XStream.dynamicallyRegisterConverter(XStream.java:728)
... 19 more
Caused by: javax.xml.datatype.DatatypeConfigurationException: Provider org.apache.xerces.jaxp.datatype.DatatypeFactoryImpl not found
at javax.xml.datatype.DatatypeFactory.newInstance(Unknown Source)
at com.thoughtworks.xstream.converters.extended.DurationConverter.<init>(DurationConverter.java:33)
... 24 more
Caused by: java.lang.ClassNotFoundException: Classloading from system classloader disabled
at java.lang.Throwable.<init>(Throwable.java:56)
at java.lang.Throwable.<init>(Throwable.java:80)
at java.lang.ClassNotFoundException.<init>(ClassNotFoundException.java:80)
at hudson.remoting.RemoteClassLoader$ClassLoaderProxy.fetch2(RemoteClassLoader.java:399)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:615)
at hudson.remoting.RemoteInvocationHandler$RPCRequest.perform(RemoteInvocationHandler.java:274)
at hudson.remoting.Request$2.run(Request.java:270)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:432)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:284)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:665)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:690)
at java.lang.Thread.run(Thread.java:799)
I had similar issue. Researched internet but did not get any solution. Finally debugged the jenkins/hudson and resolved this issue.
The root cause of this error is that recent versions of jenkin is shipped with xml parser within jenkins.war file. Looks like if your server already has this jar file, it won't let jenkin application to reload its own version of xml parsers. So to resolve this issue I have removed file xercesImpl-2.9.1.jar from WEB-INF/lib directory of jenkins.war file. After that replaced existing war file and restarted server. And it worked as without any problem.