title: jaxb unable to create an instance of abstract class
body: <pre><code>@XmlSeeAlso({ Dog.class, Cat.class })
  public abstract class Animal {}
  
  @XmlRootElement(name="dog")
  public class Dog extends Animal {}
  
  @XmlRootElement(name="cat")
  public class Cat extends Animal {}
  
  @WebService(name = "WebServiceDemo", serviceName = "WebServiceDemo")
  @SOAPBinding(style = SOAPBinding.Style.DOCUMENT, use = SOAPBinding.Use.LITERAL,
              parameterStyle = SOAPBinding.ParameterStyle.WRAPPED)
  public class WebServiceDemo {
  
  @WebMethod
  public String service(@WebParam(name = "animal") Animal animal) {
         System.out.println("animal service calling.....");
         return animal;
  }
  }
  </code></pre>
  
  <p>Now when i am calling this service method from client with Animal calss as a parameter that time i am getting error-</p>
  
  <blockquote>
    <p>Caused by: javax.xml.bind.UnmarshalException: Unable to create an instance of Animal
     - with linked exception:
    [java.lang.InstantiationException]
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.handleEvent(UnmarshallingContext.java:616)
        at com.sun.xml.bind.v2.runtime.unmarshaller.Loader.reportError(Loader.java:244)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.createInstance(UnmarshallingContext.java:583)
        at com.sun.xml.bind.v2.runtime.unmarshaller.StructureLoader.startElement(StructureLoader.java:181)
        at com.sun.xml.bind.v2.runtime.unmarshaller.XsiTypeLoader.startElement(XsiTypeLoader.java:73)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext._startElement(UnmarshallingContext.java:455)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallingContext.startElement(UnmarshallingContext.java:433)
        at com.sun.xml.bind.v2.runtime.unmarshaller.InterningXmlVisitor.startElement(InterningXmlVisitor.java:71)
        at com.sun.xml.bind.v2.runtime.unmarshaller.SAXConnector.startElement(SAXConnector.java:137)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:240)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:277)
        at com.sun.xml.bind.unmarshaller.DOMScanner.visit(DOMScanner.java:246)
        at com.sun.xml.bind.unmarshaller.DOMScanner.scan(DOMScanner.java:123)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal0(UnmarshallerImpl.java:314)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:293)
        at com.sun.xml.bind.v2.runtime.unmarshaller.UnmarshallerImpl.unmarshal(UnmarshallerImpl.java:244)
        at org.jboss.ws.core.jaxws.JAXBDeserializer.deserialize(JAXBDeserializer.java:71)</p>
  </blockquote>