Hello,
(CXF v2.6.1)
We have, say, a JAX-RS interface like this one:
---
@Path("/foo")
public interface Foo {
@Path("/bar")
@POST
@Consumes(MediaType.TEXT_XML)
@Produces(MediaType.TEXT_XML)
JAXBElement<BarTypeTO> doSomething(FooTO);
}
---
FooTO is a class of the following structure (generated by JAXB-Maven-Plugin):
---
public class FooTO extends JAXBElement<ExampleTypeTO> {
protected final static Qname NAME = new Qname("namespace", "foo");
public FooTO(ExampleTypeTO value) {
super(NAME, ((Class) ExampleTypeTO.class), null, value);
}
public FooTO() {
super(NAME, ((Class) ExampleTypeTO.class), null, null);
}
}
---
ExampleTypeTO represents a schema complexType. Schema:
---
<xs:element name="foo" type="exampleType"/>
<xs:complexType name"exampleType">...</xs:complexType>
---
Now, when performing a request to the endpoint from above, I get the following
exception:
JAXBException: FooTO is not known to this context.
I debugged JAXBElementProvider and the JAXBContext instance knows all classes
from the package of FooTO except FooTO itself and of course the ObjectFactory,
which may be correct but why is JAXB not able to unmarshal FooTO? This was
working once.
Is there something wrong at line 173-175 in JAXBElementProvider?
Best regards,
Marko
-------------------------------------------------------
Fachinformationszentrum Karlsruhe, Gesellschaft für wissenschaftlich-technische
Information mbH.
Sitz der Gesellschaft: Eggenstein-Leopoldshafen, Amtsgericht Mannheim HRB
101892.
Geschäftsführerin: Sabine Brünger-Weilandt.
Vorsitzender des Aufsichtsrats: MinDirig Dr. Thomas Greiner.