Caused by: java.lang.NoClassDefFoundError: java/sql/Time
at com.google.gson.Gson.<init>(Gson.java:240)
at com.google.gson.GsonBuilder.create(GsonBuilder.java:569)
at net.thucydides.core.reports.json.gson.GsonJSONConverter.<init>(GsonJSONConverter.java:50)
at net.thucydides.core.reports.json.gson.GsonJSONConverter$$FastClassByGuice$$6794eb79.newInstance(<generated>)
at com.google.inject.internal.DefaultConstructionProxyFactory$FastClassProxy.newInstance(DefaultConstructionProxyFactory.java:89)
at com.google.inject.internal.ConstructorInjector.provision(ConstructorInjector.java:111)
at com.google.inject.internal.ConstructorInjector.construct(ConstructorInjector.java:90)
at com.google.inject.internal.ConstructorBindingImpl$Factory.get(ConstructorBindingImpl.java:268)
at com.google.inject.internal.FactoryProxy.get(FactoryProxy.java:56)
at com.google.inject.internal.ProviderToInternalFactoryAdapter$1.call(ProviderToInternalFactoryAdapter.java:46)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1092)
at com.google.inject.internal.ProviderToInternalFactoryAdapter.get(ProviderToInternalFactoryAdapter.java:40)
at com.google.inject.internal.SingletonScope$1.get(SingletonScope.java:194)
at com.google.inject.internal.InternalFactoryToProviderAdapter.get(InternalFactoryToProviderAdapter.java:41)
at com.google.inject.internal.InjectorImpl$2$1.call(InjectorImpl.java:1019)
at com.google.inject.internal.InjectorImpl.callInContext(InjectorImpl.java:1085)
at com.google.inject.internal.InjectorImpl$2.get(InjectorImpl.java:1015)
... 25 more
Caused by: java.lang.ClassNotFoundException: java.sql.Time
at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:466)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:563)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:496)
... 42 more
我尝试了不同的java版本,也没有更新gson库,我的意思是同样的包正在java 8上工作。 有什么建议吗?
答案 0 :(得分:2)
答案 1 :(得分:1)
将java.sql添加到您的module-info.java
文件中:
module MODULE_NAME {
...
requires java.sql;
...
}
答案 2 :(得分:0)
以下内容帮助了我。 IDE: 运行->编辑配置,然后在“ Shorten命令行”字段中选择“ JAR清单”