diff --git a/src/main/java/messagerosa/xml/XMessageParser.java b/src/main/java/messagerosa/xml/XMessageParser.java index 20bbf01..53435e2 100644 --- a/src/main/java/messagerosa/xml/XMessageParser.java +++ b/src/main/java/messagerosa/xml/XMessageParser.java @@ -21,18 +21,16 @@ public class XMessageParser { public static JAXBContext context; - public static Unmarshaller jaxbUnmarshaller; - static { try { context = JAXBContext.newInstance(XMessage.class); - jaxbUnmarshaller = context.createUnmarshaller(); } catch (JAXBException e) { e.printStackTrace(); } } public static XMessage parse(InputStream stream) throws JAXBException { + Unmarshaller jaxbUnmarshaller = context.createUnmarshaller(); return (XMessage) jaxbUnmarshaller.unmarshal(stream); } }