0 Replies Latest reply on May 27, 2008 10:26 AM by Komet Komet

    JAXBContext doesn't know ArrayList or complex types - object

    Komet Komet Newbie

      Hallo, I've got a simple web service with a stateless session bean as endpoint.

      I use jboss 4.2.2.GA and the current jaxws 3.0.1.

      The wsdl file of my service is generated automatically and accessing the methods by a jaxws-client works fine, but...

      I would like to have a simple get-method in my ws:

      
      public Object get(Long param);
      
      


      The generated wsdl file maps the return value to :anyType.

      If the implementation of this method returns a default Java Object like a String, there are no problems in marshal or unmarshal, but if the object is an ArrayList or even an own complex type, the following error occurs on the server side:

      class ArrayList|MyOwnClass nor any of its super class is known to this context.


      How can I put the classes into the JAXBContext at runtime?

      I tried the @XmlSeeAlso annotation without success. Creating my own JAXBContext in the stateless session bean method, adding the arraylist and marshalling causes another exception:


      @XMLRootElement is missing in ArrayList ...


      Thanks a lot for help!