java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC
发布日期:2021-06-30 16:23:21 浏览次数:3 分类:技术文章

本文共 3387 字,大约阅读时间需要 11 分钟。

对接某webservice项目时报错 

java.lang.IllegalStateException: Unable to create schema compiler	at org.apache.cxf.common.jaxb.JAXBUtils.createSchemaCompilerWithDefaultAllocator(JAXBUtils.java:733)	at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createSchemaCompiler(DynamicClientFactory.java:446)	at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:326)	at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:244)	at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:237)	at org.apache.cxf.endpoint.dynamic.DynamicClientFactory.createClient(DynamicClientFactory.java:192)	at com.jiasx.study.webservice.service.DemoServiceTest.test(DemoServiceTest.java:15)	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.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:47)	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)	at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)	at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:271)	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:50)	at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)	at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)	at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)	at org.junit.runners.ParentRunner.run(ParentRunner.java:309)	at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)	at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:41)	at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)	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: javax.xml.bind.JAXBException - with linked exception:[java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC]	at org.apache.cxf.common.jaxb.JAXBUtils.createSchemaCompiler(JAXBUtils.java:718)	at org.apache.cxf.common.jaxb.JAXBUtils.createSchemaCompilerWithDefaultAllocator(JAXBUtils.java:725)	... 29 moreCaused by: java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC	at java.base/java.lang.Class.forName0(Native Method)	at java.base/java.lang.Class.forName(Class.java:398)	at org.apache.cxf.common.jaxb.JAXBUtils.createSchemaCompiler(JAXBUtils.java:711)	... 30 more

错误位置为java.lang.ClassNotFoundException: com/sun/tools/internal/xjc/api/XJC

网上查到原因是因为 【配置jdk环境的时候默认用的是jre】 

看了下maven项目确实,调整为本地jdk环境后正常

 

 

转载地址:https://kevin.blog.csdn.net/article/details/116402534 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:合格的java从业者需要掌握的知识或能力
下一篇:windows查看指定的端口是否开放

发表评论

最新留言

第一次来,支持一个
[***.219.124.196]2024年04月20日 07时22分41秒