If you use Eclipse IDE with the Dali plugin for JAXB you may obtain the aforementioned error in the console.
Such error can be avoided if you uncheck 'Use strict validation' on panel 'Classes Generator Options' when establishing the options for JAXB generation from a XSD file.
Such panel is the third one after 'Java Project' and 'Generate classes from Schema'.
Adding the additional argument -nv suggested by @minjun-yu also works. Instead of applying my first suggestion, you can set such argument in the fourth panel labeled 'Classes Generator Extension Configurations'
On parsing data to load the JAXB generated classes, if you are validating against a schema, you still may obtain the SAXException. As pointed by @mzywiol and @marioosh, the exception is avoided setting a special feature on creating the SchemaFactory
SchemaFactory sf = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
// Avoid SAXParseException on maxOccurs > 5000
sf.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, false);
URL xsdURL = TestParse.class.getResource(xsdLocation);
Schema schema = sf.newSchema(xsdURL);
JAXBContext ctx = JAXBContext.newInstance(MyJAXBClass.class.getPackage().getName());
Unmarshaller unmarshaller = ctx.createUnmarshaller();
unmarshaller.setSchema(schema);