2 Replies Latest reply on Jan 15, 2012 1:52 PM by 910220

    Problem in invoking a secure weblogic web service from javaws client

    910220
      Hi all,

      the situation is this: there is a secure web service (Wssp1.2-2007-Wss1.1-X509-Basic256.xml policy) which is accessed by a stand-alone remote web service client (swing-enabled) which is initiated via java web start. You'll probably wondering why this is a special case. Let me elaborate...

      The first step was to develop the service and the client. This wasn't much of a trouble, since the documentation was very good apart from creating a ClientBSTCredentialProvider object at the client side. The documentation should explicitly state that the sixth argument, that of the server certificate, is required! In any case, the first step was a success and the invocation was encrypted and signed at the message level.

      The second step was to create a stand-alone remote client, without any local weblogic installation. That was a bit of a problem, since wlfullclient.jar or wseeclient.jar or weblogic.jar were not enough. I should note that the client was created via netbeans 7.0 and not with the help of weblogic clientgen. So, I had to make a verbose run from netbeans, in order to enumerate the jars which are accessed and gather them into the same directory. That was OK too. The standalone client works just fine.

      The third step is to simply (not so simply...) make a java web start version of the client. Since the previous step was a success (having all necessary jars in the same directory) this one should not be a problem. Well... that turned out to be a huge issue. What I get back as the error message (shown in the java web start console) is this:

      java.lang.InternalError: error initializing kernel caused by: java.lang.AssertionError: Duplicate initialization of WorkManager
           at weblogic.work.WorkManagerFactory.set(WorkManagerFactory.java:107)
           at weblogic.work.ExecuteQueueFactory.initialize(ExecuteQueueFactory.java:23)
           at weblogic.kernel.Kernel.initialize(Kernel.java:103)
           at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:64)
           at weblogic.rjvm.wls.WLSRJVMEnvironment.ensureInitialized(WLSRJVMEnvironment.java:50)
           at weblogic.protocol.ProtocolManager$DefaultAdminProtocolMaker.<clinit>(ProtocolManager.java:53)
           at weblogic.protocol.ProtocolManager.getDefaultAdminProtocol(ProtocolManager.java:218)
           at weblogic.protocol.ProtocolHandlerAdmin.<clinit>(ProtocolHandlerAdmin.java:23)
           at weblogic.rjvm.wls.WLSRJVMEnvironment.registerRJVMProtocols(WLSRJVMEnvironment.java:120)
           at weblogic.rjvm.RJVMManager.ensureInitialized(RJVMManager.java:87)
           at weblogic.rjvm.RJVMManager.<clinit>(RJVMManager.java:46)
           at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:97)
           at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:28)
           at weblogic.rjvm.LocalRJVM$LocalRJVMMaker.<clinit>(LocalRJVM.java:31)
           at weblogic.rjvm.LocalRJVM.getLocalRJVM(LocalRJVM.java:72)
           at weblogic.xml.crypto.utils.DOMUtils.generateId(DOMUtils.java:403)
           at weblogic.xml.crypto.utils.DOMUtils.generateId(DOMUtils.java:395)
           at weblogic.xml.crypto.utils.DOMUtils.assignId(DOMUtils.java:374)
           at weblogic.xml.crypto.wss.SecurityBuilderImpl.assignUri(SecurityBuilderImpl.java:148)
           at weblogic.wsee.security.policy.SigningReferencesFactory.getSigningReferences(SigningReferencesFactory.java:100)
           at weblogic.wsee.security.wss.policy.wssp.SigningPolicyBlueprintImpl.addSignatureNodeListToReference(SigningPolicyBlueprintImpl.java:446)
           at weblogic.wsee.security.wss.policy.wssp.SigningPolicyBlueprintImpl.addSignatureNodeListToReference(SigningPolicyBlueprintImpl.java:335)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.resolveSignatureList(SecurityMessageArchitect.java:574)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.resolveSignatureList(SecurityMessageArchitect.java:428)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.constructMessage(SecurityMessageArchitect.java:304)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.buildWssMessage(SecurityMessageArchitect.java:138)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.buildWssMessage(SecurityMessageArchitect.java:121)
           at weblogic.wsee.security.wss.SecurityPolicyArchitect.processOutbound(SecurityPolicyArchitect.java:225)
           at weblogic.wsee.security.wss.SecurityPolicyArchitect.processMessagePolicy(SecurityPolicyArchitect.java:123)
           at weblogic.wsee.security.wss.SecurityPolicyConductor.processRequestOutbound(SecurityPolicyConductor.java:119)
           at weblogic.wsee.security.wss.SecurityPolicyConductor.processRequestOutbound(SecurityPolicyConductor.java:91)
           at weblogic.wsee.security.wssp.handlers.WssClientHandler.processOutbound(WssClientHandler.java:117)
           at weblogic.wsee.security.wssp.handlers.WssClientHandler.processRequest(WssClientHandler.java:69)
           at weblogic.wsee.security.wssp.handlers.WssHandler.handleRequest(WssHandler.java:112)
           at weblogic.wsee.jaxws.framework.jaxrpc.TubeFactory$JAXRPCTube.processRequest(TubeFactory.java:222)
           at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
           at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
           at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
           at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
           at com.sun.xml.ws.client.Stub.process(Stub.java:272)
           at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:153)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:115)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
           at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
           at $Proxy29.fetchCSD(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
           at $Proxy30.fetchCSD(Unknown Source)
           at exchangecsdclient.CSDExchangeClientImpl.fetchCSD(CSDExchangeClientImpl.java:151)
           at pdfutil.PDFUtilApp.initialize(PDFUtilApp.java:55)
           at org.jdesktop.application.Application$1.run(Application.java:170)
           at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
           at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
           at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
           at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
           at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

           at weblogic.kernel.Kernel.ensureInitialized(Kernel.java:66)
           at weblogic.rjvm.wls.WLSRJVMEnvironment.ensureInitialized(WLSRJVMEnvironment.java:50)
           at weblogic.protocol.ProtocolManager$DefaultAdminProtocolMaker.<clinit>(ProtocolManager.java:53)
           at weblogic.protocol.ProtocolManager.getDefaultAdminProtocol(ProtocolManager.java:218)
           at weblogic.protocol.ProtocolHandlerAdmin.<clinit>(ProtocolHandlerAdmin.java:23)
           at weblogic.rjvm.wls.WLSRJVMEnvironment.registerRJVMProtocols(WLSRJVMEnvironment.java:120)
           at weblogic.rjvm.RJVMManager.ensureInitialized(RJVMManager.java:87)
           at weblogic.rjvm.RJVMManager.<clinit>(RJVMManager.java:46)
           at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:97)
           at weblogic.rjvm.LocalRJVM.<init>(LocalRJVM.java:28)
           at weblogic.rjvm.LocalRJVM$LocalRJVMMaker.<clinit>(LocalRJVM.java:31)
           at weblogic.rjvm.LocalRJVM.getLocalRJVM(LocalRJVM.java:72)
           at weblogic.xml.crypto.utils.DOMUtils.generateId(DOMUtils.java:403)
           at weblogic.xml.crypto.utils.DOMUtils.generateId(DOMUtils.java:395)
           at weblogic.xml.crypto.utils.DOMUtils.assignId(DOMUtils.java:374)
           at weblogic.xml.crypto.wss.SecurityBuilderImpl.assignUri(SecurityBuilderImpl.java:148)
           at weblogic.wsee.security.policy.SigningReferencesFactory.getSigningReferences(SigningReferencesFactory.java:100)
           at weblogic.wsee.security.wss.policy.wssp.SigningPolicyBlueprintImpl.addSignatureNodeListToReference(SigningPolicyBlueprintImpl.java:446)
           at weblogic.wsee.security.wss.policy.wssp.SigningPolicyBlueprintImpl.addSignatureNodeListToReference(SigningPolicyBlueprintImpl.java:335)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.resolveSignatureList(SecurityMessageArchitect.java:574)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.resolveSignatureList(SecurityMessageArchitect.java:428)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.constructMessage(SecurityMessageArchitect.java:304)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.buildWssMessage(SecurityMessageArchitect.java:138)
           at weblogic.wsee.security.wss.plan.SecurityMessageArchitect.buildWssMessage(SecurityMessageArchitect.java:121)
           at weblogic.wsee.security.wss.SecurityPolicyArchitect.processOutbound(SecurityPolicyArchitect.java:225)
           at weblogic.wsee.security.wss.SecurityPolicyArchitect.processMessagePolicy(SecurityPolicyArchitect.java:123)
           at weblogic.wsee.security.wss.SecurityPolicyConductor.processRequestOutbound(SecurityPolicyConductor.java:119)
           at weblogic.wsee.security.wss.SecurityPolicyConductor.processRequestOutbound(SecurityPolicyConductor.java:91)
           at weblogic.wsee.security.wssp.handlers.WssClientHandler.processOutbound(WssClientHandler.java:117)
           at weblogic.wsee.security.wssp.handlers.WssClientHandler.processRequest(WssClientHandler.java:69)
           at weblogic.wsee.security.wssp.handlers.WssHandler.handleRequest(WssHandler.java:112)
           at weblogic.wsee.jaxws.framework.jaxrpc.TubeFactory$JAXRPCTube.processRequest(TubeFactory.java:222)
           at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:866)
           at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:815)
           at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:778)
           at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:680)
           at com.sun.xml.ws.client.Stub.process(Stub.java:272)
           at com.sun.xml.ws.client.sei.SEIStub.doProcess(SEIStub.java:153)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:115)
           at com.sun.xml.ws.client.sei.SyncMethodHandler.invoke(SyncMethodHandler.java:95)
           at com.sun.xml.ws.client.sei.SEIStub.invoke(SEIStub.java:136)
           at $Proxy29.fetchCSD(Unknown Source)
           at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
           at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
           at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
           at java.lang.reflect.Method.invoke(Method.java:597)
           at weblogic.wsee.jaxws.spi.ClientInstanceInvocationHandler.invoke(ClientInstanceInvocationHandler.java:84)
           at $Proxy30.fetchCSD(Unknown Source)
           at exchangecsdclient.CSDExchangeClientImpl.fetchCSD(CSDExchangeClientImpl.java:151)
           at pdfutil.PDFUtilApp.initialize(PDFUtilApp.java:55)
           at org.jdesktop.application.Application$1.run(Application.java:170)
           at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
           at java.awt.EventQueue.dispatchEvent(EventQueue.java:597)
           at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:269)
           at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:184)
           at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:174)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:169)
           at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:161)
           at java.awt.EventDispatchThread.run(EventDispatchThread.java:122)

      The two invocations (one using java and the other using javaws) should obviously have not differences at all since all resources (jars) are the same.

      I have tried all client jar combinations (with wlfullclient.jar, wseeclient.jar, weblogic.jar) and the result is the same. One additional piece of information is that when removing all security parameters (message level encryption and signing) from the web service the java web start client works just fine!!!

      This is not an issue of additional jars that somehow mess with weblogic jars, since the same error occurs even in the basic hello world web service.

      I wonder if someone has faced the same problem. I would really really appreciate any help. Thank you in advance and keep up the good work.

      Cheers,
      Paul.

      Edited by: PaulP on Jan 11, 2012 5:31 AM