NoSuchMethodError:com/sun/istack/logging/Logger.getLogger [英] NoSuchMethodError: com/sun/istack/logging/Logger.getLogger
问题描述
我开发了一个Web服务,并将其部署到Websphere 7.0,并使用同样在同一应用程序服务器上运行的JAX-WS API开发了一个动态调度客户端. 我在以下行出现错误:
I developed a webservice and deployed it to websphere 7.0 and developed a dynamic dispatch client using JAX-WS APIs which also runs on same application server. I get error at the following line:
Dispatch<SOAPMessage> dispatch = service.createDispatch(portName, SOAPMessage.class, Service.Mode.MESSAGE);
Error:
Caused by: java.lang.NoSuchMethodError: com/sun/istack/logging/Logger.getLogger(Ljava/lang/Class;)Lcom/sun/istack/logging/Logger;
at com.sun.xml.ws.api.config.management.policy.ManagementAssertion.<clinit>(ManagementAssertion.java:87)
at java.lang.J9VMInternals.initializeImpl(Native Method)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:200)
at java.lang.J9VMInternals.initialize(J9VMInternals.java:167)
at com.sun.xml.ws.server.MonitorBase.createManagedObjectManager(MonitorBase.java:177)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:196)
at com.sun.xml.ws.client.Stub.<init>(Stub.java:174)
at com.sun.xml.ws.client.dispatch.DispatchImpl.<init>(DispatchImpl.java:129)
at com.sun.xml.ws.client.dispatch.SOAPMessageDispatch.<init>(SOAPMessageDispatch.java:77)
at com.sun.xml.ws.api.pipe.Stubs.createSAAJDispatch(Stubs.java:143)
at com.sun.xml.ws.api.pipe.Stubs.createDispatch(Stubs.java:264)
at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:390)
at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:401)
at com.sun.xml.ws.client.WSServiceDelegate.createDispatch(WSServiceDelegate.java:383)
at javax.xml.ws.Service.createDispatch(Service.java:336)
我包括以下依赖项.
<dependency>
<groupId>javax.xml.ws</groupId>
<artifactId>jaxws-api</artifactId>
<version>2.1</version>
</dependency>
我还尝试添加策略依赖性(版本-2.2和2.2.1)
I also tried adding policy dependency (versions - 2.2 and 2.2.1)
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>policy</artifactId>
<version>2.2.1</version>
</dependency>
关于需要添加更多依赖项的任何想法吗?
Any ideas on what more dependencies I need to add?
推荐答案
jaxb-impl jar(2.2)包含与istack-commons-runtime jar相同的日志记录类.
The jaxb-impl jar (2.2) contains the same logging classes as the istack-commons-runtime jar.
添加以下排除项以纠正版本不匹配:
Add the following exclusions in order to correct the version mismatch:
<dependency>
<groupId>com.sun.xml.ws</groupId>
<artifactId>jaxws-rt</artifactId>
<version>2.2</version>
<exclusions>
<exclusion>
<artifactId>istack-commons-runtime</artifactId>
<groupId>com.sun.istack</groupId>
</exclusion>
</exclusions>
</dependency>
这篇关于NoSuchMethodError:com/sun/istack/logging/Logger.getLogger的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!