castor.properties is on my root directory and other properties apply nicely, exept features like:
org.exolab.castor.sax.features=http://xml.org/sax/features/validation,http://apache.org/xml/features/validation/schema
Following code:
Unmarshaller unmarshaller = new Unmarshaller(GameData.class);
....
data = (GameData)unmarshaller.unmarshal(src);
Leads to Unmarshaller.java: 697:
reader = _config.getXMLReader();
which lead to Configuration class:
return getDefaultXMLReader( null ) ;
which deals with props from my castor.properties, but then it goes to
Configuration.java: 623 ->setFeaturesOnXmlReader
and this method does
features = getDefault().getProperty(Property.ParserFeatures, features);
which returns features as null
And features do not apply for sax parser.
I have added following hack to get it done in my project:
Configuration.getDefault().setProperty(Property.ParserFeatures,"http://xml.org/sax/features/validation,http://apache.org/xml/features/validation/schema");
No, it shouldn't, as you are referring to Configuration.java. In LocalConfiguration.java, the code your are looking for is actually implemented. To me it looks like you are putting your custom castor.properties to the wrong location. Have you made sure that it is available on the CLASSPATH ?