1
  • Weblogic 11g (10.3.5)
  • Spring 框架 3.1.3
  • Spring Web 服务 2.1.1

在 Weblogic 上运行的 Spring-ws Web 服务。相同的 Web 服务在 Tomcat 和 Spring vFabric 中运行良好,但在 Weblogic 下抛出了这些神秘的异常。我的实现代码永远不会在 Weblogic 上到达,而是在解组过程中的某个时候请求处理会中断。我试图通过这个问题进行调试,但有两个因素使问题复杂化。首先,解组器来自 Weblogic,这意味着我没有来源。其次,主要异常来自 java.net.URL,Eclipse 调试器似乎无法检查局部变量值。

这是堆栈跟踪,其中包含跟踪级别的日志。

2013-02-07 13:45:24,523 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Received request [<?xml version="1.0" encoding="UTF-8" standalone="yes"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://subdomain.example.com/services/">
   <soapenv:Header/>
   <soapenv:Body>
      <ser:SearchRequest>
         <ser:documentType>Email</ser:documentType>
         <ser:lineOfBusiness>TestLOB</ser:lineOfBusiness>
         <ser:businessKey>
            <ser:keyName>TestCode</ser:keyName>
            <ser:value>00000</ser:value>
         </ser:businessKey>
         <ser:dateCreated>
            <ser:startDate/>
            <ser:length/>
         </ser:dateCreated>
      </ser:SearchRequest>
   </soapenv:Body>
</soapenv:Envelope>]
2013-02-07 13:45:24,538 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - SOAPElement [weblogic.webservice.core.soap.SOAPBodyImpl] implements SAAJ 1.1
2013-02-07 13:45:24,554 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Looking up endpoint for [{http://ecm.cinfin.com/services/}SearchRequest]
2013-02-07 13:45:24,554 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Endpoint mapping [org.springframework.ws.server.endpoint.mapping.PayloadRootAnnotationMethodEndpointMapping@1587368] maps request to endpoint [public com.example.subdomain.services.model.SearchResponse com.example.subdomain.services.search.endpoint.SearchEndpoint.handleSearch(com.example.subdomain.services.model.SearchRequest)]
2013-02-07 13:45:24,570 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - SOAPElement [weblogic.webservice.core.soap.SOAPHeaderImpl] implements SAAJ 1.1
2013-02-07 13:45:24,570 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Testing endpoint adapter [org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter@f24611]
2013-02-07 13:45:24,570 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.server.endpoint.adapter.method.MessageContextMethodArgumentResolver@1d60bb4] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,570 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.server.endpoint.adapter.method.XPathParamMethodArgumentResolver@19a6ada] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,585 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.soap.server.endpoint.adapter.method.SoapMethodArgumentResolver@1d06ba9] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,585 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.server.endpoint.adapter.method.dom.DomPayloadMethodProcessor@4c61b3] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,585 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.server.endpoint.adapter.method.SourcePayloadMethodProcessor@a2392e] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,585 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] TRACE  - Testing if argument resolver [org.springframework.ws.server.endpoint.adapter.method.jaxb.XmlRootElementPayloadMethodProcessor@580cc5] supports [class com.example.subdomain.services.model.SearchRequest]
2013-02-07 13:45:24,601 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Returning cached instance of singleton bean 'searchEndpoint'
2013-02-07 13:45:24,601 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Resolving exception from endpoint [public com.example.subdomain.services.model.SearchResponse com.example.subdomain.services.search.endpoint.SearchEndpoint.handleSearch(com.example.subdomain.services.model.SearchRequest)]: javax.xml.bind.UnmarshalException
 - with linked exception:
[java.net.MalformedURLException]
2013-02-07 13:45:24,601 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Returning cached instance of singleton bean 'searchEndpoint'
2013-02-07 13:45:24,601 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Resolving exception from endpoint [public com.example.subdomain.services.model.SearchResponse com.example.subdomain.services.search.endpoint.SearchEndpoint.handleSearch(com.example.subdomain.services.model.SearchRequest)]: javax.xml.bind.UnmarshalException
 - with linked exception:
[java.net.MalformedURLException]
2013-02-07 13:45:24,616 [[ACTIVE] ExecuteThread: '18' for queue: 'weblogic.kernel.Default (self-tuning)' :: 127.0.0.1] DEBUG  - Endpoint invocation resulted in exception - responding with Fault
javax.xml.bind.UnmarshalException: null
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:213) ~[glassfish.jaxb_1.0.0.0_2-1-12.jar:2.1.12]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:184) ~[glassfish.jaxb_1.0.0.0_2-1-12.jar:2.1.12]
    at javax.xml.bind.helpers.AbstractUnmarshallerImpl.unmarshal(AbstractUnmarshallerImpl.java:137) ~[na:1.6.0_24]
    at org.springframework.ws.server.endpoint.adapter.method.jaxb.AbstractJaxb2PayloadMethodProcessor$Jaxb2SourceCallback.saxSource(AbstractJaxb2PayloadMethodProcessor.java:239) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.xml.transform.TraxUtils.doWithSource(TraxUtils.java:103) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.endpoint.adapter.method.jaxb.AbstractJaxb2PayloadMethodProcessor.unmarshalFromRequestPayload(AbstractJaxb2PayloadMethodProcessor.java:125) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.endpoint.adapter.method.jaxb.XmlRootElementPayloadMethodProcessor.resolveArgument(XmlRootElementPayloadMethodProcessor.java:49) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.getMethodArguments(DefaultMethodEndpointAdapter.java:259) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.endpoint.adapter.DefaultMethodEndpointAdapter.invokeInternal(DefaultMethodEndpointAdapter.java:220) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.endpoint.adapter.AbstractMethodEndpointAdapter.invoke(AbstractMethodEndpointAdapter.java:53) ~[spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.MessageDispatcher.dispatch(MessageDispatcher.java:233) [spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.server.MessageDispatcher.receive(MessageDispatcher.java:173) [spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.transport.support.WebServiceMessageReceiverObjectSupport.handleConnection(WebServiceMessageReceiverObjectSupport.java:88) [spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.ws.transport.http.WebServiceMessageReceiverHandlerAdapter.handle(WebServiceMessageReceiverHandlerAdapter.java:59) [spring-ws-2.1.1.RELEASE-all.jar:2.1.1.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:923) [spring-webmvc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:852) [spring-webmvc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:882) [spring-webmvc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:789) [spring-webmvc-3.1.3.RELEASE.jar:3.1.3.RELEASE]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:727) [javax.servlet_1.0.0.0_2-5.jar:2.5]
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) [javax.servlet_1.0.0.0_2-5.jar:2.5]
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:300) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.RequestEventsFilter.doFilter(RequestEventsFilter.java:27) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3715) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3681) [weblogic.jar:10.3.5.0]
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321) [com.bea.core.weblogic.security.identity_1.1.2.1.jar:1.1.2.1]
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120) [com.bea.core.weblogic.security.wls_1.0.0.0_6-1-0-0.jar:6.1.0.0]
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2277) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2183) [weblogic.jar:10.3.5.0]
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1454) [weblogic.jar:10.3.5.0]
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:209) [com.bea.core.weblogic.workmanager_1.10.0.0.jar:1.10.0.0]
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:178) [com.bea.core.weblogic.workmanager_1.10.0.0.jar:1.10.0.0]
Caused by: java.net.MalformedURLException: null
    at java.net.URL.<init>(URL.java:601) ~[na:1.6.0_24]
    at java.net.URL.<init>(URL.java:464) ~[na:1.6.0_24]
    at java.net.URL.<init>(URL.java:413) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.impl.XMLEntityManager.setupCurrentEntity(XMLEntityManager.java:650) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.impl.XMLVersionDetector.determineDocVersion(XMLVersionDetector.java:186) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:772) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1205) ~[na:1.6.0_24]
    at com.sun.org.apache.xerces.internal.jaxp.SAXParserImpl$JAXPSAXParser.parse(SAXParserImpl.java:522) ~[na:1.6.0_24]
    at weblogic.xml.jaxp.WebLogicXMLReader.parse(WebLogicXMLReader.java:133) ~[weblogic.jar:10.3.5.0]
    at weblogic.xml.jaxp.RegistryXMLReader.parse(RegistryXMLReader.java:173) ~[weblogic.jar:10.3.5.0]
    at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:211) ~[glassfish.jaxb_1.0.0.0_2-1-12.jar:2.1.12]
    ... 35 common frames omitted
4

3 回答 3

2

问题是 WLS 10.3.5 带有自己的 Spring 版本 2.5.6.SEC01。因此默认情况下,WLS 始终使用该版本,因为它是由更高的类加载器加载的。这可能会导致您看到 UnmarshalException。

您的 Spring 库是在 WebLogic 应用程序 APP-INF/lib 中还是您的 Web 应用程序 WEB-INF/lib 中?如果 spring 3.1.3 在应用程序级别,则需要使用以下条目创建 weblogic-application.xml

<?xml version="1.0" encoding="UTF-8"?>
<weblogic-application>
    <prefer-application-packages>
        <package-name>org.apache.*</package-name>
        <package-name>org.springframework.*</package-name>
    </prefer-application-packages>
</weblogic-application>

如果是在 Web 应用程序级别,请将以下条目添加到 weblogic.xml

<prefer-web-inf-classes>true<prefer-web-inf-classes>
于 2013-02-07T20:03:15.773 回答
1

显然,这种异常是从 WebLogic 部署中引发的,这些部署在安装目录路径或包含的库路径中都有一个空格。请检查您的路径。解决此问题的方法是在没有空格的路径上重新安装和/或将您的库移动到其中没有空格的路径。

Oracle 网站上的相关论坛讨论。

于 2013-02-07T20:03:08.083 回答
1

我能够解决这个问题。类加载似乎确实是罪魁祸首,但它与捆绑的 Spring 或安装路径没有任何关系。相反,我为 Spring 的 SaajSoapMessageFactory 定义了一个显式消息工厂。工厂方法 onjavax.xml.soap.MessageFactory似乎一直在抛出异常,但也被证明是完全没有必要的。我从配置中删除了这个 bean,一切都很好。

于 2013-02-18T13:11:18.993 回答