Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
10.0
Description
As requested here:
https://github.com/apache/incubator-netbeans/pull/629#commitcomment-30459921
Gson included in NetBeans is used as an OSGi bundle. But doing "new Gson()" from another module on JDK 11 crashes:
—
java.lang.NoClassDefFoundError: java/sql/Time
at com.google.gson.Gson.<init>(Gson.java:240)
at com.google.gson.Gson.<init>(Gson.java:174)
at test.ExpTest.testTest(ExpTest.java:33)
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 org.netbeans.junit.NbTestCase.access$200(NbTestCase.java:77)
at org.netbeans.junit.NbTestCase$2.doSomething(NbTestCase.java:460)
at org.netbeans.junit.NbTestCase$1Guard.run(NbTestCase.java:386)
at java.base/java.lang.Thread.run(Thread.java:835)
Caused by: java.lang.ClassNotFoundException: java.sql.Time
at java.base/java.lang.ClassLoader.findClass(ClassLoader.java:718)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:588)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:420)
at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:412)
at org.eclipse.osgi.internal.baseadaptor.DefaultClassLoader.loadClass(DefaultClassLoader.java:107)
at org.netbeans.modules.netbinox.NetbinoxLoader.loadClass(NetbinoxLoader.java:58)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
—
To reproduce, please download the attached gson-osgi.zip, unpack, open in NetBeans, and run tests - make sure the tests are running on JDK 11.
Attachments
Attachments
Issue Links
- links to