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

编程入门 行业动态 更新时间:2024-10-25 12:20:24
本文介绍了WAS 8.5,如何避免注释扫描?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我们在WAS 8.5.0.0上部署了一个Web应用程序,我们正在使用PARENT_LAST类加载器(由于某些原因,我们不得不这样做),在启动过程中,会出现一些警告:

We deploy a web app on WAS 8.5.0.0, we're using PARENT_LAST class loader(we have to for some reason), during the startup, there're some warnings:

[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.

在这些警告之后,有一个例外:

Right after these warnings, there's an exception:

[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.webcontainerponent.WebContainerImpl.install(WebContainerImpl.java:426) at com.ibm.ws.webcontainerponent.WebContainerImpl.start(WebContainerImpl.java:718) at com.ibm.ws.runtimeponent.ApplicationMgrImpl.start(ApplicationMgrImpl.java:1170) at com.ibm.ws.runtimeponent.DeployedApplicationImpl.fireDeployedObjectStart(DeployedApplicationImpl.java:1370) at com.ibm.ws.runtimeponent.DeployedModuleImpl.start(DeployedModuleImpl.java:638) at com.ibm.ws.runtimeponent.DeployedApplicationImpl.start(DeployedApplicationImpl.java:968) at com.ibm.ws.runtimeponent.ApplicationMgrImpl.startApplication(ApplicationMgrImpl.java:769) at com.ibm.ws.runtimeponent.ApplicationMgrImpl.start(ApplicationMgrImpl.java:2172) at com.ibm.ws.runtimeponent.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:445) at com.ibm.ws.runtimeponent.CompositionUnitImpl.start(CompositionUnitImpl.java:123) at com.ibm.ws.runtimeponent.CompositionUnitMgrImpl.start(CompositionUnitMgrImpl.java:388) at com.ibm.ws.runtimeponent.CompositionUnitMgrImpl.access$500(CompositionUnitMgrImpl.java:116) at com.ibm.ws.runtimeponent.CompositionUnitMgrImpl$CUInitializer.run(CompositionUnitMgrImpl.java:994) at com.ibm.wsspi.runtimeponent.WsComponentImpl$_AsynchInitializer.run(WsComponentImpl.java:349) at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1783)

很抱歉,对于超长日志信息,基本上是说"CWNEN0044E: A resource reference binding could not be found for the following resource references...",而提到的类,例如"ServiceChannelWSImpl",都在webservice-rt-2.0.1.jar

Sorry for the super long log info, basically, it's saying "CWNEN0044E: A resource reference binding could not be found for the following resource references...", and the classes mentioned, like "ServiceChannelWSImpl", are all in the webservice-rt-2.0.1.jar

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

If I remove webservice-rt-2.0.1.jar and webservice-api-2.0.1.jar(and my classes which are dependent on these 2 jars), then the error is gone.

我用google搜索,它似乎与注释扫描有关,因此我更新了MANIFEST.MF,并添加:

I google it, and it seems related to annotation scanning, so I update my MANIFEST.MF, and add:

Ignore-Scanning-Archives: webservices-api-2.0.1.jar, webservices-rt-2.0.1.jar

但这不起作用,错误仍然存​​在.

But this doesn't work, the error is still there.

还有其他建议吗?我没有主意,请WAS专家帮忙吗?

Any other suggestions? I'm out of ideas, could some WAS expert please help?

[已更新] 这是web.xml(对不起,我必须删除公司的相关信息)

[updated] here is the web.xml(sorry I have to remove company relevant info )

<?xml version="1.0" encoding="UTF-8"?> <web-app xmlns="java.sun/xml/ns/javaee" xmlns:xsi="www.w3/2001/XMLSchema-instance" id="project-1" version="3.0" xsi:schemaLocation="java.sun/xml/ns/javaee java.sun/xml/ns/javaee/web-app_3_0.xsd"> <display-name>project-1</display-name> <listener> <listener-class>com.mh.proj1.server.MyServletContextListener</listener-class> </listener> <listener> <listener-class>org.jboss.resteasy.plugins.server.servlet.ResteasyBootstrap</listener-class> </listener> <listener> <listener-class>org.jboss.resteasy.plugins.spring.SpringContextLoaderListener</listener-class> </listener> <listener> <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> </listener> <listener> <listener-class>com.mh.proj1.spring.ApplicationContextHolder</listener-class> </listener> <listener> <listener-class>com.sun.xml.ws.transport.http.servlet.WSServletContextListener</listener-class> </listener> <context-param> <param-name>webAppRootKey</param-name> <param-value>proj1decision</param-value> </context-param> <context-param> <param-name>contextConfigLocation</param-name> <param-value>classpath:spring/applicationContext.xml</param-value> </context-param> <context-param> <param-name>resteasy.providers</param-name> <param-value>com.mh.proj1.exceptions.WAEExceptionMapper,com.mh.proj1.exceptions.GenericExceptionMapper</param-value> </context-param> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> </filter> <filter-mapping> <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> <servlet> <servlet-name>Resteasy</servlet-name> <servlet-class>org.jboss.resteasy.plugins.server.servlet.HttpServletDispatcher</servlet-class> </servlet> <servlet> <servlet-name>CALC WS</servlet-name> <servlet-class>com.sun.xml.ws.transport.http.servlet.WSServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> <servlet-name>Resteasy</servlet-name> <url-pattern>/rs/*</url-pattern> </servlet-mapping> <servlet-mapping> <servlet-name>CALC WS</servlet-name> <url-pattern>/ws/*</url-pattern> </servlet-mapping> <session-config> <session-timeout>1</session-timeout> </session-config> </web-app>

以及该类中使用的注释:

and the annotation used in the class:

@Component("CalcWS") @WebService(endpointInterface = "com.a.b.BaseWS", targetNamespace = "driver.abc/", serviceName = "BaseWSService", portName = "BaseWSPort", wsdlLocation = "WEB-INF/wsdl/BaseWSService.wsdl") public class CalcWS implements BaseWS { ... }

推荐答案

WebSphere提供了JAX-WS运行时.因此,建议您从应用程序中删除所有与JAX-WS相关的jar,并使用WebSphere提供的实现.看看您是否仍然会有错误.

WebSphere provides JAX-WS runtime. So I'd suggest you to remove any JAX-WS related jars from your application and use WebSphere provided implementation. See if you still will have errors.

如果要使用第三方提供程序,则需要为应用程序禁用WebSphere JAX-WS运行时.

If you want to use third party provider you will need to disable WebSphere JAX-WS runtime for your application.

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

To turn off annotation scanning at the application level, set the DisableIBMJAXWSEngine property in the META-INF/MANIFEST.MF of a WAR file or EJB module to true. Example:

Manifest-Version: 1.0 DisableIBMJAXWSEngine: true

在此页面检查详细信息:使用第三方JAX-WS Web服务引擎

Check for details this page: Using a third-party JAX-WS web services engine

更多推荐

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

本文发布于:2023-10-28 05:19:57,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1535644.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:注释

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!