Exception in thread “Thread-9” java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

huangapple go评论123阅读模式
英文:

Exception in thread "Thread-9" java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException

问题

org.apache.catalina.connector.RequestFacade@2f6791f5
在线程“Thread-9”中的异常 java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.getFICodec(SOAPBindingCodec.java:491)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.<init>(SOAPBindingCodec.java:183)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.<init>(SOAPBindingCodec.java:164)
	at com.sun.xml.ws.api.pipe.Codecs.createSOAPBindingCodec(Codecs.java:73)
	at com.sun.xml.ws.api.message.MessageContextFactory.<init>(MessageContextFactory.java:96)
	at com.sun.xml.ws.api.message.MessageContextFactory.<init>(MessageContextFactory.java:82)
	at com.oracle.webservices.api.message.MessageContextFactory.<clinit>(MessageContextFactory.java:57)
	at com.sun.xml.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:104)
	at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
	at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
	at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:120)
	at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:882)
	at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:899)
	at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:862)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:451)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:420)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:402)
	at javax.xml.ws.Service.getPort(Service.java:169)

我试图运行我的批处理应用程序,期间我想通过某个属性文件连接到另一个应用程序。
英文:
org.apache.catalina.connector.RequestFacade@2f6791f5
Exception in thread &quot;Thread-9&quot; java.lang.NoClassDefFoundError: jakarta/xml/ws/WebServiceException
	at java.base/java.lang.Class.forName0(Native Method)
	at java.base/java.lang.Class.forName(Class.java:315)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.getFICodec(SOAPBindingCodec.java:491)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.&lt;init&gt;(SOAPBindingCodec.java:183)
	at com.sun.xml.ws.encoding.SOAPBindingCodec.&lt;init&gt;(SOAPBindingCodec.java:164)
	at com.sun.xml.ws.api.pipe.Codecs.createSOAPBindingCodec(Codecs.java:73)
	at com.sun.xml.ws.api.message.MessageContextFactory.&lt;init&gt;(MessageContextFactory.java:96)
	at com.sun.xml.ws.api.message.MessageContextFactory.&lt;init&gt;(MessageContextFactory.java:82)
	at com.oracle.webservices.api.message.MessageContextFactory.&lt;clinit&gt;(MessageContextFactory.java:57)
	at com.sun.xml.ws.db.DatabindingImpl.&lt;init&gt;(DatabindingImpl.java:104)
	at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)
	at com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)
	at com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:120)
	at com.sun.xml.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:882)
	at com.sun.xml.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:899)
	at com.sun.xml.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:862)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:451)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:420)
	at com.sun.xml.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:402)
	at javax.xml.ws.Service.getPort(Service.java:169)

I'm trying to run my Batch application during this I want to connect to another application via some property file.

答案1

得分: -1

似乎在Java运行时中没有jakarta/xml/ws/WebServiceException类的定义。

尽管如此,您仍然成功编译了这个程序,这意味着要么在编译过程中不需要这个类(例如通过Class.forName加载),要么它被标记为仅在编译时需要。我不知道您使用的构建工具是什么,但似乎您需要像Maven这样声明依赖:

<dependency>
    <groupId>jakarta.xml.ws</groupId>
    <artifactId>jakarta.xml.ws-api</artifactId>
    <version>3.0.1</version>
</dependency>

或者像Gradle这样:

compile group: 'jakarta.xml.ws', name: 'jakarta.xml.ws-api', version: '3.0.1'

附言:我注意到了jakarta包,我猜您正在从javax过渡到jakarta,如果是这样,您可能会发现这个SO帖子有用。

英文:

Seems that you have no jakarta/xml/ws/WebServiceException class definition in Java Runtime.

Still, you managed to compile this, which means either this class is not needed during the compilation process (for instance loaded through Class.forName) or it is marked as compile time only. I do not know what build tool you are using, but it seems you need to put declare dependency like this for Maven:

&lt;dependency&gt;
	&lt;groupId&gt;jakarta.xml.ws&lt;/groupId&gt;
	&lt;artifactId&gt;jakarta.xml.ws-api&lt;/artifactId&gt;
	&lt;version&gt;3.0.1&lt;/version&gt;
&lt;/dependency&gt;

Or like this for Gradle

compile group: &#39;jakarta.xml.ws&#39;, name: &#39;jakarta.xml.ws-api&#39;, version: &#39;3.0.1&#39;

P.S: I have noticed the jakarta package, I'm guessing you are in the process of transitioning from javax to jakarta, if so, you may find this SO post useful.

huangapple
  • 本文由 发表于 2023年2月24日 14:07:49
  • 转载请务必保留本文链接:https://go.coder-hub.com/75553124.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定