Websphere WAS 8.5,如何避免注释扫描?

Websphere WAS 8.5,如何避免注释扫描?,websphere,jax-ws,websphere-8,Websphere,Jax Ws,Websphere 8,我们在WAS 8.5.0.0上部署了一个web应用程序,我们正在使用PARENT_LAST class loader(出于某种原因,我们不得不这么做),在启动过程中,出现了一些警告: [12/16/14 17:19:15:088 CST] 00000048 InjectionProc E CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.transport.tcp.servic

我们在WAS 8.5.0.0上部署了一个web应用程序,我们正在使用PARENT_LAST class loader(出于某种原因,我们不得不这么做),在启动过程中,出现了一些警告:

[12/16/14 17:19:15:088 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.transport.tcp.servicechannel.ServiceChannelWSImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:089 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.coord.RegistrationRequesterPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:090 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.coord.RegistrationPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:090 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.coord.ActivationRequesterPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:091 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.coord.RegistrationCoordinatorPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:092 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.mex.server.MEXEndpoint/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:092 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.at.CoordinatorPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:093 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.coord.ActivationCoordinatorPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:093 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.at.ParticipantPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:094 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.at.CompletionInitiatorPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
[12/16/14 17:19:15:095 CST] 00000048 InjectionProc E   CWNEN0044E: A resource reference binding could not be found for the com.sun.xml.ws.tx.webservice.member.at.CompletionCoordinatorPortTypeImpl/wsContext resource reference, defined for the MyProjectName component.
在这些警告之后,有一个例外:

[12/16/14 17:19:15:213 CST] 00000048 webapp        E com.ibm.ws.webcontainer.webapp.WebAppImpl populateJavaNameSpace SRVE8084E: An unexpected internal server error occurred while populating the namespace.
                                 com.ibm.wsspi.injectionengine.InjectionException: CWNEN0044E: A resource reference binding could not be found for the following resource references [com.sun.xml.ws.transport.tcp.servicechannel.ServiceChannelWSImpl/wsContext, com.sun.xml.ws.tx.webservice.member.coord.RegistrationRequesterPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.coord.RegistrationPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.coord.ActivationRequesterPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.coord.RegistrationCoordinatorPortTypeImpl/wsContext, com.sun.xml.ws.mex.server.MEXEndpoint/wsContext, com.sun.xml.ws.tx.webservice.member.at.CoordinatorPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.coord.ActivationCoordinatorPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.at.ParticipantPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.at.CompletionInitiatorPortTypeImpl/wsContext, com.sun.xml.ws.tx.webservice.member.at.CompletionCoordinatorPortTypeImpl/wsContext], defined for the MyProjectName component.
    at com.ibm.wsspi.injectionengine.InjectionProcessor.resolveInjectionBindings(InjectionProcessor.java:1208)
    at com.ibm.wsspi.injectionengine.InjectionProcessorContextImpl.processBindings(InjectionProcessorContextImpl.java:56)
    at com.ibm.ws.injectionengine.AbstractInjectionEngine.processBindings(AbstractInjectionEngine.java:807)
    at com.ibm.ws.injectionengine.AbstractInjectionEngine.processInjectionMetaData(AbstractInjectionEngine.java:539)
    at com.ibm.ws.injectionengine.SharedInjectionEngineImpl.processInjectionMetaData(SharedInjectionEngineImpl.java:208)
    at com.ibm.ws.injectionengine.ReferenceContextImpl.process(ReferenceContextImpl.java:835)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.populateJavaNameSpace(WebAppImpl.java:1112)
    at com.ibm.ws.webcontainer.webapp.WebAppImpl.initialize(WebAppImpl.java:328)
    at com.ibm.ws.webcontainer.webapp.WebGroupImpl.addWebApplication(WebGroupImpl.java:88)
    at com.ibm.ws.webcontainer.VirtualHostImpl.addWebApplication(VirtualHostImpl.java:169)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApp(WSWebContainer.java:749)
    at com.ibm.ws.webcontainer.WSWebContainer.addWebApplication(WSWebContainer.java:634)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.install(WebContainerImpl.java:426)
    at com.ibm.ws.webcontainer.component.WebContainerImpl.start(WebContainerImpl.java:718)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1170)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370)
    at com.ibm.ws.runtime.component.DeployedModuleImpl.start(DeployedModuleImpl.java:638)
    at com.ibm.ws.runtime.component.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769)
    at com.ibm.ws.runtime.component.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2172)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445)
    at com.ibm.ws.runtime.component.CompositionUnitImpl.start(CompositionUnitImpl.java:123)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116)
    at com.ibm.ws.runtime.component.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994)
    at com.ibm.wsspi.runtime.component.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349)
    at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)
对于超长的日志信息,很抱歉,基本上,它说的是
“CWNEN0044E:找不到以下资源引用的资源引用绑定…”
,并且提到的类,如“
ServiceChannelWSImpl
”,都在
webservice-rt-2.0.1.jar

如果我删除
webservice-rt-2.0.1.jar
webservice-api-2.0.1.jar
(以及依赖于这两个jar的类),那么错误就消失了

我用谷歌搜索它,它似乎与注释扫描有关,所以我更新了我的
MANIFEST.MF
,并添加:

Ignore-Scanning-Archives: webservices-api-2.0.1.jar, webservices-rt-2.0.1.jar
但这不起作用,错误仍然存在

还有其他建议吗?我没主意了,能请一些专家帮忙吗

[更新] 这是web.xml(抱歉,我必须删除公司相关信息)


WebSphere提供JAX-WS运行时。因此,我建议您从应用程序中删除任何与JAX-WS相关的JAR,并使用WebSphere提供的实现。看看你是否还有错误

如果您想使用第三方提供者,则需要为您的应用程序禁用WebSphereJAX-WS运行时

要在应用程序级别关闭注释扫描,请将WAR文件或EJB模块的
META-INF/MANIFEST.MF
中的
DisableIBMJAXWSEngine
属性设置为true。例如:

Manifest-Version: 1.0
DisableIBMJAXWSEngine: true

查看此页面的详细信息:

谢谢您的回复,我们已经在MANIFEST.MF中添加了DisableIBMJAXWSEngine:true,但这没有帮助,我们仍然遇到相同的错误。@morven检查此答案-。但是,您是否尝试删除webservices jar并使用内置引擎?Gas,我确实尝试删除webservice-rt-2.0.1.jar和webservice-api-2.0.1.jar,但它导致了一个错误,无法找到WSServlet,我发现web.xml中有一个引用,xxxcom.sun.xml.ws.transport.http.servlet.WSServlet1。如何处理此错误?@morven您的web服务是用
@WebService
注释定义的,并且是
web.xml
3.0版本吗?如果是,请从
web.xml
注释掉该servlet,该servlet在符合JAX-WS的容器中不需要。也许可以在问题中添加
web.xml
和您的服务类示例。谢谢,Gas,我明天到办公室后会更新帖子。关于您所说的,如果我们使用注释,我们不需要web.xml conf,它是否适用于所有服务器(如Tomcat或其他),还是只适用于WAS?对不起,若这是一个愚蠢的问题,我缺乏相关的知识。
@Component("CalcWS")
@WebService(endpointInterface = "com.a.b.BaseWS", targetNamespace = "http://driver.abc.com/", serviceName = "BaseWSService", portName = "BaseWSPort", wsdlLocation = "WEB-INF/wsdl/BaseWSService.wsdl")
public class CalcWS implements BaseWS {
...
}
Manifest-Version: 1.0
DisableIBMJAXWSEngine: true