gpt4 book ai didi

java - 为什么这个解码器会抛出 MalformedURLException?

转载 作者:行者123 更新时间:2023-11-29 03:37:28 29 4
gpt4 key购买 nike

  • 网络逻辑 11g (10.3.5)
  • Spring 框架 3.1.3
  • Spring 网络服务 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

最佳答案

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

你的spring库是在WebLogic Application APP-INF/lib 还是你的web application WEB-INF/lib?如果spring 3.1.3是在application级别,你需要创建一个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>

关于java - 为什么这个解码器会抛出 MalformedURLException?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14759137/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com