当前位置:   article > 正文

启动java项目时出现 com.sun.xml.internal.bind.v2.ContextFactory 异常

com.sun.xml.internal.bind.v2.contextfactory

错误:
[java.lang.ClassNotFoundException: com.sun.xml.internal.bind.v2.ContextFactory]
at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:241)
at javax.xml.bind.ContextFinder.find(ContextFinder.java:455)
at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:652)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:347)
at org.apache.cxf.common.jaxb.JAXBContextCache$2.run(JAXBContextCache.java:345)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at org.apache.cxf.common.jaxb.JAXBContextCache.createContext(JAXBContextCache.java:345)
at org.apache.cxf.common.jaxb.JAXBContextCache.getCachedContextAndSchemas(JAXBContextCache.java:246)
at org.apache.cxf.jaxb.JAXBDataBinding.createJAXBContextAndSchemas(JAXBDataBinding.java:497)
at org.apache.cxf.jaxb.JAXBDataBinding.initialize(JAXBDataBinding.java:352)
… 18 more

解决方案:
在pom.xml中添加依赖:

		<dependency>
        	<groupId>com.sun.xml.ws</groupId>
        	<artifactId>jaxws-rt</artifactId>
        	<version>2.3.0</version>
        </dependency>
  • 1
  • 2
  • 3
  • 4
  • 5
声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Gausst松鼠会/article/detail/76299
推荐阅读
相关标签
  

闽ICP备14008679号