我正在尝试将Apache CXF的“cxf-java2ws-plugin”添加到我的pom.xml文件中 在“进程类”阶段执行默认目标(java2ws)时,我得到一个未找到类的异常:
执行时缺少必需的类 org.apache.cxf:CXF-java2ws-插件:3.1.11:java2ws: 组织/阿帕奇/ CXF /助手/ CastUtil
奇怪的是我有正确的依赖关系,我可以看到在领域URL中具有所需类文件的JAR(cxf-core-3.1.11.jar)。我检查了发现JAR,类文件就在那里。 (见下面的网址[4])
header('Access-Control-Allow-Origin: *')
这是我的“最简单”的插件配置
[ERROR] Failed to execute goal org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws (default) on project MasterCardServiceStub: Execution default of goal org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws failed: A required class was missing while executing org.apache.cxf:cxf-java2ws-plugin:3.1.11:java2ws: org/apache/cxf/helpers/CastUtils
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.cxf:cxf-java2ws-plugin:3.1.11
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-java2ws-plugin/3.1.11/cxf-java2ws-plugin-3.1.11.jar
[ERROR] urls[1] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-rt-frontend-jaxws/3.1.11/cxf-rt-frontend-jaxws-3.1.11.jar
[ERROR] urls[2] = file:/C:/SBIv2/m2/repository/xml-resolver/xml-resolver/1.2/xml-resolver-1.2.jar
[ERROR] urls[3] = file:/C:/SBIv2/m2/repository/org/ow2/asm/asm/5.0.4/asm-5.0.4.jar
[ERROR] urls[4] = file:/C:/SBIv2/m2/repository/org/apache/cxf/cxf-core/3.1.11/cxf-core-3.1.11.jar
[ERROR] urls[5] = file:/C:/SBIv2/m2/repository/org/codehaus/woodstox/woodstox-core-asl/4.4.1/woodstox-core-asl-4.4.1.jar
...
答案 0 :(得分:1)
由本地仓库中的损坏的JAR引起
答案 1 :(得分:0)
尝试使用3.1.11中<artifactId>cxf-rt-frontend-simple</artifactId>
的以下版本。并更新maven项目