Weblogic 12c Web服务NullPointerException

时间:2017-08-17 10:36:08

标签: java web-services java-ee weblogic jax-ws

由于某种原因,Web Service的调用会在我的本地Weblogic 12c安装上抛出NullPointerException。相同的包在另一个Weblogic 12c实例上正常工作,因此我的weblogic配置或server / java启动参数一定有问题。但是,我无法弄清楚有什么区别,服务器日志消息根本没有帮助。当然,我们也使用相同的JRE和类路径库。

这是例外

####<8.8.2017, 2:10:53,106 ip. EEST> <Error> <com.sun.xml.ws.server.sei.TieHandler> <IT-V-R90HKRNH> <is-mansrv> <[ACTIVE] ExecuteThread: '6' for queue: 'weblogic.kernel.Default (self-tuning)'> <HekoPassi> <> <46eb29b8-cb8a-44a9-94ed-e223acc07388-0000005d> <1502190653106> <[severity-value: 8] [rid: 0] [partition-id: 0] [partition-name: DOMAIN] > <BEA-000000> <null
java.lang.NullPointerException
    at weblogic.ejb.container.internal.BaseWSLocalObject.__WL_preInvoke(BaseWSLocalObject.java:85)
    at com.foo.bar.service.sessionfacade.SessionFacadeBean_afdkf0_WSOImpl.__WL_getPublicKey_WS_preInvoke(Unknown Source)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at weblogic.wsee.server.ejb.WsEjb.preInvoke(WsEjb.java:50)
    at weblogic.wsee.jaxws.WLSEjbInstanceResolver$WLSEjbInvoker.invoke(WLSEjbInstanceResolver.java:193)
    at weblogic.wsee.jaxws.WLSInstanceResolver$WLSInvoker.invoke(WLSInstanceResolver.java:93)
    at com.sun.xml.ws.server.InvokerTube$2.invoke(InvokerTube.java:149)
    at com.sun.xml.ws.server.sei.SEIInvokerTube.processRequest(SEIInvokerTube.java:88)
    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:1136)
    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:1050)
    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:1019)
    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:877)
    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:419)
    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdapter.java:868)
    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:422)
    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAdapter.java:169)
    at weblogic.wsee.jaxws.WLSServletAdapter.handle(WLSServletAdapter.java:229)
    at weblogic.wsee.jaxws.HttpServletAdapter$AuthorizedInvoke.run(HttpServletAdapter.java:667)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:368)
    at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:163)
    at weblogic.wsee.util.ServerSecurityHelper.authenticatedInvoke(ServerSecurityHelper.java:108)
    at weblogic.wsee.jaxws.HttpServletAdapter$3.run(HttpServletAdapter.java:286)
    at weblogic.wsee.jaxws.HttpServletAdapter.post(HttpServletAdapter.java:295)
    at weblogic.wsee.jaxws.JAXWSServlet.doRequest(JAXWSServlet.java:128)
    at weblogic.servlet.http.AbstractAsyncServlet.service(AbstractAsyncServlet.java:103)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:286)
    at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:260)
    at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:137)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:350)
    at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:247)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.wrapRun(WebAppServletContext.java:3679)
    at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3649)
    at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:326)
    at weblogic.security.service.SecurityManager.runAsForUserCode(SecurityManager.java:197)
    at weblogic.servlet.provider.WlsSecurityProvider.runAsForUserCode(WlsSecurityProvider.java:203)
    at weblogic.servlet.provider.WlsSubjectHandle.run(WlsSubjectHandle.java:71)
    at weblogic.servlet.internal.WebAppServletContext.doSecuredExecute(WebAppServletContext.java:2433)
    at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2281)
    at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2259)
    at weblogic.servlet.internal.ServletRequestImpl.runInternal(ServletRequestImpl.java:1691)
    at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1651)
    at weblogic.servlet.provider.ContainerSupportProviderImpl$WlsRequestExecutor.run(ContainerSupportProviderImpl.java:270)
    at weblogic.invocation.ComponentInvocationContextManager._runAs(ComponentInvocationContextManager.java:348)
    at weblogic.invocation.ComponentInvocationContextManager.runAs(ComponentInvocationContextManager.java:333)
    at weblogic.work.LivePartitionUtility.doRunWorkUnderContext(LivePartitionUtility.java:54)
    at weblogic.work.PartitionUtility.runWorkUnderContext(PartitionUtility.java:41)
    at weblogic.work.SelfTuningWorkManagerImpl.runWorkUnderContext(SelfTuningWorkManagerImpl.java:640)
    at weblogic.work.ExecuteThread.execute(ExecuteThread.java:406)
    at weblogic.work.ExecuteThread.run(ExecuteThread.java:346)

任何可能导致此异常的原因(或者我如何调试它,似乎异常是从weblogic生成的动态代理抛出的,在控件甚至进入实现类之前)。我可以使例外更详细吗?这可能是一个安全问题吗?但话说回来,堆栈跟踪中没有任何内容表明这一点。此外,部署日志中没有例外。

2 个答案:

答案 0 :(得分:4)

希望这会有所帮助:

(来自MOSC(My Oracle Support社区)java.lang.NullPointerException:com.sun.xml.ws.spi.db.JAXBWrapperAccessor.getPropertyAccessor部署WebService时(文档ID 2207272.1))

APPLIES TO:
  

Oracle WebLogic Server - 版本12.1.1.0至12.2.1.2.0 [版本12c]   本文档中的信息适用于任何平台。

SYMPTOMS
  

尝试使用以下内容部署Web服务应用程序时   示例代码段,

@WebService
public interface HelloServiceInterface {
@WebMethod
@RequestWrapper(className = "hello.HelloRequest")
public String hello(@WebParam(name = "names") List<String> names);

发生以下错误:

  

java.lang.NullPointerException:at   com.sun.xml.ws.spi.db.JAXBWrapperAccessor.getPropertyAccessor(JAXBWrapperAccessor.java:261)   在   com.sun.xml.ws.db.toplink.JAXBContextWrapper.getElementPropertyAccessor(JAXBContextWrapper.java:170)   在   com.sun.xml.ws.server.sei.EndpointArgumentsBuilder $ DocLit。(EndpointArgumentsBuilder.java:598)   在   com.sun.xml.ws.server.sei.TieHandler.createArgumentsBuilder(TieHandler.java:143)   在com.sun.xml.ws.server.sei.TieHandler。(TieHandler.java:115)at   com.sun.xml.ws.db.DatabindingImpl。(DatabindingImpl.java:118)at   com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:74)   在   com.sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:58)   在   com.sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:120)   在   com.sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.java:521)   在   com.sun.xml.ws.server.EndpointFactory.create(EndpointFactory.java:300)   在   com.sun.xml.ws.server.EndpointFactory.createEndpoint(EndpointFactory.java:164)   在com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:577)at   com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:560)at at   com.sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.java:639)at at   weblogic.wsee.jaxws.JAXWSDeployedServlet.getEndpoint(JAXWSDeployedServlet.java:355)   在   weblogic.wsee.jaxws.JAXWSServlet.registerEndpoint(JAXWSServlet.java:167)   在weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.java:79)at at   weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.java:91)   在javax.servlet.GenericServlet.init(GenericServlet.java:244)

CAUSE
  

这是Eclipselink MOXy提供商的已知问题。   XmlElementWrapper注释被忽略。该问题在报道中   错误:16685902 [https://support.oracle.com/epmos/faces/BugDisplay?parent=DOCUMENT&sourceId=2207272.1&id=16685902] - WEBSERVICE PARAMETER LIST GIVES   部署时的NULLPOINTEREXCEPTION。

SOLUTION
  

将修补程序16685902 [https://support.oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&sourceId=2207272.1&patchId=16685902]应用于WebLogic Server 12.1.1。作为一种解决方法,请避免   通过以下操作在WebLogic中使用Eclipselink MOXy提供程序:

     

设置PRE_CLASSPATH =%WLS%\ modules \ databinding.override_1.0.0.0.jar

REFERENCES
  

BUG:16685902 [https://support.oracle.com/epmos/faces/BugDisplay?parent=DOCUMENT&sourceId=2207272.1&id=16685902] - WEBSERVICE参数列表给出了NULLPOINTEREXCEPTION   DEPLOYMENT

答案 1 :(得分:0)

这不是必需的错误。自12.1.3起,该错误已解决

上述解决方法可以工作(更改JAXB Provider),但是对于df['decimal'] = df['decimal'].astype(str).str.zfill(2) 变量中的硬编码(可能仅用于开发环境)来说,这是一个糟糕的解决方案。

自版本12.1.1开始,Weblogic将默认的JAXB提供程序从Glassfish RI更改为Eclipse MOXy,然后您可以再次使用Glassfish配置Java服务提供程序接口(SPI)

https://docs.oracle.com/middleware/1213/wls/WSGET/jax-ws-datatypes.htm#WSGET345

这样,您可以查看真正的根本原因。在我们的案例中,这是一个关于重复类的问题(使用JAXB创建,并且具有不同的属性,但包/名称空间相同)。