Q: Are there know
Dallas County Cler
A new method of es
/* * Copyright (
/* Bullet Continu
What if our world
Orofacial and soma
The present invent
"And let's hear th
In the past year,

The long-term obje
A new paradigm for
The present invent
Benzos Benzos may
Rugby sevens at th
It’s the kind of s
Re: [Qemu-devel] [
All relevant data
Bush's Brain: The
The present invent
Q: Jaxb2-maven-plugin not working with jaxb:bindings, when it comes to unmarshal. Is there a work around? First time posting here. It's been really helpful so far but I hit a wall. I have a project which has a lot of dependencies and is structured like so. myProject/ |--src/ | |--main/ | | |--java/ | | |--resources/ | | | |--binding.xml | | |--webapp/ | | |--js/ | | |--css/ | |--test/ The binding.xml looks like so: Here's the test I'm trying to use to make sure it's working: @Test public void testUnmarshalBinding() throws Exception { File file = new File("src/main/webapp/resources/js/sitemap.js"); JAXBContext ctx = JAXBContext.newInstance(DSS.class); DSS dss = (DSS) ctx.createUnmarshaller().unmarshal(file); log.info("returning dss object"); assertNotNull(dss); } It returns null. I've tried messing around with maven-jaxb2-plugin and all kinds of JAXB binding plugins and I always get the same results, namely nothing is returned from the unmarshal. I'm a bit stumped at this point as I've followed every single guide I've found online. If I point it to an xsd I write out in a separate test it works fine, so it's something to do with that file. I haven't changed the DSS class in any way. Thanks. Edit: I've changed the test to use the location in which the file exists instead of pointing directly at the JAXBContext. The exact same behavior is exhibited. The xsd file looks like this: A: I managed to get this to work by changing the binding.xml file as follows: I got that working by using this xsd: I changed the name of the test to match the name in my original binding.xml which I had done for the sake of changing things around for the rest of the program. A: It sounds like there is something special about the class paths for your JAXB plugins. JAXB's xjc:unmarshalling has its own configurable options to point at JAXB's lib folder where JAXB can find all the tools and other files needed to build it's libraries. I suggest adding an entry in your Maven POM's dependency element to add the JAXB jars to your classpath as well as an option to add the xjc jars to your classpath. If the test compiles but your application runs into issues, I'd check to make sure the maven-jaxb2-plugin is configured to correctly handle your binding files and classpaths. Lastly, if you provide your pom.xml, I can update this answer to include this info. Here's a sample plugin configuration that worked for me when I did this last. org.codehaus.mojo jaxb2-maven-plugin 2.3.1 xjc-generate-sources xjc -B-Xprint:none -Xinheritance -extension -b ${basedir}/src/main/resources/jaxb/test-binding.xml -p ${project.build.directory}/classes/META-INF