Java webservice 500连接异常和不支持操作异常

Java webservice 500连接异常和不支持操作异常,java,web-services,soap,cxf,weblogic9.x,Java,Web Services,Soap,Cxf,Weblogic9.x,我正在研究基于SOAP的web服务。我需要测试一个场景,如果webservice连接错误是由于任何网络问题或登录问题引起的 ApacheCXF的问题在于,无论Web服务引发什么异常 "java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1". 错误响应代码返回500,但堆栈跟踪显示“UnsupportedPertaionException”。我可以捕获异常并打印堆栈跟踪,但我需要知道是连接错误

我正在研究基于SOAP的web服务。我需要测试一个场景,如果webservice连接错误是由于任何网络问题或登录问题引起的

ApacheCXF的问题在于,无论Web服务引发什么异常

 "java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1".
错误响应代码返回500,但堆栈跟踪显示“UnsupportedPertaionException”。我可以捕获异常并打印堆栈跟踪,但我需要知道是连接错误还是其他错误。错误日志如下所示

    ID: 12117
Response-Code: 500
Encoding: UTF-8
Content-Type: application/soap+xml; charset=utf-8
Headers: {connection=[close], Content-Length=[6380], content-type=[application/soap+xml; charset=utf-8], Date=[Fri, 27 Feb 2015 16:43:47 GMT], Server=[Microsoft-HTTPAPI/2.0]}
Payload: <s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:a="http://www.w3.org/2005/08/addressing"><s:Header><a:Action s:mustUnderstand="1">http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/fault</a:Action><a:RelatesTo>urn:uuid:9f063eed-af54-4074-86cf-35f360a6e4d0</a:RelatesTo></s:Header><s:Body><s:Fault><s:Code><s:Value>s:Receiver</s:Value><s:Subcode><s:Value xmlns:a="http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher">a:InternalServiceFault</s:Value></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en-US">A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.)</s:Text></s:Reason><s:Detail><ExceptionDetail xmlns="http://schemas.datacontract.org/2004/07/System.ServiceModel" xmlns:i="http://www.w3.org/2001/XMLSchema-instance"><HelpLink i:nil="true"/><InnerException><HelpLink i:nil="true"/><InnerException i:nil="true"/><Message>The wait operation timed out</Message><StackTrace i:nil="true"/><Type>System.ComponentModel.Win32Exception</Type></InnerException><Message>A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 0 - The wait operation timed out.)</Message><StackTrace>   at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)&#xD;
   at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)&#xD;
   at System.Data.SqlClient.TdsParser.Connect(ServerInfo serverInfo, SqlInternalConnectionTds connHandler, Boolean ignoreSniOpenTimeout, Int64 timerExpire, Boolean encrypt, Boolean trustServerCert, Boolean integratedSecurity, Boolean withFailover)&#xD;
   at System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean ignoreSniOpenTimeout, TimeoutTimer timeout, Boolean withFailover)&#xD;
   at System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(ServerInfo serverInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString connectionOptions, SqlCredential credential, TimeoutTimer timeout)&#xD;
   at System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(TimeoutTimer timeout, SqlConnectionString connectionOptions, SqlCredential credential, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance)&#xD;
   at System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, SqlCredential credential, Object providerInfo, String newPassword, SecureString newSecurePassword, Boolean redirectedUserInstance, SqlConnectionString userConnectionOptions, SessionData reconnectSessionData)&#xD;
   at System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, DbConnectionPoolKey poolKey, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection, DbConnectionOptions userOptions)&#xD;
   at System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool pool, DbConnection owningObject, DbConnectionOptions options, DbConnectionPoolKey poolKey, DbConnectionOptions userOptions)&#xD;
   at System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)&#xD;
   at System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject, DbConnectionOptions userOptions, DbConnectionInternal oldConnection)&#xD;
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, UInt32 waitForMultipleObjectsTimeout, Boolean allowCreate, Boolean onlyOneCheckConnection, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection)&#xD;
   at System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal&amp; connection)&#xD;
   at System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection, TaskCompletionSource`1 retry, DbConnectionOptions userOptions, DbConnectionInternal oldConnection, DbConnectionInternal&amp; connection)&#xD;
   at System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection, DbConnectionFactory connectionFactory, TaskCompletionSource`1 retry, DbConnectionOptions userOptions)&#xD;
   at System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1 retry)&#xD;
   at System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1 retry)&#xD;
   at System.Data.SqlClient.SqlConnection.Open()&#xD;
   at BB.Core.Libraries.Data.DataContext.Connect(IsolationLevel isolationLevel, Boolean useTransaction)&#xD;
   at BB.EBT.Libraries.Services.UniversalInterface2012.GetMissingData(String&amp; houseHoldId, Decimal&amp; cardNumber)&#xD;
   at BB.EBT.Libraries.Services.UniversalInterface2012.AddUpdateBenefits(String ActionCode, String CardNumber, String WICMISAccountID, String ReasonCode, List`1 MonthlyFoodBenefits, MessageHeader MessageHeader)&#xD;
   at SyncInvokeAddUpdateBenefits(Object , Object[] , Object[] )&#xD;
   at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]&amp; outputs)&#xD;
   at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc&amp; rpc)&#xD;
   at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)</StackTrace><Type>System.Data.SqlClient.SqlException</Type></ExceptionDetail></s:Detail></s:Fault></s:Body></s:Envelope>
--------------------------------------]
java.lang.UnsupportedOperationException: This class does not support SAAJ 1.1
    at weblogic.webservice.core.soap.SOAPElementImpl.getNamespaceURI(SOAPElementImpl.java:496)
    at org.apache.cxf.jaxws.JaxWsClientProxy.createSoapFault(JaxWsClientProxy.java:208)
    at org.apache.cxf.jaxws.JaxWsClientProxy.invoke(JaxWsClientProxy.java:154)
    at $Proxy97.addUpdateBenefits(Unknown Source)
    at gov.mass.eos.web.service.wiccardclient.EWICCardServiceClient.addUpdateBenefits(EWICCardServiceClient.java:168)
    at gov.mass.eos.web.service.wiccardclient.EWICCardServiceClient.addBenefits(EWICCardServiceClient.java:132)
    at gov.mass.eos.web.controllers.ce.benefits.EBenefitPreparationUtils.processBenefitsIssue(EBenefitPreparationUtils.java:108)
    at gov.mass.eos.web.controllers.ce.benefits.EIssueController.issueBenefits(EIssueController.java:501)
    at sun.reflect.GeneratedMethodAccessor184377.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:138)
    at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:62)
    at javax.faces.component.UICommand.broadcast(UICommand.java:106)
    at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:110)
    at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:184)
    at org.apache.myfaces.lifecycle.LifecycleImpl.invokeApplication(LifecycleImpl.java:271)
    at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:102)
    at javax.faces.webapp.FacesServlet.service(FacesServlet.java:109)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:283)
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at com.sun.identity.agents.filter.AmAgentBaseFilter.allowRequestToContinue(AmAgentBaseFilter.java:87)
    at com.sun.identity.agents.filter.AmAgentBaseFilter.doFilter(AmAgentBaseFilter.java:43)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at gov.mass.eos.web.servlet.filter.Log4jFilter.doFilter(Log4jFilter.java:138)
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:42)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3242)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2010)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1916)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1366)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:181)
[27 Feb 2015 11:43:46,700] [ERROR] [EosRTException] [This class does not support SAAJ 1.1]
gov.mass.eos.common.exception.EosRTException.
ID:12117
响应代码:500
编码:UTF-8
内容类型:应用程序/soap+xml;字符集=utf-8
标题:{connection=[close],Content Length=[6380],Content type=[application/soap+xml;charset=utf-8],Date=[Fri,2015年2月27日16:43:47 GMT],Server=[Microsoft HTTPAPI/2.0]}
有效载荷:http://schemas.microsoft.com/net/2005/12/windowscommunicationfoundation/dispatcher/faulturn:uuid:9f063eed-af54-4074-86cf-35f360a6e4d0s:Receivera:InternalServiceFault建立到SQL Server的连接时发生与网络相关或特定于实例的错误。找不到服务器或无法访问服务器。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。(提供程序:TCP提供程序,错误:0-等待操作超时。)等待操作超时System.ComponentModel.Win32Exception建立与SQL Server的连接时发生网络相关或特定于实例的错误。找不到服务器或无法访问服务器。验证实例名称是否正确,以及SQL Server是否配置为允许远程连接。(提供程序:TCP提供程序,错误:0-等待操作超时。)在System.Data.SqlClient.SqlInternalConnection.OneError(SqlException异常,布尔断开连接,操作'1 wrapCloseInAction)
;
在System.Data.SqlClient.TdsParser.ThroweException和Warning(TdsParserStateObject stateObj,布尔调用连接锁,布尔异步关闭)和#xD;
在System.Data.SqlClient.TdsParser.Connect(ServerInfo ServerInfo,sqlinternalconnectionds connHandler,Boolean ignoresnopentimeout,Int64 timerExpire,Boolean encrypt,Boolean trustServerCert,Boolean integratedSecurity,Boolean with failover)和#xD;
在System.Data.SqlClient.SqlInternalConnectionDS.AttemptOneLogin(ServerInfo ServerInfo、String newPassword、SecureString newSecurePassword、Boolean IgnoresInOpenTimeout、TimeoutTimer timeout、Boolean withFailover)和#xD;
在System.Data.SqlClient.SqlInternalConnectionDS.LoginOfAliver(ServerInfo服务器信息、String新密码、SecureString newSecurePassword、Boolean redirectedUserInstance、SqlConnectionString连接选项、SqlCredential凭证、TimeoutTimer超时)和#xD;
在System.Data.SqlClient.SqlInternalConnectionDS.OpenLoginList(超时超时、SqlConnectionString连接选项、SqlCredential凭证、字符串新密码、SecureString NewSecureUserAssword、布尔重定向EduceResInstance)和;
在System.Data.SqlClient.SqlInternalConnectionDS..ctor(DbConnectionPoolIdentity、SqlConnectionString connectionOptions、SqlCredential凭证、对象提供信息、String newPassword、SecureString newSecurePassword、Boolean RedirectedUserConnectionInstance、SqlConnectionString userConnectionOptions、SessionData reconnectSessionData)和#xD;
在System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions选项、DbConnectionPoolKey poolKey、Object poolGroupProviderInfo、DbConnectionPool池、DbConnectionOwningConnection、DbConnectionOptions用户选项)和#xD;
在System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnectionPool池、DbConnectionOwningObject、DbConnectionOptions选项、DbConnectionPoolKey池键、DbConnectionOptions用户选项)和;
在System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject、DbConnectionOptions userOptions、DbConnectionInternal oldConnection)和#xD;
位于System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject、DbConnectionOptions userOptions、DbConnectionInternal oldConnection)和#xD;
在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject、UInt32 waitForMultipleObjectsTimeout、Boolean allowCreate、Boolean OnlyOnEckConnection、DbConnectionOptions userOptions、DbConnectionInternal&;connection)和#xD;
在System.Data.ProviderBase.DbConnectionPool.TryGetConnection(DbConnection owningObject、TaskCompletionSource`1重试、DbConnectionOptions用户选项、DbConnectionInternal&;connection)和;
在System.Data.ProviderBase.DbConnectionFactory.TryGetConnection(DbConnection owningConnection、TaskCompletionSource`1重试、DbConnectionOptions用户选项、DbConnectionInternal oldConnection、DbConnectionInternal&;connection)和;
在System.Data.ProviderBase.DbConnectionInternal.TryOpenConnectionInternal(DbConnection outerConnection、DbConnectionFactory connectionFactory、TaskCompletionSource`1 retry、DbConnectionOptions userOptions)和xD;
在System.Data.SqlClient.SqlConnection.TryOpenInner(TaskCompletionSource`1重试)和#xD;
在System.Data.SqlClient.SqlConnection.TryOpen(TaskCompletionSource`1重试)和#xD;
在System.Data.SqlClient.SqlConnection.Open()和#xD;
在BB.Core.Libraries.Data.DataContext.Connect(IsolationLevel-IsolationLevel,Boolean-usetransation)和xD;
在BB.EBT.Libraries.Services.UniversalInterface2012.GetMissingData(String&;houseHoldId,Decimal&;cardNumber)和xD;
在BB.EBT.Libraries.Services.UniversalInterface2012.AddUpdateBenefits(字符串操作码、字符串卡号、字符串wicmisaccounted、字符串原因码、列表'1个月的商品好处、消息头消息头)&xD;
在SyncInvokeAddUpdateBenefits(对象,对象[],对象[])和#xD;
在System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(对象实例、对象[]输入、对象[]输出)和#xD;
在System.ServiceModel.Dispatc
SOAPMessage sm = MessageFactory.newInstance(SOAPConstants.SOAP_1_2_PROTOCOL).createMessage();