英文:
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 "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)
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:
<dependency>
<groupId>jakarta.xml.ws</groupId>
<artifactId>jakarta.xml.ws-api</artifactId>
<version>3.0.1</version>
</dependency>
Or like this for Gradle
compile group: 'jakarta.xml.ws', name: 'jakarta.xml.ws-api', version: '3.0.1'
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.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论