- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
当我将 jaxws-tools 升级到 3.0.0 时,我的 wsimport Gradle 任务开始因 ClassNotFoundException 而崩溃。
我有一个使用 Spring initializr 创建的简单 Gradle 项目。我在其中创建了一个 wsimport 任务,该任务基于 gradle wsimport问题还有其他来源。 build.gradle 如下所示
plugins {
id 'org.springframework.boot' version '2.4.2'
id 'io.spring.dependency-management' version '1.0.11.RELEASE'
id 'java'
}
group = 'com.example'
version = '0.0.1-SNAPSHOT'
sourceCompatibility = '11'
configurations {
jaxws
}
task wsimport {
description = 'Generate classes from wsdl using wsimport'
def wsdlFile = file("${projectDir}/src/main/resources/soap/wsdl/hello.wsdl")
ext.classesDir = "${buildDir}/classes/generated"
doLast {
ant {
mkdir(dir: classesDir)
taskdef(name: 'wsimport',
classname: 'com.sun.tools.ws.ant.WsImport',
classpath: configurations.jaxws.asPath
)
wsimport(
destdir: "${classesDir}",
extension: "true",
wsdl: "${wsdlFile}") {
xjcarg(value: "-XautoNameResolution")
}
}
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'org.springframework.boot:spring-boot-starter'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
jaxws 'com.sun.xml.ws:jaxws-tools:2.3.3'
}
test {
useJUnitPlatform()
}
它所做的唯一一件事就是解析提供的 WSDL(我从 here 中获取了一些 SOAP 1.2 的示例 WSDL)并且它做得很好。这是输出:
> Task :wsimport
[ant:wsimport] parsing WSDL...
[ant:wsimport]
[ant:wsimport]
[ant:wsimport] [WARNING] SOAP port "testJaxWs": uses a non-standard SOAP 1.2 binding.
[ant:wsimport] line 95 of file:/home/miro/wks/idea/wsimporttest/src/main/resources/soap/wsdl/hello.wsdl
[ant:wsimport]
[ant:wsimport]
[ant:wsimport] Generating code...
[ant:wsimport]
[ant:wsimport]
[ant:wsimport] Compiling code...
[ant:wsimport]
BUILD SUCCESSFUL in 1s
1 actionable task: 1 executed
18:12:40: Task execution finished 'wsimport --stacktrace'.
但是当我将 jaxws-tools 升级到 3.0.0 时
jaxws 'com.sun.xml.ws:jaxws-tools:3.0.0'
任务在 NoClassDefFoundError 上开始崩溃
Execution failed for task ':wsimport'.
java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException
Try:
Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Exception is:
org.gradle.api.tasks.TaskExecutionException: Execution failed for task ':wsimport'.
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.lambda$executeIfValid$1(ExecuteActionsTaskExecuter.java:200)
at org.gradle.internal.Try$Failure.ifSuccessfulOrElse(Try.java:263)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:198)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: : java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:109)
at org.gradle.api.internal.project.ant.BasicAntBuilder.nodeCompleted(BasicAntBuilder.java:80)
at org.gradle.api.internal.project.ant.BasicAntBuilder.doInvokeMethod(BasicAntBuilder.java:107)
at org.gradle.internal.metaobject.BeanDynamicObject$GroovyObjectAdapter.invokeOpaqueMethod(BeanDynamicObject.java:584)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:511)
at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:56)
at build_2r4sqfr3gef6qor0csrq287dd$_run_closure2$_closure6$_closure7.doCall(/home/miro/wks/idea/wsimporttest/build.gradle:29)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.util.ClosureBackedAction.execute(ClosureBackedAction.java:71)
at org.gradle.util.ConfigureUtil.configureTarget(ConfigureUtil.java:154)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:105)
at org.gradle.api.internal.project.DefaultProject.ant(DefaultProject.java:1175)
at jdk.internal.reflect.GeneratedMethodAccessor521.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.internal.metaobject.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:484)
at org.gradle.internal.metaobject.BeanDynamicObject.tryInvokeMethod(BeanDynamicObject.java:196)
at org.gradle.internal.metaobject.CompositeDynamicObject.tryInvokeMethod(CompositeDynamicObject.java:98)
at org.gradle.internal.extensibility.MixInClosurePropertiesAsMethodsDynamicObject.tryInvokeMethod(MixInClosurePropertiesAsMethodsDynamicObject.java:34)
at org.gradle.groovy.scripts.BasicScript$ScriptDynamicObject.tryInvokeMethod(BasicScript.java:134)
at org.gradle.internal.metaobject.ConfigureDelegate.invokeMethod(ConfigureDelegate.java:77)
at build_2r4sqfr3gef6qor0csrq287dd$_run_closure2$_closure6.doCall(/home/miro/wks/idea/wsimporttest/build.gradle:22)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:64)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.doExecute(AbstractTask.java:680)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.lambda$execute$0(AbstractTask.java:667)
at org.gradle.configuration.internal.DefaultUserCodeApplicationContext$CurrentApplication.reapply(DefaultUserCodeApplicationContext.java:86)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:667)
at org.gradle.api.internal.AbstractTask$ClosureTaskAction.execute(AbstractTask.java:642)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$3.run(ExecuteActionsTaskExecuter.java:555)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:29)
at org.gradle.internal.operations.DefaultBuildOperationRunner$1.execute(DefaultBuildOperationRunner.java:26)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.run(DefaultBuildOperationRunner.java:56)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$run$1(DefaultBuildOperationExecutor.java:71)
at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.runWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:45)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:71)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeAction(ExecuteActionsTaskExecuter.java:540)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeActions(ExecuteActionsTaskExecuter.java:523)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.access$300(ExecuteActionsTaskExecuter.java:108)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.executeWithPreviousOutputFiles(ExecuteActionsTaskExecuter.java:271)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter$TaskExecution.execute(ExecuteActionsTaskExecuter.java:260)
at org.gradle.internal.execution.steps.ExecuteStep.lambda$execute$1(ExecuteStep.java:34)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:34)
at org.gradle.internal.execution.steps.ExecuteStep.execute(ExecuteStep.java:26)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:67)
at org.gradle.internal.execution.steps.CleanupOutputsStep.execute(CleanupOutputsStep.java:36)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:49)
at org.gradle.internal.execution.steps.ResolveInputChangesStep.execute(ResolveInputChangesStep.java:34)
at org.gradle.internal.execution.steps.CancelExecutionStep.execute(CancelExecutionStep.java:43)
at org.gradle.internal.execution.steps.TimeoutStep.executeWithoutTimeout(TimeoutStep.java:73)
at org.gradle.internal.execution.steps.TimeoutStep.execute(TimeoutStep.java:54)
at org.gradle.internal.execution.steps.CreateOutputsStep.execute(CreateOutputsStep.java:44)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:54)
at org.gradle.internal.execution.steps.SnapshotOutputsStep.execute(SnapshotOutputsStep.java:38)
at org.gradle.internal.execution.steps.BroadcastChangingOutputsStep.execute(BroadcastChangingOutputsStep.java:42)
at org.gradle.internal.execution.steps.CacheStep.executeWithoutCache(CacheStep.java:159)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:72)
at org.gradle.internal.execution.steps.CacheStep.execute(CacheStep.java:43)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:44)
at org.gradle.internal.execution.steps.StoreExecutionStateStep.execute(StoreExecutionStateStep.java:33)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:38)
at org.gradle.internal.execution.steps.RecordOutputsStep.execute(RecordOutputsStep.java:24)
at org.gradle.internal.execution.steps.SkipUpToDateStep.executeBecause(SkipUpToDateStep.java:92)
at org.gradle.internal.execution.steps.SkipUpToDateStep.lambda$execute$0(SkipUpToDateStep.java:85)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:55)
at org.gradle.internal.execution.steps.SkipUpToDateStep.execute(SkipUpToDateStep.java:39)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:76)
at org.gradle.internal.execution.steps.ResolveChangesStep.execute(ResolveChangesStep.java:37)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:36)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsFinishedStep.execute(MarkSnapshottingInputsFinishedStep.java:26)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:94)
at org.gradle.internal.execution.steps.ResolveCachingStateStep.execute(ResolveCachingStateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:79)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:53)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:74)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.lambda$execute$2(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:78)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:34)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:39)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:40)
at org.gradle.internal.execution.steps.LoadExecutionStateStep.execute(LoadExecutionStateStep.java:28)
at org.gradle.internal.execution.impl.DefaultWorkExecutor.execute(DefaultWorkExecutor.java:33)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:187)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:179)
at org.gradle.api.internal.tasks.execution.CleanupStaleOutputsExecuter.execute(CleanupStaleOutputsExecuter.java:109)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:62)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:56)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:200)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:195)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:75)
at org.gradle.internal.operations.DefaultBuildOperationRunner$3.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:153)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:68)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:62)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.lambda$call$2(DefaultBuildOperationExecutor.java:76)
at org.gradle.internal.operations.UnmanagedBuildOperationWrapper.callWithUnmanagedSupport(UnmanagedBuildOperationWrapper.java:54)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:76)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:41)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:372)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:359)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:352)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.lambda$run$0(DefaultPlanExecutor.java:127)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:191)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.executeNextNode(DefaultPlanExecutor.java:182)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:124)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:48)
at org.gradle.internal.concurrent.ThreadFactoryImpl$ManagedThreadRunnable.run(ThreadFactoryImpl.java:56)
Caused by: java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1153)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1321)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093)
at org.apache.tools.ant.AntClassLoader.defineClassFromData(AntClassLoader.java:1153)
at org.apache.tools.ant.AntClassLoader.getClassFromStream(AntClassLoader.java:1321)
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1373)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093)
at com.sun.tools.ws.wscompile.WsimportTool.buildWsdlModel(WsimportTool.java:408)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:175)
at com.sun.tools.ws.wscompile.WsimportTool.run(WsimportTool.java:153)
at com.sun.tools.ws.ant.WsImportBase.runInVm(WsImportBase.java:569)
at com.sun.tools.ws.ant.WsTask2.execute(WsTask2.java:457)
at com.sun.tools.ws.ant.WsImportBase.execute(WsImportBase.java:552)
at com.sun.tools.ws.ant.WsImport.execute(WsImport.java:81)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:292)
at jdk.internal.reflect.GeneratedMethodAccessor125.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
... 122 more
Caused by: java.lang.ClassNotFoundException: jakarta.xml.ws.WebServiceException
at org.apache.tools.ant.AntClassLoader.findClassInComponents(AntClassLoader.java:1383)
at org.apache.tools.ant.AntClassLoader.findClass(AntClassLoader.java:1338)
at org.apache.tools.ant.AntClassLoader.loadClass(AntClassLoader.java:1093)
... 143 more
我想我只是缺少一些库,我猜是 jakarta.xml.ws-api或 jaxws-rt但是当添加到依赖项时,这些都没有帮助。我当时在想,也许我需要在 wsimport 的 taskdef 类路径中添加一些东西?但我不确定要在那里添加什么。
我检查了 documentation对于 wsimport Ant 任务,但我没有看到 3.0.0 中有任何变化。我在这里缺少什么?
附言。整个问题是根据我们的生产代码(我无法发布)重新创建的,它在类似异常时失败了。但我想这有相同的根本原因。
Unable to load class 'jakarta.xml.bind.ValidationEventLocator'.
最佳答案
原来 jaxws-tools 在 3.0.0 版本中需要几个 jakarta 库。我将它们添加到配置中,wsimport 现在可以工作了
jaxws 'com.sun.xml.ws:jaxws-tools:3.0.0',
'jakarta.xml.ws:jakarta.xml.ws-api:3.0.0',
'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0',
'jakarta.activation:jakarta.activation-api:2.0.0'
正如我在问题中提到的,我们的生产代码抛出了不同的异常,为了解决这个问题,我还必须另外添加 jaxws-rt
库
jaxws 'com.sun.xml.ws:jaxws-tools:3.0.0',
'jakarta.xml.ws:jakarta.xml.ws-api:3.0.0',
'jakarta.xml.bind:jakarta.xml.bind-api:3.0.0',
'jakarta.activation:jakarta.activation-api:2.0.0',
'com.sun.xml.ws:jaxws-rt:3.0.0'
我不确定这两个项目之间做了什么,但它也在那里工作
关于java - 来自 jaxws-tools :3. 0.0 的 Wsimport 在 ClassNotFoundException 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65796617/
我收到此错误消息: [WARNING] Ignoring: binding file "file:/home/jeusdi/projects/salut/hes/hes-visor-api-servi
查看来自 java.net 的 JAX-WS Maven 存储库 - http://download.java.net/maven/2/com/sun/xml/ws/ 有两个类似的文件夹 - jaxw
我正在使用 JAXWS 生成 Web 服务并使用 EndPoint.publish() 提供服务以及部署 war 文件,但是一旦它处理了 100 个请求,它就不会返回第 101 个请求回复。如何配置
我一直使用 wsimport 工具从 WSDL 文件生成客户端类。然后我将它们包含到项目的源代码树中,并将它们 checkin 版本控制系统。但最近我了解到有一个名为 jaxws-maven-plug
我尝试使用以下代码生成 java 类,但由于某些 gradle 插件问题而失败。 我搜索了一下,发现有很多插件可用于生成xsd类的java,但只有很少的插件用于生成代码形式wsdl.jaxb 是我想使
是否可能,如果可能,如何? 最佳答案 实际上,WebLogic 10.3 中捆绑的 JAX-WS 实现基于 JAX-WS RI 2.1.4,如 What's New in WebLogic Serve
由于 JAX-WS 依赖于 JAXB,并且由于我观察到在 JAX-B 引用实现中解压 XML bean 的代码,我猜没有区别并且 JAXWS 客户端总是返回一个空集合,即使 web 服务结果是空元素:
我有一个使用 Axis1 制作的可用 Web 服务,我正在将其迁移到 Jaxws 我正在使用 wsimport 和 maven 从我的工作 WSDL 文件创建客户端类。 我遇到的问题是,我可以在记录器
有人可以帮我吗? 我正在尝试连接 Web 服务;这是我的代码: public class test { static Logger logger = Logger.getLogger(test
这个问题在这里已经有了答案: How to change webservice url endpoint? (4 个回答) 关闭7年前。 如何动态更改我的 JAXWS 客户端正在使用的地址?此客户端由
我需要通过 SOAP Web 服务调用长时间运行的任务,在两端使用 JAXWS,特别是在两端使用 Apache CXF 2.6。 我看到我可以在 CXF 代码生成器中启用异步方法,它为每个操作创建两个
我在 maven 3 中使用 netbeans。当我尝试使用 jaxws-maven-plugin 进行编译时,出现以下错误。 这是我的 pom
我每次尝试使用 wsdl2java 工具时都会出现同样的错误。任何想法非常感谢-fe jaxbs 没有帮助。看起来找不到tools-plugin.xml。 15:18:37.618 [main] DE
我正在用Spring构建一个Web服务。我可以构建项目并将其部署到tomcat,但是当服务器启动时,出现以下错误: Invalid NamespaceHandler class [org.apache
我正在使用带有 JaxWS maven 插件的 NetBeans。我的应用程序有大约 5 个不同的 wsdls 我需要加载。我的问题是我想阻止 maven 或 wsimport 每次重新编译我的 ws
我有一个使用 JAX-WS 创建的 WebService,我编写了一个 JUnit 以通过以下方式连接到它: public class LicenseSvcClient { private s
我已经设置了一个 JAXWS 客户端并将一个 SoapHandler 实现添加到它的 Binding handlerChain。所有这一切都是为了在服务未正常运行时查看原始服务响应。 当一切正常时,我
我对编写网络服务相当陌生。我正在使用 JAXWS 开发 SOAP 服务。我希望能够让用户登录并在我的服务中知道哪个用户正在发出命令。换句话说,进行一些 session 处理。 我见过的一种方法是使用
您好,我已经编写了一个 WSDL 文件并生成了我的 Web 服务。我现在想像这样调用该服务: res = new UpdateCatalogWebService().getUpdateCatalogP
我使用 wsimport 从 wsdl 生成类。现在我正在解决缺少的依赖项,其中一些属于 javax.xml.ws:jaxws-api: 导入 javax.xml.ws.Service; 导入 jav
我是一名优秀的程序员,十分优秀!