1 2 3 4 Previous Next 57 Replies Latest reply: Jun 9, 2010 10:51 AM by Stefan Guilhen RSS

    Classcast exception while executing WSTrustClientTest

    Rashmi Rajappa Newbie

      Hi All,

       

      I'm using picketlink-build-jbas-1.0.3.CR1.zip (from http://www.jboss.org/picketlink/downloads.html) on JBAS 5.1.0 with JDK6.

      After downloading JBAS5.1.0 i followed the steps mentioned here http://community.jboss.org/wiki/JBossWS-Installation to add on JAXWS Metro capability to JBAS.

      Followed the steps mentioned here http://community.jboss.org/wiki/PicketLinkSecurityTokenService for deploying PicketLinkSTS and to create the client WSTrustClientTest.java

       

      Mulitple times there is a mention in the blog that required jars are to be placed in JBOSS_HOME/lib/endorsed, but there is no mention on the set of jars i need to verify.

       

      I verified that picketlink-sts was deployed and was able to view the wsdl by accessing http://localhost:8080/picketlink-sts

       

      I've set VM Arg as -Djava.endorsed.dirs=E:\J2EEServers\jboss-5.1.0.GA\lib\endorsed but when i execute the java class receive following exception:

      Exception in thread "main" javax.xml.ws.soap.SOAPFaultException: com.sun.xml.ws.util.xml.StAXSource cannot be cast to javax.xml.transform.dom.DOMSource
      at com.sun.xml.ws.fault.SOAP11Fault.getProtocolException(SOAP11Fault.java:189)
      at com.sun.xml.ws.fault.SOAPFaultBuilder.createException(SOAPFaultBuilder.java:122)
      at com.sun.xml.ws.client.dispatch.DispatchImpl.doInvoke(DispatchImpl.java:187)
      at com.sun.xml.ws.client.dispatch.DispatchImpl.invoke(DispatchImpl.java:206)
      at test.WSTrustClientTest.testSTS(WSTrustClientTest.java:60)
      at test.WSTrustClientTest.main(WSTrustClientTest.java:42)
      Caused by: java.lang.ClassCastException: com.sun.xml.ws.util.xml.StAXSource cannot be cast to javax.xml.transform.dom.DOMSource
      at org.picketlink.identity.federation.core.wstrust.WSTrustJAXBFactory.parseRequestSecurityToken(WSTrustJAXBFactory.java:133)
      at org.picketlink.identity.federation.core.wstrust.PicketLinkSTS.invoke(PicketLinkSTS.java:82)
      at org.picketlink.identity.federation.core.wstrust.PicketLinkSTS.invoke(PicketLinkSTS.java:57)
      at org.jboss.wsf.stack.metro.InvokerJSE.invokeProvider(InvokerJSE.java:73)
      at com.sun.xml.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:156)
      at com.sun.xml.ws.server.provider.SyncProviderInvokerTube.processRequest(SyncProviderInvokerTube.java:78)
      at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
      at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
      at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
      at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)

       

       

      Thanks for you help in advance.

       

      regards,

      Rashmi

        • 1. Re: Classcast exception while executing WSTrustClientTest
          Anil Saldhana Master

          This wiki link (http://community.jboss.org/wiki/JBossWS-Installation) is present on the STS wiki entry.  Ensure you have validated the JBossWS installation properly.

          • 2. Re: Classcast exception while executing WSTrustClientTest
            Mikael Robert Newbie

            I have the same problem whereas i have already checked the jbossWS installation.

            Does someone has an idea?

            • 3. Re: Classcast exception while executing WSTrustClientTest
              Rashmi Rajappa Newbie

              Anil,

              I've tried accessing http://localhost:8080/jbossws/ and it works and lists the PicketLink STS as the service.

              The exception is visible once i execute WSTrustClientTest.java.

              Can you pl provide some pointers around it?

              This is critical for the project i'm working on and unable to even get the basic portion deployed.

               

              cheers,

              rashmi

               

              JBOSS PicktLink Srvc.jpg

              • 4. Re: Classcast exception while executing WSTrustClientTest
                Marcus Moyses Novice

                There must be something wrong with the command line arguments used to execute the test.

                Can you post here the full java command line arguments used?

                Anyway, this is already fixed by PLFED-60 so if you want to checkout the project from svn the fix will already be there.

                • 5. Re: Classcast exception while executing WSTrustClientTest
                  Anil Saldhana Master

                  I will do a 1.0.3.CR3 release today. That should take care of the fix needed (PLFED-60)

                   

                  While I am working on the release archives/zips, please feel free to download 1.0.3.CR3 jars from

                  https://repository.jboss.org/nexus/content/groups/public/org/picketlink/

                   

                  It will take me sometime before I can get the zips in the PL download section.

                  • 6. Re: Classcast exception while executing WSTrustClientTest
                    Anil Saldhana Master

                    Pick the PL 1.0.3.CR3 release from the downloads section of PL.

                    • 7. Re: Classcast exception while executing WSTrustClientTest
                      Mikael Robert Newbie

                      Thank you for this release, the error is now left but now i have a problem with the wsdl validation.

                      Here is the stacktrace that i have when i try to call the STS service :

                       

                      12:06:54,485 ERROR [[PicketLinkSTS]] Exception lors de l'allocation pour la servlet PicketLinkSTS
                      org.apache.cxf.wsdl11.WSDLRuntimeException: Part rstMessage defined as element {urn:picketlink:identity-federation:sts}MessageBody which is not in the schema.
                      at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildMessage(WSDLServiceBuilder.java:809)
                      at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterfaceOperation(WSDLServiceBuilder.java:582)
                      at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildInterface(WSDLServiceBuilder.java:561)
                      at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:332)
                      at org.apache.cxf.wsdl11.WSDLServiceBuilder.buildServices(WSDLServiceBuilder.java:188)
                      at org.apache.cxf.wsdl11.WSDLServiceFactory.create(WSDLServiceFactory.java:129)
                      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.buildServiceFromWSDL(ReflectionServiceFactoryBean.java:408)
                      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:521)
                      at org.apache.cxf.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:271)
                      at org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:177)
                      at org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:100)
                      at org.apache.cxf.frontend.ServerFactoryBean.create(ServerFactoryBean.java:105)
                      at org.apache.cxf.jaxws.JaxWsServerFactoryBean.create(JaxWsServerFactoryBean.java:167)
                      at org.apache.cxf.jaxws.EndpointImpl.getServer(EndpointImpl.java:346)
                      at org.apache.cxf.jaxws.EndpointImpl.doPublish(EndpointImpl.java:259)
                      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:209)
                      at org.apache.cxf.jaxws.EndpointImpl.publish(EndpointImpl.java:404)
                      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 org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1413)
                      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1374)
                      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1334)
                      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:473)
                      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory$1.run(AbstractAutowireCapableBeanFactory.java:409)
                      at java.security.AccessController.doPrivileged(Native Method)
                      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:380)
                      at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:264)
                      at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:221)
                      at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:261)
                      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:185)
                      at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:164)
                      at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:429)
                      at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:729)
                      at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:381)
                      at org.jboss.wsf.stack.cxf.CXFServletExt.loadAdditionalConfigExt(CXFServletExt.java:182)
                      at org.jboss.wsf.stack.cxf.CXFServletExt.loadBus(CXFServletExt.java:131)
                      at org.apache.cxf.transport.servlet.AbstractCXFServlet.init(AbstractCXFServlet.java:78)
                      at org.jboss.wsf.stack.cxf.CXFServletExt.init(CXFServletExt.java:95)
                      at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1048)
                      at org.apache.catalina.core.StandardWrapper.allocate(StandardWrapper.java:777)
                      at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:129)
                      at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
                      at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(SecurityAssociationValve.java:190)
                      at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:525)
                      at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValve.java:92)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.process(SecurityContextEstablishmentValve.java:126)
                      at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invoke(SecurityContextEstablishmentValve.java:70)
                      at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
                      at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
                      at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedConnectionValve.java:158)
                      at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
                      at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:330)
                      at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:829)
                      at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:598)
                      at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
                      at java.lang.Thread.run(Thread.java:619)

                       

                       

                      The same error is present on eclipse but i thought it was an eclipse bug ...

                       

                      Thank you for your help

                      • 8. Re: Classcast exception while executing WSTrustClientTest
                        Anil Saldhana Master

                        Dont think we have tested it with the JBossWS-CXF binding.  We plan to test it with cxf soon but we have not done any testing.

                         

                        Are you able to disable the wsdl validation in cxf?

                        • 9. Re: Classcast exception while executing WSTrustClientTest
                          Rashmi Rajappa Newbie

                          Thank you.

                          I was able to get WSTrustClientTest working after making modifications so that it does not create a DOMSource.

                           

                          Please find attached the updated WSTrustClientTest.java

                          For benefit of all can you update http://community.jboss.org/wiki/PicketLinkSecurityTokenService with the new client code.

                           

                          I was able to receive the token but validate token fails stating -

                           

                          SAMLV2.0 Assertion successfuly validated!
                          Validation status code: http://docs.oasis-open.org/ws-sx/ws-trust/200512/status/invalid
                          Validation status reason: Validation failure: digital signature is invalid

                           

                          Tried to do some debugging myself it fails at this point - XMLSignature.java

                          validate method

                          boolean coreValidity = signature.validate(valContext);

                           

                          coreValidity gets assigned to false.

                          Pl help to get validate working.

                           

                           

                          regards,

                          Rashmi

                          • 10. Re: Classcast exception while executing WSTrustClientTest
                            Rashmi Rajappa Newbie

                            Hi Anil,

                             

                            Thanks for the build but when i change request from DOMSource to StAXSource ie., a SOAP request created using AXIS2

                            WSTrustJAXBFactory.parseRequestSecurityToken

                             

                            Though static typecasting to DOMSource was fixed the code can still can not parse a request of type StAXSource.

                             

                            Node rst = this.findNodeByNameNS(document, "RequestSecurityToken", WSTrustConstants.BASE_NAMESPACE);

                            The above line returns null because of type of the source element i think unlike a DOMSource the DOMTree is not returned during fetch instead a single node with name "RequestSecurityToken" is returned.

                             

                            Pl have a look.

                             

                            regards,

                            Rashmi

                             

                            .core.wstrust.WSTrustException: Error parsing security token request
                            java.lang.RuntimeException: org.picketlink.identity.federation.core.wstrust.WSTr
                            ustException: Error parsing security token request

                                    at org.picketlink.identity.federation.core.wstrust.PicketLinkSTS.invoke(
                            PicketLinkSTS.java:85)
                                    at org.picketlink.identity.federation.core.wstrust.PicketLinkSTS.invoke(
                            PicketLinkSTS.java:56)
                                    at org.jboss.wsf.stack.metro.InvokerJSE.invokeProvider(InvokerJSE.java:7
                            3)
                                    at com.sun.xml.ws.server.InvokerTube$2.invokeProvider(InvokerTube.java:1
                            56)
                                    at com.sun.xml.ws.server.provider.SyncProviderInvokerTube.processRequest
                            (SyncProviderInvokerTube.java:78)
                                    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
                                    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
                                    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
                                    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
                                    at com.sun.xml.ws.api.pipe.helper.AbstractTubeImpl.process(AbstractTubeI
                            mpl.java:112)
                                    at org.jboss.wsf.stack.metro.log.DumpPipe.process(DumpPipe.java:94)
                                    at com.sun.xml.ws.api.pipe.helper.PipeAdapter.processRequest(PipeAdapter
                            .java:115)
                                    at com.sun.xml.ws.api.pipe.Fiber.__doRun(Fiber.java:598)
                                    at com.sun.xml.ws.api.pipe.Fiber._doRun(Fiber.java:557)
                                    at com.sun.xml.ws.api.pipe.Fiber.doRun(Fiber.java:542)
                                    at com.sun.xml.ws.api.pipe.Fiber.runSync(Fiber.java:439)
                                    at com.sun.xml.ws.server.WSEndpointImpl$2.process(WSEndpointImpl.java:24
                            3)
                                    at com.sun.xml.ws.transport.http.HttpAdapter$HttpToolkit.handle(HttpAdap
                            ter.java:471)
                                    at com.sun.xml.ws.transport.http.HttpAdapter.handle(HttpAdapter.java:244
                            )
                                    at com.sun.xml.ws.transport.http.servlet.ServletAdapter.handle(ServletAd
                            apter.java:135)
                                    at org.jboss.wsf.stack.metro.RequestHandlerImpl.doPost(RequestHandlerImp
                            l.java:225)
                                    at org.jboss.wsf.stack.metro.RequestHandlerImpl.handleHttpRequest(Reques
                            tHandlerImpl.java:82)
                                    at org.jboss.wsf.common.servlet.AbstractEndpointServlet.service(Abstract
                            EndpointServlet.java:87)
                                    at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                            icationFilterChain.java:290)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                            ilterChain.java:206)
                                    at org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFi
                            lter.java:96)
                                    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(Appl
                            icationFilterChain.java:235)
                                    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationF
                            ilterChain.java:206)
                                    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperV
                            alve.java:235)
                                    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextV
                            alve.java:191)
                                    at org.jboss.web.tomcat.security.SecurityAssociationValve.invoke(Securit
                            yAssociationValve.java:190)
                                    at org.jboss.web.tomcat.security.JaccContextValve.invoke(JaccContextValv
                            e.java:92)
                                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.proce
                            ss(SecurityContextEstablishmentValve.java:126)
                                    at org.jboss.web.tomcat.security.SecurityContextEstablishmentValve.invok
                            e(SecurityContextEstablishmentValve.java:70)
                                    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.j
                            ava:127)
                                    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.j
                            ava:102)
                                    at org.jboss.web.tomcat.service.jca.CachedConnectionValve.invoke(CachedC
                            onnectionValve.java:158)
                                    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineVal
                            ve.java:109)
                                    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.jav
                            a:330)
                                    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java
                            :829)
                                    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.proce
                            ss(Http11Protocol.java:598)
                                    at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:44
                            7)
                                    at java.lang.Thread.run(Thread.java:619)
                            Caused by: org.picketlink.identity.federation.core.wstrust.WSTrustException: Err
                            or parsing security token request
                                    at org.picketlink.identity.federation.core.wstrust.WSTrustJAXBFactory.pa
                            rseRequestSecurityToken(WSTrustJAXBFactory.java:152)
                                    at org.picketlink.identity.federation.core.wstrust.PicketLinkSTS.invoke(
                            PicketLinkSTS.java:81)
                                    ... 43 more
                            Caused by: java.lang.RuntimeException: Request Security Token node not found
                                    at org.picketlink.identity.federation.core.wstrust.WSTrustJAXBFactory.pa
                            rseRequestSecurityToken(WSTrustJAXBFactory.java:140)

                                    ... 44 more

                            • 11. Re: Classcast exception while executing WSTrustClientTest
                              Stefan Guilhen Apprentice

                              Hi Rashmi,

                               

                              thanks for updating the WSTrustClientTest class. I will update the document today to remove the cast to DOMSource.

                               

                              Regarding the error you're seeing, I think it has nothing to do with DOMSource. All the JAXB factory is saying is that it could not locate the RequestSecurityToken element in the request XML. Can you show me how you are creating the request message?

                               

                              Stefan

                              • 12. Re: Classcast exception while executing WSTrustClientTest
                                Rashmi Rajappa Newbie

                                Stefan,

                                 

                                I've executed the program in debug mode and able to view 'RequestSecurityToken' element.

                                Pl find attached the soap request sent to picketlink and the client java file you could use for reproducing the issue.

                                 

                                I've used Axis2 version 1.4 jars for compilation and execution.

                                 

                                regards,

                                Rashmi

                                • 13. Re: Classcast exception while executing WSTrustClientTest
                                  Jamere Morrow Newbie

                                  So I am able to deploy the Service, I can go to the http://localhost:8080/jbossws/ view my list of services and click the picket link STS and see the WSDL.

                                   

                                  I am using eclipse IDE to run the WSTrustClientTest.java client. So I am trying to run this as a junit and I set my VM arguments to -Djava.endorsed.dirs=D:\jboss-5.1.0.GA\lib\endorsed but when I got to run the test I am getting:

                                   

                                  java.lang.ExceptionInInitializerError
                                      at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                                      at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
                                      at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
                                      at java.lang.reflect.Constructor.newInstance(Unknown Source)
                                      at java.lang.Class.newInstance0(Unknown Source)
                                      at java.lang.Class.newInstance(Unknown Source)
                                      at javax.xml.ws.spi.FactoryFinder.newInstance(Unknown Source)
                                      at javax.xml.ws.spi.FactoryFinder.find(Unknown Source)
                                      at javax.xml.ws.spi.Provider.provider(Unknown Source)
                                      at javax.xml.ws.Service.<init>(Unknown Source)
                                      at javax.xml.ws.Service.create(Unknown Source)
                                      at test.WSTrustClientTest.createDispatch(WSTrustClientTest.java:114)
                                      at test.WSTrustClientTest.testSTS(WSTrustClientTest.java:43)
                                      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                                      at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
                                      at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
                                      at java.lang.reflect.Method.invoke(Unknown Source)
                                      at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
                                      at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
                                      at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
                                      at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)
                                      at org.junit.runners.BlockJUnit4ClassRunner.runNotIgnored(BlockJUnit4ClassRunner.java:79)
                                      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:71)
                                      at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:49)
                                      at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)
                                      at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)
                                      at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)
                                      at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)
                                      at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)
                                      at org.junit.runners.ParentRunner.run(ParentRunner.java:236)
                                      at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:46)
                                      at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
                                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
                                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
                                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
                                      at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)
                                  Caused by: javax.xml.ws.WebServiceException: Error creating JAXBContext for W3CEndpointReference.
                                      at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(Unknown Source)
                                      at com.sun.xml.internal.ws.spi.ProviderImpl$2.run(Unknown Source)
                                      at java.security.AccessController.doPrivileged(Native Method)
                                      at com.sun.xml.internal.ws.spi.ProviderImpl.getEPRJaxbContext(Unknown Source)
                                      at com.sun.xml.internal.ws.spi.ProviderImpl.<clinit>(Unknown Source)
                                      ... 36 more
                                  Caused by: javax.xml.bind.JAXBException: Provider com.sun.xml.bind.v2.ContextFactory not found
                                  - with linked exception:
                                  [java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory]
                                      at javax.xml.bind.ContextFinder.loadClass(ContextFinder.java:192)
                                      at javax.xml.bind.ContextFinder.newInstance(ContextFinder.java:205)
                                      at javax.xml.bind.ContextFinder.find(ContextFinder.java:388)
                                      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:574)
                                      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:522)
                                      ... 41 more
                                  Caused by: java.security.PrivilegedActionException: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
                                      at java.security.AccessController.doPrivileged(Native Method)
                                      at javax.xml.bind.ContextFinder.loadClass(ContextFinder.java:175)
                                      ... 45 more
                                  Caused by: java.lang.ClassNotFoundException: com.sun.xml.bind.v2.ContextFactory
                                      at java.net.URLClassLoader$1.run(Unknown Source)
                                      at java.security.AccessController.doPrivileged(Native Method)
                                      at java.net.URLClassLoader.findClass(Unknown Source)
                                      at java.lang.ClassLoader.loadClass(Unknown Source)
                                      at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
                                      at java.lang.ClassLoader.loadClass(Unknown Source)
                                      at javax.xml.bind.ContextFinder$1.run(ContextFinder.java:180)
                                      at javax.xml.bind.ContextFinder$1.run(ContextFinder.java:176)
                                      ... 47 more

                                  • 14. Re: Classcast exception while executing WSTrustClientTest
                                    Stefan Guilhen Apprentice

                                    Hi Rashmi,

                                     

                                    I've taken a look at your application and it turns out that the WS-Trust namespace in WSTrustConstants is wrong (it has an extra '/' at the end) and this is causing the JAXBFactory to miss the RequestSecurityToken element. I'll fix this and we should release a new CR version of PicketLink STS very soon.

                                     

                                    If you add a '/' to the namespace in your client app you will see that an assertion is created and returned by the STS.

                                     

                                    I've created a Jira to track this: PLFED-63

                                     

                                    Thanks for reporting this error,

                                    Stefan

                                    1 2 3 4 Previous Next