在weblogic 中,调用接口解析Javabean成xml报文,报以下错误,经测试在windows 和虚拟机centos 中,无此问题,但是部署到正式环境中(联通云平台)就会报错,不知道为什么,求助大神
org.xml.sax.SAXException: The character '?' is an invalid XML character
java.io.IOException: The character '?' is an invalid XML character
at org.apache.xml.serialize.BaseMarkupSerializer.characters(Unknown Source)
at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
at org.exolab.castor.xml.Marshaller.marshal(Unknown Source)
at com.ai.netweb.protocol.header.Response.marshal(Response.java:91)
at com.ai.netweb.protocol.header.Response.toXMLString(Response.java:154)
at com.ai.commonframe.action.common.ExecuteActionCommand.executeCommand(ExecuteActionCommand.java:239)
at com.ai.commonframe.action.common.Service.parseXMLAdapter(Service.java:214)
at com.ai.commonframe.action.common.Service.doPost(Service.java:116)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:820)
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:301)
at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:96)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3730)
at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3696)
at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:120)
at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2273)
at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2179)
at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1490)
at weblogic.work.ExecuteThread.execute(ExecuteThread.java:256)
at weblogic.work.ExecuteThread.run(ExecuteThread.java:221)
Caused by: java.io.IOException: The character '?' is an invalid XML character
at org.apache.xml.serialize.BaseMarkupSerializer.fatalError(Unknown Source)
at org.apache.xml.serialize.XMLSerializer.printText(Unknown Source)
... 29 more
经过各种测试把jar包优先放到domain下的lib中,并在启动脚本末尾增加
在 bin/startWeblogic.sh 最后添加-Dweblogic.ext.dir=.../lib
-Dweblogic.ext.dirs=/data/weblogic/Oracle/Middleware/user_projects/domains/base_domain/lib