我有一个JAX-WS服务,可以在我的本地eclipse java 1.6 WAS 8.5.5环境中正常工作,但在实际的WAS测试服务器上会抛出错误。
Handler
类不直接引用或实施ThreadContextMigrator
。
知道可能导致这场冲突的原因是什么?
我定义了一个Handler
,以便为引用的出站客户端请求消息添加安全标头:
WebServiceSecuritySoapHandler implements SOAPHandler<SOAPMessageContext> class
import javax.xml.namespace.QName;
import javax.xml.soap.Name;
import javax.xml.soap.SOAPElement;
import javax.xml.soap.SOAPEnvelope;
import javax.xml.soap.SOAPFactory;
import javax.xml.soap.SOAPHeader;
import javax.xml.ws.handler.soap.SOAPHandler;
import javax.xml.ws.handler.soap.SOAPMessageContext;
import com.ge.business.application.PSApplication;
import com.ge.codes.OULogFileConstants;
import com.ge.system.LogSystem;
import com.ge.util.LogMessageFormatter;
import com.gebank.art.logging.Log;
使用代理
实例Handler
import javax.xml.ws.BindingProvider;
import javax.xml.ws.handler.Handler;
public AnyServicePortSoap1_2Proxy getSoap1_2Proxy() throws Exception{
AnyServicePortTypeSoap12 servicePort = null;
AnyServicePortSoap1_2Proxy anyProxy = new AnyServicePortSoap1_2Proxy();
servicePort = AnyProxy._getDescriptor().getProxy();
BindingProvider bp = (BindingProvider) servicePort;
@SuppressWarnings("rawtypes")
List<Handler> handlerChain = new ArrayList<Handler>();
handlerChain.add(new WebServiceSecuritySoapHandler() );
bp.getBinding().setHandlerChain(handlerChain);
bp.getRequestContext().put( BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getHostParms().getAnyServiceEndPointUrl());
bp.getRequestContext().put("timeout", getConnectionTimeOutLimit());
bp.getRequestContext().put("connection_timeout", getConnectionTimeOutLimit());
return anyProxy;
}
堆栈追踪:
[5/14/15 10:32:56:552 EDT] 000001ba FfdcProvider W com.ibm.ws.ffdc.impl.FfdcProvider logIncident FFDC1003I: FFDC Incident emitted on /opt/was85/app-it1/profiles/p-a85it1-a/logs/ffdc/as-a85it1-a-1-OUappl1-1_239d0479_15.05.14_10.32.56.5493598364447310372030.txt com.ibm.ws.webservices.utils.PluginsUtils.run 88
[5/14/15 10:32:56:536 EDT] 000001ba WASAxis2Confi E WSWS7026E: The 'ThreadContextMigrator' plug-ins cannot load correctly because of the following error: org.apache.axis2.deployment.DeploymentException: WSWS7025E: The com.ibm.ws.wsaddressing.jaxws.converters.AddressingPropertiesMigrator class did not implement the ThreadContextMigrator interface.
at com.ibm.ws.websvcs.deployment.WASAxis2ConfigurationBuilder.discoverTCMPlugins(WASAxis2ConfigurationBuilder.java:1213)
at com.ibm.ws.websvcs.deployment.WASAxis2ConfigurationBuilder.loadAxisClientTCMPlugins(WASAxis2ConfigurationBuilder.java:427)
at com.ibm.ws.websvcs.client.WSClientConfigurationFactory.getConfigContext(WSClientConfigurationFactory.java:298)
at com.ibm.ws.websvcs.client.WSClientConfigurationFactory.getClientConfigurationContext(WSClientConfigurationFactory.java:210)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:92)
at org.apache.axis2.jaxws.description.impl.DescriptionFactoryImpl.createServiceDescription(DescriptionFactoryImpl.java:79)
at org.apache.axis2.jaxws.description.DescriptionFactory.createServiceDescription(DescriptionFactory.java:78)
at org.apache.axis2.jaxws.spi.ServiceDelegate.<init>(ServiceDelegate.java:218)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:83)
at org.apache.axis2.jaxws.spi.Provider.createServiceDelegate(Provider.java:79)
at javax.xml.ws.Service.<init>(Service.java:57)
at com.ge.soa.any.AnyServiceSoap12.<init>(AnyServiceSoap12.java:35)
at com.ge.soa.any.AnyServicePortSoap1_2Proxy$Descriptor.init(AnyServicePortSoap1_2Proxy.java:35)
at com.ge.soa.any.AnyServicePortSoap1_2Proxy$Descriptor.<init>(AnyServicePortSoap1_2Proxy.java:23)
at com.ge.soa.any.AnyServicePortSoap1_2Proxy.<init>(AnyServicePortSoap1_2Proxy.java:83)
at com.ge.OU.soa.RealTimeAnyServiceFacade.getSoap1_2Proxy(RealTimeAnyServiceFacade.java:134)
at com.ge.OU.soa.RealTimeAnyServiceFacade.getAnyStandard(RealTimeAnyServiceFacade.java:271)
at com.ge.OU.commands.rto.RealTimeAnyCommand.retrieveRealTime(RealTimeAnyCommand.java:121)
at com.ge.OU.commands.rto.RealTimeAnyCommand.execute(RealTimeAnyCommand.java:73)
at com.ge.OU.servlets.OUController.performTask(OUController.java:1276)
at com.ge.OU.servlets.OUController.doPost(OUController.java:265)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:595)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:668)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1230)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:779)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:478)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:178)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.invokeFilters(WebAppFilterManager.java:1071)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:87)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:914)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1662)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:200)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:461)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewRequest(HttpInboundLink.java:528)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.processRequest(HttpInboundLink.java:314)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:88)
at com.ibm.ws.ssl.channel.impl.SSLReadServiceContext$SSLReadCompletedCallback.complete(SSLReadServiceContext.java:1818)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:175)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1864)