2

I found lots of answered questions and best practices related to JAXBContext generation using contextpath (package names with (:) separated). I have achieved JAXBContext using contextpath and jaxb.index(each package contains index file with list of classes contains). But still I have a question, Is it will be achieved without jaxb.index and ObjectFactory class? Is it possible? If its YES,kindly guide me and give some Links to follow.

I gone through this JAXBContext menthod summary. ( http://docs.oracle.com/javaee/5/api/javax/xml/bind/JAXBContext.html ). I found this line failure to locate either ObjectFactory.class or jaxb.index in the packages.

Please direct me if this question was answered already.

Mohan Raj
  • 31
  • 5

1 Answers1

0

If you create a JAXBContext on a context path, your JAXB impl will first look for a jaxb.index file at that location, if that file is not present it will automatically look for a class called ObjectFactory that is annotated with @XmlRegistry.

bdoughan
  • 147,609
  • 23
  • 300
  • 400