Uploaded image for project: 'JBoss Enterprise SOA Platform'
  1. JBoss Enterprise SOA Platform
  2. SOA-2770

java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedTypes (security_saml QS deployed in CXF)

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed (View Workflow)
    • Priority: Blocker
    • Resolution: Done
    • Affects Version/s: 5.1.0.ER6
    • Fix Version/s: 5.1.0.ER8
    • Component/s: Examples, JBossESB, Security
    • Labels:
      None
    • Environment:

      production config., CXF installed

    • Workaround Description:
      Hide

      Subclass webservice implementation and specify interfaces/annotations directly. e.g. for PicketLinkSTS you would create the following and specify it as the servlet in web.xml

      @WebServiceProvider(serviceName="PicketLinkSTS",
      portName="PicketLinkSTSPort",
      targetNamespace="urn:picketlink:identity-federation:sts",
      wsdlLocation="WEB-INF/wsdl/PicketLinkSTS.wsdl")
      @ServiceMode(value=Service.Mode.PAYLOAD)
      public class PicketLinkSTS extends
      org.picketlink.identity.federation.core.wstrust.PicketLinkSTS implements Provider<Source>
      {
      }

      Show
      Subclass webservice implementation and specify interfaces/annotations directly. e.g. for PicketLinkSTS you would create the following and specify it as the servlet in web.xml @WebServiceProvider(serviceName="PicketLinkSTS", portName="PicketLinkSTSPort", targetNamespace="urn:picketlink:identity-federation:sts", wsdlLocation="WEB-INF/wsdl/PicketLinkSTS.wsdl") @ServiceMode(value=Service.Mode.PAYLOAD) public class PicketLinkSTS extends org.picketlink.identity.federation.core.wstrust.PicketLinkSTS implements Provider<Source> { }
    • Affects Testing:
      Regression, Blocks Testing
    • Release Notes Text:
      Hide
      https://issues.jboss.org/browse/SOA-2770

      A java.lang.ClassCastException occurred if the user deployed the security_saml quick start with CXF enabled. This was caused by an error in a build file which lead to the class being found on deployment but not on the subsequent run test. To fix this problem, the picketlink-sts.war file has been updated in the quick start. As a result, the exception no longer occurs.
      Show
      https://issues.jboss.org/browse/SOA-2770 A java.lang.ClassCastException occurred if the user deployed the security_saml quick start with CXF enabled. This was caused by an error in a build file which lead to the class being found on deployment but not on the subsequent run test. To fix this problem, the picketlink-sts.war file has been updated in the quick start. As a result, the exception no longer occurs.
    • Release Notes Docs Status:
      Documented as Resolved Issue

      Description

      There is an exception while deploying secuirty_saml QS with CXF enabled:
      17:59:16,231 ERROR [[/picketlink-sts]] StandardWrapper.Throwable
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PicketLinkSTS': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: java.lang.ClassCastException: java.lang.Class cannot be cast to java.lang.reflect.ParameterizedType
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
      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)
      ...

      While trying to run the example, there is another exception being thrown:
      17:59:45,470 ERROR [[/picketlink-sts]] StandardWrapper.Throwable
      org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'PicketLinkSTS': Invocation of init method failed; nested exception is javax.xml.ws.WebServiceException: org.apache.cxf.service.factory.ServiceConstructionException: Failed to create service.
      at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1338)
      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)
      ...
      Caused by: javax.wsdl.WSDLException: WSDLException: faultCode=PARSER_ERROR: Problem parsing 'WEB-INF/wsdl/PicketLinkSTS.wsdl'.: java.io.FileNotFoundException: /qa/home/mvecera/work/soa/510ER6.cxf/jboss-as/bin/WEB-INF/wsdl/PicketLinkSTS.wsdl
      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2111)
      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2303)
      at com.ibm.wsdl.xml.WSDLReaderImpl.readWSDL(WSDLReaderImpl.java:2335)
      at org.apache.cxf.wsdl11.WSDLManagerImpl.loadDefinition(WSDLManagerImpl.java:232)
      at org.apache.cxf.wsdl11.WSDLManagerImpl.getDefinition(WSDLManagerImpl.java:179)
      at org.apache.cxf.wsdl11.WSDLServiceFactory.<init>(WSDLServiceFactory.java:91)
      ... 53 more
      Caused by: java.io.FileNotFoundException: /qa/home/mvecera/work/soa/510ER6.cxf/jboss-as/bin/WEB-INF/wsdl/PicketLinkSTS.wsdl
      at org.jboss.net.protocol.file.FileURLConnection.connect(FileURLConnection.java:105)
      at org.jboss.net.protocol.file.FileURLConnection.getInputStream(FileURLConnection.java:112)
      at org.apache.xerces.impl.XMLEntityManager.setupCurrentEntity(Unknown Source)
      at org.apache.xerces.impl.XMLVersionDetector.determineDocVersion(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
      at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
      at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
      at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
      at com.ibm.wsdl.xml.WSDLReaderImpl.getDocument(WSDLReaderImpl.java:2101)
      ... 58 more

      It seems like CXF is trying to locate the WSDL file in a wrong place. The same problem is in our integration test suite making this test unable to verify correct SAML operation.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kconner Kevin Conner
                  Reporter:
                  mvecera Martin Vecera
                  Writer:
                  David Le Sage
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: