Yesterday I wasted a coupled of hours and it is my own fault. Just in case you hit the same problem (or in case I hit it again and forget) I’ll note it here.
I’m using a mix of JAXB and Spring and I was getting an error message:
doesn't contain ObjectFactory.class or jaxb.index
This is when Spring tries to load this bean:
You may have spotted the obvious mistake already but I didn’t
The contextPaths property has to be a list of packages not classes.
It is trying to use the class name I have it as a package name and it is trying to find an ObjectFactory class or a jaxb.index file in that package. Since there is no such package then it reports that it cannot find them. Fair enough.
I, however, assumed there was some complication to do with JAXB versions (I have had several of those) and wasted more time than I should have.
For the record, the bean definition needs to be like this: