java.io.UnsupportedEncodingException:不支持的编码utf-8“; action =”

时间:2012-05-04 03:40:52

标签: web-services weblogic cxf jdk1.6 jrockit

我们在weblogic 10.3.0.0中运行了一堆CXF Web服务。

在零星的情况下,看起来网络层无法读取XML流并且weblogic服务器正在抛出 以下错误。我们的服务消费者表示他们正在接收XML流或偶尔读取超时异常。应用程序日志显示java.net.SocketException。 服务消费者也说如果他们提交相同的请求 再次,他们得到了适当的回应,没有任何问题。

以下是问题的日志。这个日志来自weblogic的托管服务器(不是应用程序日志)。另外,我粘贴在标题详细信息下面,以便成功调用。

####<May 3, 2012 6:21:44 PM CDT> <Error> <HTTP> <xxxxxxxx.yyyyyyyy.com> <server2> <[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)'> <<anonymous>> <> <> <1336087304531> <BEA-101108> <[weblogic.servlet.internal.WebAppServletContext@58320dc6 - appName: 'webservice-aa-bb-1', name: 'webservice-aaa', context-path: '/webservice-aaa', spec-version: 'null'] Unsupported encoding: "utf-8";action="" specified.
java.io.UnsupportedEncodingException: Unsupported Encoding utf-8";action="
        at weblogic.servlet.internal.ServletRequestImpl.setCharacterEncoding(ServletRequestImpl.java:428)
        at weblogic.servlet.internal.ServletRequestImpl.initRequestEncoding(ServletRequestImpl.java:1115)
        at weblogic.servlet.internal.ServletRequestImpl.getCharacterEncoding(ServletRequestImpl.java:451)
        at org.apache.cxf.transport.http.HttpServletRequestSnapshot.<init>(HttpServletRequestSnapshot.java:69)
        at org.apache.cxf.transport.http.AbstractHTTPDestination$1.cacheInput(AbstractHTTPDestination.java:245)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.cacheInput(AbstractHTTPDestination.java:441)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:453)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.flushHeaders(AbstractHTTPDestination.java:446)
        at org.apache.cxf.transport.http.AbstractHTTPDestination$WrappedOutputStream.onFirstWrite(AbstractHTTPDestination.java:589)
        at org.apache.cxf.io.AbstractWrappedOutputStream.write(AbstractWrappedOutputStream.java:42)
        at org.apache.cxf.io.CacheAndWriteOutputStream.write(CacheAndWriteOutputStream.java:68)
        at com.ctc.wstx.io.UTF8Writer.flush(UTF8Writer.java:96)
        at com.ctc.wstx.sw.BufferingXmlWriter.flush(BufferingXmlWriter.java:214)
        at com.ctc.wstx.sw.BufferingXmlWriter.close(BufferingXmlWriter.java:194)
        at com.ctc.wstx.sw.BaseStreamWriter.finishDocument(BaseStreamWriter.java:1685)
        at com.ctc.wstx.sw.BaseStreamWriter.writeEndDocument(BaseStreamWriter.java:585)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:282)
        at org.apache.cxf.binding.soap.interceptor.SoapOutInterceptor$SoapOutEndingInterceptor.handleMessage(SoapOutInterceptor.java:270)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:263)
        at org.apache.cxf.interceptor.AbstractFaultChainInitiatorObserver.onMessage(AbstractFaultChainInitiatorObserver.java:104)
        at org.apache.cxf.phase.PhaseInterceptorChain.doIntercept(PhaseInterceptorChain.java:323)
        at org.apache.cxf.transport.ChainInitiationObserver.onMessage(ChainInitiationObserver.java:118)
        at org.apache.cxf.transport.http.AbstractHTTPDestination.invoke(AbstractHTTPDestination.java:208)
        at org.apache.cxf.transport.servlet.ServletController.invokeDestination(ServletController.java:223)
        at org.apache.cxf.transport.servlet.ServletController.invoke(ServletController.java:205)
        at org.apache.cxf.transport.servlet.CXFNonSpringServlet.invoke(CXFNonSpringServlet.java:113)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.handleRequest(AbstractHTTPServlet.java:184)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.doPost(AbstractHTTPServlet.java:107)
        at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
        at org.apache.cxf.transport.servlet.AbstractHTTPServlet.service(AbstractHTTPServlet.java:163)
        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:292)
        at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:175)
        at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3498)
        at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
        at weblogic.security.service.SecurityManager.runAs(Unknown Source)
        at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2180)
        at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2086)
        at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1406)
        at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
        at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)

以下是我们的调试日志中的标题详细信息。这个标题响应了成功的回复。我无法捕获不成功的服务请求的标题。

[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.417: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: Accept : application/soap+xml, multipart/related, text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.418: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: X-dynaTrace : FW0;-705664711;1266;3;964372818;3656;2
[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.418: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: User-Agent : Jakarta Commons-HttpClient/3.1
[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.418: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: Host : abcd.efg.hjk.com
[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.418: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: Content-Length : 496
[________,[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)']:D: 03 18:01:41.419: ResponseTimeInInterceptor.handleMessage: HTTP Header :::::: Content-Type : application/soap+xml;charset="utf-8";action=""

先谢谢。

1 个答案:

答案 0 :(得分:0)

在bin目录下的DOMAIN_HOME中,你应该有一个名为setDomain.env的文件

编辑文件以添加以下行,以便Weblogic支持编码

JAVA_OPTIONS =“$ {JAVA_OPTIONS} -Dfile.encoding = utf8”