users@jaxb.java.net

Please Help! NullPointerException when calling JAXBContext.newIsntance()

From: Jorge Medina <jmedina_at_on.com>
Date: Tue, 27 May 2003 13:35:23 +0200

I'm getting a NullPointerException when trying to execute the code below.
The JAXB generated classes are under the package
com.acme.product.data.jaxb.

Any hint ?


The exception occurs in the first line of the following code:

      jaxbContext =
JAXBContext.newInstance("com.acme.product.data.jaxb");
                unmarshaller = jaxbContext.createUnmarshaller();
                marshaller = jaxbContext.createMarshaller();
                validator = jaxbContext.createValidator();
                unmarshaller.setValidating(true);
                unmarshaller.setEventHandler( new
JAXBEventHandler(DevStudio.getLogger() ) );
                marshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT,
new Boolean(true));

The stack trace shows the following output:

      at
javax.xml.bind.ContextFinder.loadJAXBProperties(ContextFinder.java:243)
      at
javax.xml.bind.ContextFinder.searchcontextPath(ContextFinder.java:207)
      at javax.xml.bind.ContextFinder.find(ContextFinder.java:153)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:281)
      at javax.xml.bind.JAXBContext.newInstance(JAXBContext.java:238)
      at com.acme.ccm.product.data.MPackage.init(MPackage.java:209)
      at com.acme.ccm.product.data.MPackage.load(MPackage.java:241)
      at com.acme.ccm.product.DevStudio.loadProject(DevStudio.java:109)