Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-6799

java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.reflect.TypeVariable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.7.17
    • 3.1.6, 3.0.9, 3.2.0
    • JAXB Databinding
    • None
    • EAP 6.4.5; jdk1.7.0_75

    Description

      Deploying test web service gives on JBoss startup:
      Caused by: java.lang.ClassCastException: sun.reflect.generics.reflectiveObjects.ParameterizedTypeImpl cannot be cast to java.lang.reflect.TypeVariable
      at org.apache.cxf.jaxb.JAXBContextInitializer.addType(JAXBContextInitializer.java:251)

      Generated web service class has the following element which has issues with the JAXB binding:

      @XmlElementRefs(

      { @XmlElementRef(name = "Salutation", namespace = "http://ws.gss.redhat.com/", type = JAXBElement. @XmlElementRef(name = "Name", namespace = "http://ws.gss.redhat.com/", type = JAXBElement.class) }

      )
      protected JAXBElement<String> [] salutationAndName;

      Web service was generated from WSDL with <jaxb:globalBindings collectionType="indexed" /> and the following schema:

      <xs:complexType name="Greetings">
      <xs:sequence maxOccurs="unbounded">
      <xs:element name="Salutation" type="xsd:string"/>
      <xs:element name="Name" type="xsd:string"/>
      </xs:sequence>
      </xs:complexType>

      Attachments

        Activity

          People

            asoldano Alessio Soldano
            cdolphy Chris Dolphy
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: