How can I bundle the JAXB runtime libraries with OpenJDK 11? - java

Background:
In my organization there are a lot of Java based Windows desktop applications. In our proprietary software deployment system the applications don't contain an individual JRE / JDK. Rather a common JRE (so far Oracle 8 Java SE JRE) is deployed to the users machine, which is attached to the individual applications based on environment variables.
We would like to migrate the JRE from Oracle 8 Java SE JRE to OpenJDK 11 without having to modify the applications. From Java 8 to Java 11 various libraries got removed, e. g. JavaFX. Using the Java module system and the jlink tool, I can create my own proprietary JDK enhanced with OpenJFX:
jlink --module-path ..\mods;C:\Temp\javafx-jmods-11.0.2 --add-modules=ALL-MODULE-PATH,java.base,java.compiler,java.datatransfer,java.desktop,... --output C:\Temp\OpenJDK+OpenJFX
Applications, which need JavaFX can use this proprietary JDK without being changed.
When I try to apply the same method to the latest beta of JAXB, I get the following error:
jlink --module-path ..\mods;C:\Temp\jaxb-ri-2.4.0-b180830.0438\jaxb-ri\mod --add-modules=java.xml.bind,java.base,java.compiler,java.datatransfer,java.desktop,java.instrument,... --output C:\Workspace\Java\OpenJDK_11.0.2_JFX_JAXB
Error: automatic module cannot be used with jlink: java.activation from file:///C:/Temp/jaxb-ri-2.4.0-b180830.0438/jaxb-ri/mod/javax.activation-api.jar
As per https://github.com/eclipse-ee4j/jaf/issues/13, "JAXB API uses activation-api as its dependency and is forced to use it as an automatic module or from classpath because of missing a module-info.java descriptor file."
Furtheron as per Is it possible to use jlink on JDK 11 to make a runtime including the Java SE EE modules that were removed? I can bundle the module java.xml.bind using jlink from Java 10, which still contained it. Indeed jlink succeeds, if I add two modules from OpenJDK 10.0.2 to the module path:
jlink --module-path ..\mods;C:\Temp\jdk-10.0.2\jmods\java.xml.bind.jmod;C:\Temp\jdk-10.0.2\jmods\java.activation.jmod --add-modules=java.xml.bind, ...
But when I run my application with the generated JDK, I get errors like this:
!ENTRY org.eclipse.osgi 4 0 2019-02-15 15:58:58.642
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
... 22 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 24 more
Or this:
Feb. 15, 2019 2:49:03 NACHM. com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector <clinit>
SEVERE: null
java.security.PrivilegedActionException: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector.<clinit>(Injector.java:182)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.AccessorInjector.prepare(AccessorInjector.java:66)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.OptimizedAccessorFactory.get(OptimizedAccessorFactory.java:164)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.Accessor$FieldReflection.optimize(Accessor.java:270)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayProperty.<init>(ArrayProperty.java:53)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayERProperty.<init>(ArrayERProperty.java:73)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayElementProperty.<init>(ArrayElementProperty.java:85)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.ArrayElementNodeProperty.<init>(ArrayElementNodeProperty.java:47)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.property.PropertyFactory.create(PropertyFactory.java:113)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.ClassBeanInfoImpl.<init>(ClassBeanInfoImpl.java:166)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.getOrCreate(JAXBContextImpl.java:499)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:316)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl.<init>(JAXBContextImpl.java:124)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.JAXBContextImpl$JAXBContextBuilder.build(JAXBContextImpl.java:1141)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.ContextFactory.createContext(ContextFactory.java:150)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:282)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:271)
at java.xml.bind#10.0.2/javax.xml.bind.ContextFinder.find(ContextFinder.java:406)
at java.xml.bind#10.0.2/javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:706)
at java.xml.bind#10.0.2/javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:647)
at com.xxx.build.automation.utils.internal.CategoryFileHandler.unMarshalFile(CategoryFileHandler.java:17)
at com.xxx.build.automation.utils.common.GetComponentName.doExecuteInternal(GetComponentName.java:89)
at com.xxx.build.automation.utils.common.GetComponentName.execute(GetComponentName.java:72)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:288)
at jdk.internal.reflect.GeneratedMethodAccessor6.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
at org.apache.tools.ant.Task.perform(Task.java:348)
at org.apache.tools.ant.Target.execute(Target.java:357)
at org.apache.tools.ant.Target.performTasks(Target.java:385)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1337)
at org.apache.tools.ant.Project.executeTarget(Project.java:1306)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1189)
at org.apache.tools.ant.Main.runBuild(Main.java:758)
at org.apache.tools.ant.Main.startAnt(Main.java:217)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:257)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:104)
Caused by: java.lang.NoSuchMethodException: sun.misc.Unsafe.defineClass(java.lang.String, [B, int, int, java.lang.ClassLoader, java.security.ProtectionDomain)
at java.base/java.lang.Class.getMethod(Class.java:2109)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:186)
at java.xml.bind#10.0.2/com.sun.xml.internal.bind.v2.runtime.reflect.opt.Injector$3.run(Injector.java:182)
... 48 more
Question:
Is there any possibility, how I can bundle the JAXB libraries with OpenJDK 11?
Hint:
I am aware on approaches how to tackle the removed JAXB at build time for a classic Java application build: How to resolve java.lang.NoClassDefFoundError: javax/xml/bind/JAXBException in Java 9 or Include JAXB using Maven. But if I don't want to touch the deployed application binaries, build time solution doesn't help me in this scenario.

Try to include these two dependencies:
implementation group: 'javax.xml.bind', name: 'jaxb-api', version: '2.3.0'
implementation group: 'org.glassfish.jaxb', name: 'jaxb-runtime'

If you are using javax API modules, it is usually not possible to upgrade from jdk8 without modifying you application. Some implementations like com.sun packages where physically removed since jdk9 and you have to add them as dependency.
You are also running into the java.lang.NoSuchMethodException so the current available implementation is not compatible anymore with the javax API from jdk10

My organization finally gave in to modify the applications at compile time. It is not the solution I was searching for, but at least it works for us.

JAXB has been removed from JDK starting with version 11, you would need to add it as you add all other dependencies.
Example for maven:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-core</artifactId>
<version>${jaxb.api.version}</version>
</dependency>
<dependency>
<groupId>com.sun.xml.bind</groupId>
<artifactId>jaxb-impl</artifactId>
<version>${jaxb.api.version}</version>
</dependency>

Related

Getting NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7

I am getting the following error when I start my Spring Boot application.
java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.reflection.ReflectionCache
at org.codehaus.groovy.runtime.dgmimpl.NumberNumberMetaMethod.<clinit>(NumberNumberMetaMethod.java:33) ~[groovy-2.5.8.jar:2.5.8]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) ~[na:na]
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) ~[na:na]
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstanceWithCaller(Constructor.java:500) ~[na:na]
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:481) ~[na:na]
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.createMetaMethodFromClass(MetaClassRegistryImpl.java:258) ~[groovy-2.5.8.jar:2.5.8]
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:111) ~[groovy-2.5.8.jar:2.5.8]
at org.codehaus.groovy.runtime.metaclass.MetaClassRegistryImpl.<init>(MetaClassRegistryImpl.java:86) ~[groovy-2.5.8.jar:2.5.8]
at groovy.lang.GroovySystem.<clinit>(GroovySystem.java:36) ~[groovy-2.5.8.jar:2.5.8]
at org.springframework.beans.factory.groovy.GroovyBeanDefinitionReader.<init>(GroovyBeanDefinitionReader.java:150) ~[spring-beans-5.2.2.RELEASE.jar:5.2.2.RELEASE]
at org.springframework.boot.BeanDefinitionLoader.<init>(BeanDefinitionLoader.java:85) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.createBeanDefinitionLoader(SpringApplication.java:738) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.load(SpringApplication.java:681) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.prepareContext(SpringApplication.java:392) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:314) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1215) ~[spring-boot-2.2.2.RELEASE.jar:2.2.2.RELEASE]
at pizzainthecloud.pizzaplace.Application.main(Application.java:23) ~[main/:na]
After much searching, I found several instances of this including java.lang.NoClassDefFoundError: Could not initialize class org.codehaus.groovy.vmplugin.v7.Java7, but most are older posts on older versions of gradle and groovy or they are related to android.
Here is my version info:
$ gradle -version
------------------------------------------------------------
Gradle 6.6.1
------------------------------------------------------------
Build time: 2020-08-25 16:29:12 UTC
Revision: f2d1fb54a951d8b11d25748e4711bec8d128d7e3
Kotlin: 1.3.72
Groovy: 2.5.12
Ant: Apache Ant(TM) version 1.10.8 compiled on May 10 2020
JVM: 14.0.2 (Oracle Corporation 14.0.2+12-46)
OS: Linux 5.4.0-42-generic amd64
I am not doing any groovy apart from my unit tests that are entirely groovy/spock and I'm using gradle for my build engine.
Following directions I found, I went ahead and changed my gradle-wrapper.properties file to
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6-bin.zip
it was 6.5-bin.
This project was running fine on my old computer with Java 8. I moved it to my new workstation and am trying to move to open JDK 14, and that is when the new issue started.
Wondering where to go from here.
From https://github.com/gradle/gradle/issues/10248
Seems like GROOVY-9211 won't be backported to 2.5.x. So it seems that Gradle will need to upgrade to Groovy 3.x once it's out in order to support JDK 14.
You will need to use JDK 13 until Gradle uses Groovy 3.x.
I had the same issue using maven 3.2. and JDK 1.8. Upgrading to JDK 11 solved it.

java.lang.NoClassDefFoundError with REST-assured 3.0.0 and Java 11 (not observed with Java 8)

Here's what my build.gradle file looks like:
plugins {
id 'java'
id "com.github.lkishalmi.gatling" version "0.7.0"
id 'application'
}
sourceCompatibility = 1.8
repositories {
mavenCentral()
}
dependencies {
compile group: 'io.rest-assured', name: 'rest-assured', version: '3.0.0'
}
task runTests(type: Test) {
useTestNG() {
useDefaultListeners = true
suites 'src/test/testng.xml'
}
}
Here's what my testng.xml looks like:
<!DOCTYPE suite SYSTEM "http://beust.com/testng/testng-1.0.dtd" >
<suite name="my-test-suite">
<test name="myTest">
<classes>
<class name="tests.SomeTests">
<methods>
<include name="testVerifySomething"/>
</methods>
</class>
</classes>
</test>
</suite>
The java.lang.NoClassDefFoundError error originates from the SomeTests class at the line where there is a call to a static method from another class SomeUtils from another package utils.
Here's the full trace:
java.lang.NoClassDefFoundError: javax.xml.bind.JAXBException
at io.restassured.config.ObjectMapperConfig.<init>(ObjectMapperConfig.java:49)
at io.restassured.config.RestAssuredConfig.<init>(RestAssuredConfig.java:41)
at io.restassured.RestAssured.<clinit>(RestAssured.java:420)
at utils.SomeUtils.createUser(SomeUtils.java:13)
at tests.SomeTests.createUser(SomeTests.java:63)
at tests.SomeTests.testCreateUsers(SomeTests.java:47)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:124)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:583)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:719)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:989)
at org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.privateRun(TestRunner.java:648)
at org.testng.TestRunner.run(TestRunner.java:505)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:455)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:450)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:415)
at org.testng.SuiteRunner.run(SuiteRunner.java:364)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:84)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1208)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1137)
at org.testng.TestNG.runSuites(TestNG.java:1049)
at org.testng.TestNG.run(TestNG.java:1017)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.runTests(TestNGTestClassProcessor.java:139)
at org.gradle.api.internal.tasks.testing.testng.TestNGTestClassProcessor.stop(TestNGTestClassProcessor.java:89)
at org.gradle.api.internal.tasks.testing.SuiteTestClassProcessor.stop(SuiteTestClassProcessor.java:61)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.dispatch.ContextClassLoaderDispatch.dispatch(ContextClassLoaderDispatch.java:32)
at org.gradle.internal.dispatch.ProxyDispatchAdapter$DispatchingInvocationHandler.invoke(ProxyDispatchAdapter.java:93)
at com.sun.proxy.$Proxy2.stop(Unknown Source)
at org.gradle.api.internal.tasks.testing.worker.TestWorker.stop(TestWorker.java:131)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:35)
at org.gradle.internal.dispatch.ReflectionDispatch.dispatch(ReflectionDispatch.java:24)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:155)
at org.gradle.internal.remote.internal.hub.MessageHubBackedObjectConnection$DispatchWrapper.dispatch(MessageHubBackedObjectConnection.java:137)
at org.gradle.internal.remote.internal.hub.MessageHub$Handler.run(MessageHub.java:404)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:63)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:46)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:55)
at java.base/java.lang.Thread.run(Thread.java:825)
Caused by: java.lang.ClassNotFoundException: javax.xml.bind.JAXBException
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:768)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:1052)
... 56 more
The directory structure looks like this:
build.gradle
src
--test
----java
------tests
SomeTests
------utils
SomeUtils
What I've tried so far:
Add runtime files('src/test/java/utils') inside the dependencies section of my build.gradle.
Add compile files('src/test/java/utils') inside the dependencies section of my build.gradle.
Add both 1 & 2 inside the dependencies section of my build.gradle.
EDIT: After some trial and errors, it seems the Java version is the cause here since the issue is seen with Java 11 and not with Java 8. I verified this behaviour on multiple machines just to ensure there's nothing specific on my machine.
After looking at the complete error trace, it seems the error is originating from the REST-assured library's code. And upgrading io.rest-assured dependency from 3.0.0 to 4.0.0 has helped overcome the issue.
You have not specified exactly which class is not found!
Complete stackstrace will help.
Nevertheless, as you mentioned it worked on jdk8 which means there is high probability you are using/depending on some class which is removed after jdk9 like jaxb, javax etc.
If that is the case, you have couple of options here:
run your app/test with following jvmopts setting --add-modules=java.xml.bind,java.activation or create .jvmopts file with above line at root directory of your project
add explicit dependency in you build based on which class is missing
you can try changing the version of the rest assured dependency . from 3.0.0 to 4.1.2
<dependency>
<groupId>io.rest-assured</groupId>
<artifactId>rest-assured</artifactId>
<version>4.1.2</version>
</dependency>
it will help
It is because the JAXB library (Java Architecture for XML Binding) is missing in the classpath. JAXB is included in Java SE 10 or older, but it is removed from Java SE from Java 11 or newer –moved to Java EE under Jakarta EE project.
That means if you encounter JAXBException error, it’s very much likely that you are using Java 11 or newer for your project. So to fix this error, you have to options:
Use older Java versions like JDK 8, 9, or 10 which still include the JAXB library by default. Or:
Specify an additional dependency in your project’s pom.xml file as follows:
<dependency>
<groupId>javax.xml.bind</groupId>
<artifactId>jaxb-api</artifactId>
<version>2.3.0</version>
</dependency>
In case you don’t use Maven
https://mvnrepository.com/artifact/javax.xml.bind/jaxb-api/2.3.0
The "root" of your code files ie test files in this case should be src/test/java. So, you could try adding compile files('src/test/java') to yourtestClasspath` variable.

Logback upgrade from 1.1.11 to 1.3.0-alpha4 in Spring boot-1.5.8 application

Spring boot 1.5.8 by default providing logback-1.1.11 version.
I am trying to upgrade the logback version from 1.1.11 to 1.3.0-alpha4 and added the below two properties in pom.
<slf4j.version>1.8.0-beta4</slf4j.version>
<logback.version>1.3.0-alpha4</logback.version>
Getting the below exception when i try to run the application.
Exception in thread "main" java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
at org.springframework.boot.logging.logback.LogbackLoggingSystem.getLoggerContext(LogbackLoggingSystem.java:273)
at org.springframework.boot.logging.logback.LogbackLoggingSystem.beforeInitialize(LogbackLoggingSystem.java:98)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationStartingEvent(LoggingApplicationListener.java:230)
at org.springframework.boot.logging.LoggingApplicationListener.onApplicationEvent(LoggingApplicationListener.java:209)
at org.springframework.context.event.SimpleApplicationEventMulticaster.doInvokeListener(SimpleApplicationEventMulticaster.java:172)
at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:165)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:139)
at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:122)
at org.springframework.boot.context.event.EventPublishingRunListener.starting(EventPublishingRunListener.java:69)
at org.springframework.boot.SpringApplicationRunListeners.starting(SpringApplicationRunListeners.java:48)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:292)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1118)
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1107)
at com.anthem.acmp.service.UMIDALServiceApplication.main(UMIDALServiceApplication.java:25)
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 14 more
I have found that the logback-classic-1.1.11.jar contains a package org.slf4j.impl which has the class StaticLoggerBinder, which is not available in logback-classic-1.3.0-alpha4 and causing this issue.
Logback 1.3 and SLF4J 1.8 contain breaking API changes when compared with their 1.2 and 1.7 versions respectively. At the time of writing, Spring Boot is not compatible with the new API. There's an issue that is tracking support of the new versions. It won't be tackled until the projects have stabilised and are no longer in alpha or beta.
I was able to use logback 1.3.0-alpha4 when I copied the StaticLoggerBinder from version 1.2 into my project. (Create a new StaticLoggerBinder.java in a new package org.slf4j.impl and paste the whole file.)

Running e(fx)clipse on OpenJDK 11. WAS: Running Eclipse on OpenJDK 11

I had Eclipse Oxygen running on Oracle's JDK 8 and that worked fine. Today I've updated my Eclipse install to the latest version, and it still worked fine.
Then I installed OpenJDK 11 and JavaFX 11, and uninstalled Oracle's JDK I previously had. Now Eclipse won't start. I paste the last session recorded in the .log file below.
Does Eclipse 2018-12 run on Open JDK 11? How can I do that? The Eclipse web site does not seem to mention Open JDK 11 at all.
Update: looking more closely at the .log file it seems Eclipse is missing JavaFX. I installed JavaFX 11, including creating the environment variable PATH_TO_FX per JavaFX installation instructions. Any ideas of what may be wrong?
!SESSION 2019-03-14 11:20:13.073 -----------------------------------------------
eclipse.buildId=4.10.0.I20181206-0815
java.version=11.0.2
java.vendor=Oracle Corporation
BootLoader constants: OS=win32, ARCH=x86_64, WS=win32, NL=en_US
Framework arguments: -product org.eclipse.epp.package.jee.product
Command-line arguments: -os win32 -ws win32 -arch x86_64 -product org.eclipse.epp.package.jee.product
!ENTRY org.eclipse.e4.ui.workbench 4 0 2019-03-14 11:20:20.601
!MESSAGE Unable to create class 'org.eclipse.e4.ui.internal.workbench.ResourceHandler' from bundle '1585'
!STACK 0
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:422)
at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:333)
at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:193)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.createFromBundle(ReflectionContributionFactory.java:108)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.doCreate(ReflectionContributionFactory.java:77)
at org.eclipse.e4.ui.internal.workbench.ReflectionContributionFactory.create(ReflectionContributionFactory.java:59)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:382)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:260)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:586)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
Caused by: java.lang.NoClassDefFoundError: jdk/internal/reflect/ConstructorAccessorImpl
at java.base/jdk.internal.misc.Unsafe.defineClass0(Native Method)
at java.base/jdk.internal.misc.Unsafe.defineClass(Unsafe.java:1192)
at java.base/jdk.internal.reflect.ClassDefiner.defineClass(ClassDefiner.java:63)
at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:400)
at java.base/jdk.internal.reflect.MethodAccessorGenerator$1.run(MethodAccessorGenerator.java:394)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/jdk.internal.reflect.MethodAccessorGenerator.generate(MethodAccessorGenerator.java:393)
at java.base/jdk.internal.reflect.MethodAccessorGenerator.generateConstructor(MethodAccessorGenerator.java:92)
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:55)
at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:490)
at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1022)
at java.base/java.lang.reflect.Proxy.newProxyInstance(Proxy.java:1008)
at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:306)
at java.base/sun.reflect.annotation.AnnotationParser$1.run(AnnotationParser.java:304)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at java.base/sun.reflect.annotation.AnnotationParser.annotationForMap(AnnotationParser.java:304)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotation2(AnnotationParser.java:294)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:121)
at java.base/sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:73)
at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1175)
at java.base/java.lang.reflect.Field.declaredAnnotations(Field.java:1173)
at java.base/java.lang.reflect.Field.getAnnotation(Field.java:1142)
at java.base/java.lang.reflect.AnnotatedElement.isAnnotationPresent(AnnotatedElement.java:274)
at java.base/java.lang.reflect.AccessibleObject.isAnnotationPresent(AccessibleObject.java:517)
at org.eclipse.e4.core.internal.di.InjectorImpl.isAnnotationPresent(InjectorImpl.java:1039)
at org.eclipse.e4.core.internal.di.InjectorImpl.processFields(InjectorImpl.java:718)
at org.eclipse.e4.core.internal.di.InjectorImpl.processClass(InjectorImpl.java:677)
at org.eclipse.e4.core.internal.di.InjectorImpl.processClassHierarchy(InjectorImpl.java:658)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalInject(InjectorImpl.java:115)
at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:411)
... 24 more
Caused by: java.lang.ClassNotFoundException: Could not find class 'jdk.internal.reflect.ConstructorAccessorImpl'
at org.eclipse.fx.osgi.fxloader.FXClassLoader.postFindClass(FXClassLoader.java:117)
at org.eclipse.osgi.internal.loader.BundleLoader.searchHooks(BundleLoader.java:527)
at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:490)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:422)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:414)
at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:153)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
... 55 more
Caused by: java.lang.reflect.InvocationTargetException
at java.base/jdk.internal.reflect.GeneratedMethodAccessor7.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.createModuleLoader(FXClassLoader.java:177)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.findClassJavaFX11(FXClassLoader.java:160)
at org.eclipse.fx.osgi.fxloader.FXClassLoader.postFindClass(FXClassLoader.java:115)
... 61 more
Caused by: java.lang.IllegalArgumentException: Module javafx.base not known to this layer
at java.base/java.lang.ModuleLayer.findLoader(ModuleLayer.java:885)
... 67 more
!ENTRY org.eclipse.epp.logging.aeri.ide 2 0 2019-03-14 11:20:20.751
!MESSAGE Could not resolve module: org.eclipse.epp.logging.aeri.ide [1639]
Unresolved requirement: Import-Package: org.apache.lucene.document; version="[7.1.0,8.0.0)"
!ENTRY org.eclipse.osgi 4 0 2019-03-14 11:20:20.770
!MESSAGE Application error
!STACK 1
java.lang.NullPointerException
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.loadApplicationModel(E4Application.java:385)
at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:260)
at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:586)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:339)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:563)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:151)
at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:155)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:203)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:137)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:107)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:400)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:255)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:659)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:595)
at org.eclipse.equinox.launcher.Main.run(Main.java:1501)
By looking more closely at the log file I suspected the e(fx)clipse plugin was causing the problem:
at org.eclipse.fx.osgi.fxloader.FXClassLoader.createModuleLoader(FXClassLoader.java:177)
And indeed, I found this thread on the e(fx)clipse forum with a similar report, and an answer by one of the developers that this was a bug on version 3.3.0 and that they would try to release 3.5.0 as soon as possible which had a fix. However, it seems that has not happened as of today.
So I reverted to JDK 8, uninstalled the e(fx)clipse, and now my Eclipse install works with OpenJDK 11.

Gwt 2.8-rc1 super dev mode is not working on IntelliJ IDEA 2016.2.5

My project is starting correctly with GWT 2.7 and 2.8-beta1 in super dev mode
Unfortunately since 2.8-rc1 release it is not starting.
Looks like GWT project dependencies are not configured correctly.
IDE: IntelliJ IDEA 2016.2.5
"C:\Program Files\Java\jdk1.8.0_102\jre\bin\java" -Xmx2048m -XX:MaxPermSize=1024m -Djava.naming.factory.initial=org.eclipse.jetty.jndi.InitialContextFactory -Didea.launcher.port=7536 "-Didea.launcher.bin.path=C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2.4\bin" -Dfile.encoding=UTF-8 -classpath "C:\<REPO>\com\google\gwt\gwt-codeserver\2.8.0-rc1\gwt-codeserver-2.8.0-rc1.jar;C:\<REPO>\com\google\gwt\gwt-dev\2.8.0-rc1\gwt-dev-2.8.0-rc1.jar;xxx\xxx\src\main\java;xxx\xxx\src\main\resources;xxx\xxx\target\generated-sources\gwt;C:\<REPO>\com\google\jsinterop\jsinterop-annotations\1.0.0\jsinterop-annotations-1.0.0-sources.jar;xxx\domain-model\src\main\java;xxx\domain-model\src\main\resources;xxx\sso-security-lib\src\main\java;xxx\sso-security-lib\src\main\resources;xxx\seleniumtests\src\main\java;xxx\smartgwt-data-integration\src\main\java;xxx\generator\src\main\java;xxx\generator\src\main\resources;xxx\gwt-ui-utils\src\main\java;xxx\gwt-ui-utils\src\main\resources;xxx\gwt-ui-utils\target\generated-sources\gwt;C:\Program Files\Java\jdk1.8.0_102\jre\lib\charsets.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\deploy.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\access-bridge-64.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\cldrdata.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\dnsns.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\jaccess.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\jfxrt.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\localedata.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\nashorn.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\sunec.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\sunjce_provider.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\sunmscapi.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\sunpkcs11.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\zipfs.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\javaws.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\jce.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\jfr.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\jfxswt.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\jsse.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\management-agent.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\plugin.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\resources.jar;C:\Program Files\Java\jdk1.8.0_102\jre\lib\rt.jar;c:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\bcprov-ext-jdk15on-154.jar;c:\Program Files\Java\jdk1.8.0_102\jre\lib\ext\bcprov-jdk15on-154.jar;xxx\xxx\target\test-classes;xxx\xxx\target\xxx\WEB-INF\classes;C:\<REPO>\org\springframework\spring-context\4.2.4.RELEASE\spring-context-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-aop\4.2.4.RELEASE\spring-aop-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-beans\4.2.4.RELEASE\spring-beans-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-core\4.2.4.RELEASE\spring-core-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-expression\4.2.4.RELEASE\spring-expression-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-webmvc\4.2.4.RELEASE\spring-webmvc-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-web\4.2.4.RELEASE\spring-web-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-aspects\4.2.4.RELEASE\spring-aspects-4.2.4.RELEASE.jar;C:\<REPO>\org\aspectj\aspectjweaver\1.8.7\aspectjweaver-1.8.7.jar;C:\<REPO>\com\google\gwt\gwt-servlet\2.8.0-rc1\gwt-servlet-2.8.0-rc1.jar;C:\<REPO>\com\google\gwt\gwt-user\2.8.0-rc1\gwt-user-2.8.0-rc1.jar;C:\<REPO>\com\google\jsinterop\jsinterop-annotations\1.0.0\jsinterop-annotations-1.0.0.jar;C:\<REPO>\javax\servlet\javax.servlet-api\3.1.0\javax.servlet-api-3.1.0.jar;C:\<REPO>\org\w3c\css\sac\1.3\sac-1.3.jar;C:\<REPO>\org\eclipse\jetty\jetty-plus\8.1.19.v20160209\jetty-plus-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\orbit\javax.transaction\1.1.1.v201105210645\javax.transaction-1.1.1.v201105210645.jar;C:\<REPO>\org\eclipse\jetty\jetty-webapp\8.1.19.v20160209\jetty-webapp-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-xml\8.1.19.v20160209\jetty-xml-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-util\8.1.19.v20160209\jetty-util-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-servlet\8.1.19.v20160209\jetty-servlet-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-security\8.1.19.v20160209\jetty-security-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-jndi\8.1.19.v20160209\jetty-jndi-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-server\8.1.19.v20160209\jetty-server-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\orbit\javax.servlet\3.0.0.v201112011016\javax.servlet-3.0.0.v201112011016.jar;C:\<REPO>\org\eclipse\jetty\jetty-continuation\8.1.19.v20160209\jetty-continuation-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-http\8.1.19.v20160209\jetty-http-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\jetty-io\8.1.19.v20160209\jetty-io-8.1.19.v20160209.jar;C:\<REPO>\org\eclipse\jetty\orbit\javax.mail.glassfish\1.4.1.v201005082020\javax.mail.glassfish-1.4.1.v201005082020.jar;C:\<REPO>\org\eclipse\jetty\orbit\javax.activation\1.1.0.v201105071233\javax.activation-1.1.0.v201105071233.jar;C:\<REPO>\commons-dbcp\commons-dbcp\1.4\commons-dbcp-1.4.jar;C:\<REPO>\commons-pool\commons-pool\1.5.4\commons-pool-1.5.4.jar;C:\<REPO>\junit\junit\4.9\junit-4.9.jar;C:\<REPO>\org\hamcrest\hamcrest-core\1.1\hamcrest-core-1.1.jar;C:\<REPO>\org\mockito\mockito-all\1.9.5\mockito-all-1.9.5.jar;C:\<REPO>\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA.jar;C:\<REPO>\javax\validation\validation-api\1.0.0.GA\validation-api-1.0.0.GA-sources.jar;C:\<REPO>\org\springframework\security\spring-security-core\4.0.3.RELEASE\spring-security-core-4.0.3.RELEASE.jar;C:\<REPO>\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;C:\<REPO>\org\springframework\security\spring-security-config\4.0.3.RELEASE\spring-security-config-4.0.3.RELEASE.jar;C:\<REPO>\org\springframework\security\spring-security-web\4.0.3.RELEASE\spring-security-web-4.0.3.RELEASE.jar;C:\<REPO>\javax\servlet\jstl\1.2\jstl-1.2.jar;C:\<REPO>\com\xxx\commons\authentication\xxx-authentication\1.0.5\xxx-authentication-1.0.5.jar;C:\<REPO>\org\samba\jcifs\jcifs\1.3.12\jcifs-1.3.12.jar;C:\<REPO>\com\ioplex\jespa-licensed\1.1.13-INTERNAL-1\jespa-licensed-1.1.13-INTERNAL-1.jar;C:\<REPO>\org\springframework\security\spring-security-ldap\4.0.3.RELEASE\spring-security-ldap-4.0.3.RELEASE.jar;C:\<REPO>\org\springframework\spring-tx\4.2.2.RELEASE\spring-tx-4.2.2.RELEASE.jar;C:\<REPO>\org\springframework\ldap\spring-ldap-core\2.1.0.RELEASE\spring-ldap-core-2.1.0.RELEASE.jar;C:\<REPO>\org\slf4j\slf4j-api\1.7.12\slf4j-api-1.7.12.jar;C:\<REPO>\com\google\guava\guava-gwt\19.0\guava-gwt-19.0.jar;C:\<REPO>\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;C:\<REPO>\com\google\errorprone\error_prone_annotations\2.0.2\error_prone_annotations-2.0.2.jar;C:\<REPO>\com\google\j2objc\j2objc-annotations\0.1\j2objc-annotations-0.1.jar;C:\<REPO>\com\google\guava\guava\19.0\guava-19.0.jar;xxx\domain-model\target\classes;C:\<REPO>\com\googlecode\mvp4g\mvp4g\1.3.1\mvp4g-1.3.1.jar;C:\<REPO>\com\google\gwt\inject\gin\1.5.0\gin-1.5.0.jar;C:\<REPO>\com\google\inject\guice\3.0-rc2\guice-3.0-rc2.jar;C:\<REPO>\javax\inject\javax.inject\1\javax.inject-1.jar;C:\<REPO>\com\google\inject\extensions\guice-assistedinject\3.0-rc2\guice-assistedinject-3.0-rc2.jar;xxx\sso-security-lib\target\classes;C:\<REPO>\org\springframework\security\spring-security-taglibs\4.0.3.RELEASE\spring-security-taglibs-4.0.3.RELEASE.jar;C:\<REPO>\org\springframework\security\spring-security-acl\4.0.3.RELEASE\spring-security-acl-4.0.3.RELEASE.jar;C:\<REPO>\oracle\ojdbc14\10.2.0.4.0\ojdbc14-10.2.0.4.0.jar;C:\<REPO>\org\springframework\spring-test\4.2.4.RELEASE\spring-test-4.2.4.RELEASE.jar;xxx\seleniumtests\target\classes;xxx\smartgwt-data-integration\target\classes;C:\<REPO>\com\smartgwt\smartgwt\6.0p\smartgwt-6.0p.jar;C:\<REPO>\commons-lang\commons-lang\2.5\commons-lang-2.5.jar;C:\<REPO>\commons-collections\commons-collections\3.2.1\commons-collections-3.2.1.jar;C:\<REPO>\net\sourceforge\collections\collections-generic\4.01\collections-generic-4.01.jar;C:\<REPO>\commons-beanutils\commons-beanutils\1.8.0\commons-beanutils-1.8.0.jar;C:\<REPO>\commons-logging\commons-logging\1.1.1\commons-logging-1.1.1.jar;C:\<REPO>\org\hibernate\hibernate-commons-annotations\3.2.0.Final\hibernate-commons-annotations-3.2.0.Final.jar;C:\<REPO>\org\hibernate\hibernate-core\3.6.0.Final\hibernate-core-3.6.0.Final.jar;C:\<REPO>\antlr\antlr\2.7.6\antlr-2.7.6.jar;C:\<REPO>\dom4j\dom4j\1.6.1\dom4j-1.6.1.jar;C:\<REPO>\javax\transaction\jta\1.1\jta-1.1.jar;C:\<REPO>\org\hibernate\hibernate-ehcache\3.6.1.Final\hibernate-ehcache-3.6.1.Final.jar;C:\<REPO>\net\sf\ehcache\ehcache\1.5.0\ehcache-1.5.0.jar;C:\<REPO>\backport-util-concurrent\backport-util-concurrent\3.1\backport-util-concurrent-3.1.jar;C:\<REPO>\net\sf\jsr107cache\jsr107cache\1.0\jsr107cache-1.0.jar;C:\<REPO>\org\hibernate\hibernate-entitymanager\3.6.0.Final\hibernate-entitymanager-3.6.0.Final.jar;C:\<REPO>\javassist\javassist\3.12.0.GA\javassist-3.12.0.GA.jar;C:\<REPO>\org\hibernate\javax\persistence\hibernate-jpa-2.0-api\1.0.0.Final\hibernate-jpa-2.0-api-1.0.0.Final.jar;C:\<REPO>\org\hibernate\hibernate-validator\4.1.0.Final\hibernate-validator-4.1.0.Final.jar;C:\<REPO>\org\codehaus\jackson\jackson-core-asl\1.8.0\jackson-core-asl-1.8.0.jar;C:\<REPO>\org\codehaus\jackson\jackson-mapper-asl\1.8.0\jackson-mapper-asl-1.8.0.jar;C:\<REPO>\org\springframework\spring-orm\4.2.4.RELEASE\spring-orm-4.2.4.RELEASE.jar;C:\<REPO>\org\springframework\spring-jdbc\4.2.4.RELEASE\spring-jdbc-4.2.4.RELEASE.jar;C:\<REPO>\org\slf4j\slf4j-log4j12\1.6.1\slf4j-log4j12-1.6.1.jar;C:\<REPO>\log4j\log4j\1.2.16\log4j-1.2.16.jar;C:\<REPO>\log4j\apache-log4j-extras\1.2.17\apache-log4j-extras-1.2.17.jar;C:\<REPO>\cglib\cglib-nodep\2.2\cglib-nodep-2.2.jar;C:\<REPO>\org\hsqldb\hsqldb\2.3.2\hsqldb-2.3.2.jar;C:\<REPO>\com\thoughtworks\xstream\xstream\1.4.3\xstream-1.4.3.jar;C:\<REPO>\xmlpull\xmlpull\1.1.3.1\xmlpull-1.1.3.1.jar;C:\<REPO>\xpp3\xpp3_min\1.1.4c\xpp3_min-1.1.4c.jar;xxx\generator\target\classes;C:\<REPO>\org\aspectj\aspectjrt\1.6.12\aspectjrt-1.6.12.jar;C:\<REPO>\com\informatica\powercenter\sdk\jmf\9.1.0\jmf-9.1.0.jar;C:\<REPO>\com\sun\xml\bind\jaxb-impl\1.0.6\jaxb-impl-1.0.6.jar;C:\<REPO>\javax\xml\bind\jaxb-api\1.0\jaxb-api-1.0.jar;C:\<REPO>\com\sun\xml\bind\jaxb-libs\1.0.6\jaxb-libs-1.0.6.jar;C:\<REPO>\com\sun\msv\datatype\xsd\xsdlib\20060615\xsdlib-20060615.jar;C:\<REPO>\isorelax\isorelax\20030108\isorelax-20030108.jar;C:\<REPO>\relaxngDatatype\relaxngDatatype\20020414\relaxngDatatype-20020414.jar;C:\<REPO>\com\sun\xml\bind\jaxb-xjc\1.0.6\jaxb-xjc-1.0.6.jar;C:\<REPO>\com\informatica\powercenter\sdk\jmf-jaxb\9.1.0\jmf-jaxb-9.1.0.jar;C:\<REPO>\com\informatica\powercenter\sdk\pmserversdk\9.1.0\pmserversdk-9.1.0.jar;C:\<REPO>\org\apache\poi\poi\3.9\poi-3.9.jar;C:\<REPO>\commons-codec\commons-codec\1.5\commons-codec-1.5.jar;C:\<REPO>\org\apache\poi\poi-contrib\3.1-FINAL\poi-contrib-3.1-FINAL.jar;C:\<REPO>\org\apache\poi\poi-ooxml\3.9\poi-ooxml-3.9.jar;C:\<REPO>\org\apache\poi\poi-ooxml-schemas\3.9\poi-ooxml-schemas-3.9.jar;C:\<REPO>\org\apache\xmlbeans\xmlbeans\2.3.0\xmlbeans-2.3.0.jar;C:\<REPO>\stax\stax-api\1.0.1\stax-api-1.0.1.jar;C:\<REPO>\net\sf\saxon\saxon-dom\8.7\saxon-dom-8.7.jar;xxx\gwt-ui-utils\target\classes;C:\<REPO>\net\customware\gwt\dispatch\gwt-dispatch\1.2.0\gwt-dispatch-1.2.0.jar;C:\<REPO>\net\sf\saxon\saxon\8.7\saxon-8.7.jar;C:\<REPO>\commons-fileupload\commons-fileupload\1.2.2\commons-fileupload-1.2.2.jar;C:\<REPO>\commons-io\commons-io\2.4\commons-io-2.4.jar;C:\<REPO>\javax\validation\validation-api\1.1.0.Final\validation-api-1.1.0.Final.jar;C:\<REPO>\org\ow2\asm\asm\5.0.3\asm-5.0.3.jar;C:\<REPO>\org\ow2\asm\asm-util\5.0.3\asm-util-5.0.3.jar;C:\<REPO>\org\ow2\asm\asm-commons\5.0.3\asm-commons-5.0.3.jar;C:\<REPO>\org\ow2\asm\asm-tree\5.0.3\asm-tree-5.0.3.jar;C:\Program Files (x86)\JetBrains\IntelliJ IDEA 2016.2.4\lib\idea_rt.jar" com.intellij.rt.execution.application.AppMain com.google.gwt.dev.DevMode -superDevMode -war C:\Users\xxx\.IntelliJIdea2016.2\system\gwt\jboss6.4-migration-xxx.b5723cb3\xxx.1652beb5\run\www -remoteUI 7907:IntelliJIdea -startupUrl core.html com.xxx.xxx.workflowdetails.WorkflowDetails com.xxx.xxx.migration.Migration com.xxx.xxx.useroptions.UserOptions com.xxx.xxx.sessiondetails.SessionDetails com.xxx.xxx.validationdetails.ValidationDetails com.xxx.xxx.builddetails.BuildDetails com.xxx.xxx.core com.xxx.xxx.dependencymgmt.DependencyMgmt com.xxx.xxx.generator.Generator
Exception in thread "main" java.lang.NoClassDefFoundError: cern/colt/map/OpenIntObjectHashMap
at com.google.gwt.dev.util.collect.IntMultimap.<init>(IntMultimap.java:28)
at com.google.gwt.dev.StringAnalyzableTypeEnvironment.<init>(StringAnalyzableTypeEnvironment.java:68)
at com.google.gwt.dev.MinimalRebuildCache.<init>(MinimalRebuildCache.java:192)
at com.google.gwt.dev.CompilerContext$Builder.<init>(CompilerContext.java:37)
at com.google.gwt.dev.DevModeBase.<init>(DevModeBase.java:636)
at com.google.gwt.dev.DevMode.<init>(DevMode.java:457)
at com.google.gwt.dev.DevMode.main(DevMode.java:424)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Caused by: java.lang.ClassNotFoundException: cern.colt.map.OpenIntObjectHashMap
at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:331)
at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
... 12 more
When I add missing dependency to my project:
<dependency>
<groupId>colt</groupId>
<artifactId>colt</artifactId>
<version>1.2.0</version>
</dependency>
I'm getting different problem related with wrong jetty-server version (I have depoendencies to 8.1.19.v20160209 but looks like 9.x should be used):
Exception in thread "main" java.lang.NoClassDefFoundError: org/eclipse/jetty/server/HttpConfiguration$Customizer
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:348)
at com.google.gwt.dev.DevMode$ArgHandlerServer.setString(DevMode.java:179)
at com.google.gwt.util.tools.ArgHandlerString.handle(ArgHandlerString.java:26)
at com.google.gwt.util.tools.ToolBase.processArgs(ToolBase.java:291)
at com.google.gwt.dev.ArgProcessorBase.processArgs(ArgProcessorBase.java:30)
at com.google.gwt.dev.DevMode.main(DevMode.java:425)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at com.intellij.rt.execution.application.AppMain.main(AppMain.java:147)
Let me know if you have similar problems with latest GWT releases. I could try to guess versions of all dependencies that should be used but it is not a good apreach. This should be pre-configured.
UPDATE:
When I generate simple GWT project:
mvn archetype:generate -DarchetypeGroupId=org.codehaus.mojo -DarchetypeArtifactId=gwt-maven-plugin -DarchetypeVersion=2.8.0-rc3
and import it to Intelij then dependencies are correct. I have the same gwt-maven-plugin version. I re-generated project in IDE. What I'm missing ?
You should add this dependency to your pom.xml file : gwt-dev
(gwt-dev has all the dependencies needed)
If you create a new GWT 2.8.0 module, you can check that, that contains gwt-dev dependency in the pom file.

Categories