web-dev-qa-db-ja.com

Weblogic 12cWebサービスNullPointerException

何らかの理由で、Webサービスを呼び出すと、ローカルのWeblogic12cインストールでNullPointerExceptionがスローされます。同じパッケージがWeblogic12cの別のインスタンスで正しく機能するため、weblogicの構成またはサーバー/ 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によって生成された動的プロキシから例外がスローされるようです)。例外をより詳細にすることはできますか?これはセキュリティの問題でしょうか?しかし、繰り返しになりますが、スタックトレースにはそれを示すものはありません。また、展開ログに例外はありません。

12
Tuomas Toivonen

お役に立てれば :

(MOSC(My Oracle Support Community)からJava.lang.NullPointerException:com.Sun.xml.ws.spi.db.JAXBWrapperAccessor.getPropertyAccessor When Deploying WebService( Doc 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:com.Sun.xml.ws.spi.db.JAXBWrapperAccessor.getPropertyAccessor(JAXBWrapperAccessor.Java:261)at com.Sun.xml.ws.db.toplink.JAXBContextWrapper.getElementPropertyAccessor(JAXBContextWrapper.Java: 170)com.Sun.xml.ws.server.sei.EndpointArgumentsBuilder $ DocLit。(EndpointArgumentsBuilder.Java:598)at com.Sun.xml.ws.server.sei.TieHandler.createArgumentsBuilder(TieHandler.Java:143)at com.Sun.xml.ws.db.DatabindingImpl。(DatabindingImpl.Java:118)のcom.Sun.xml.ws.server.sei.TieHandler。(TieHandler.Java:115)のcom.Sun.xml.ws。 db.DatabindingProviderImpl.create(DatabindingProviderImpl.Java:74)at com.Sun.xml.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.Java:58)at com.Sun.xml.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl。 Java:120)at com.Sun.xml.ws.server.EndpointFactory.createSEIModel(EndpointFactory.Java:521)at com.Sun.xml.ws.server.EndpointFactory.create(EndpointFactory.Java:300)at com.Sun .xml.ws.server.EndpointFactory.crea com.Sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.Java:577)のteEndpoint(EndpointFactory.Java:164)com.Sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint。 Java:560)com.Sun.xml.ws.api.server.WSEndpoint.create(WSEndpoint.Java:639)at weblogic.wsee.jaxws.JAXWSDeployedServlet.getEndpoint(JAXWSDeployedServlet.Java:355)at weblogic.wsee.jaxws .JAXWSServlet.registerEndpoint(JAXWSServlet.Java:167)at weblogic.wsee.jaxws.JAXWSServlet.init(JAXWSServlet.Java:79)at weblogic.wsee.jaxws.JAXWSDeployedServlet.init(JAXWSDeployedServlet.Java:91)atjavax.servlet。 GenericServlet.init(GenericServlet.Java:244)

CAUSE

これは、EclipselinkMOXyプロバイダーの既知の問題です。 XmlElementWrapperアノテーションは無視されます。この問題はBug:16685902で報告されています[ https://support.Oracle.com/epmos/faces/BugDisplay?parent=DOCUMENT&sourceId=2207272.1&id=16685902 ] -WEBSERVICE PARAMETER LIST GIVES NULLPOINTEREXCEPTION AT展開。

SOLUTION

パッチ16685902 [ https://support.Oracle.com/epmos/faces/ui/patch/PatchDetail.jspx?parent=DOCUMENT&sourceId=2207272.1&patchId=16685902 ]をWebLogic Server12.1.1に適用します。回避策として、以下を実行して、WebLogicでEclipselinkMOXyプロバイダーを使用しないようにします。

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 ] -WebサービスパラメータリストはNULLPOINTEREXCEPTIONを提供しますAT

4
Barbaros Özhan

これは、言及されたバグである必要はありません。そのバグは12.1.3以降解決されています

上記の回避策は機能しますが(JAXBプロバイダーの変更)、PRE_CLASSPATH変数をハードコーディングするのは悪い解決策です(おそらく開発環境の場合のみ)。

バージョン12.1.1以降のWeblogicは、デフォルトのJAXBプロバイダーをGlassfishRIからEclipseMOXyに変更しました。その後、Glassfishを再度構成してJava Service Provider Interface(SPI)

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

このようにして、本当の根本原因を確認できます。私たちの場合、重複したクラス(JAXBで作成され、属性は異なるがパッケージ/名前空間は同じ)に関する問題でした。

0
devwebcl