import java.util.Map;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBException;
-import javax.xml.bind.Unmarshaller;
import javax.xml.transform.stream.StreamSource;
import org.eclipse.persistence.jaxb.JAXBContextFactory;
import org.eclipse.persistence.jaxb.JAXBContextProperties;
private static final String VF_MODULE = "vf-module";
private static final Logger LOGGER = LoggerFactory.getLogger(AaiCqResponse.class);
private static JAXBContext jaxbContext;
- private static Unmarshaller unmarshaller;
// JABX initial stuff
static {
ModelVer.class
}, properties);
// @formatter:on
- unmarshaller = jaxbContext.createUnmarshaller();
+
+ // verify that we can create an unmarshaller
+ jaxbContext.createUnmarshaller();
+
} catch (JAXBException e) {
LOGGER.error("Could not initialize JAXBContext", e);
LOGGER.info("Problem initiatlizing JAXBContext", e);
private <T> T getAaiObject(StreamSource json, final Class<T> classOfResponse) {
try {
- return unmarshaller.unmarshal(json, classOfResponse).getValue();
+ return jaxbContext.createUnmarshaller().unmarshal(json, classOfResponse).getValue();
} catch (JAXBException e) {
LOGGER.error("JAXBCOntext error", e);
return null;