Hi Experts,
We are trying to use XSD 1.1 (assertion feature) validation for the XML payload in a Java mapping program. But I am getting the following exception:
java.lang.IllegalArgumentException: http://www.w3.org/XML/XMLSchema/v1.1 at javax.xml.validation.SchemaFactory.newInstance(SchemaFactory.java:186)
This is happing for the statement:
SchemaFactory factory = SchemaFactory.newInstance("http://www.w3.org/XML/XMLSchema/v1.1");
The reason (apparently) is because it is not able to instantiate the class org.apache.xerces.jaxp.validation.XMLSchema11Factory , which is the Xerces implementation of the SchemaFactory class.
I have tried following things so far -
1. If I try to validate an xml against an xsd 1.1 schema in a standalone program, it works perfectly fine.
2. If I try to deploy this whole functionality on to the server through an EAR (like an adapter module), there again it works.
3. Also tried this before instantiating the SchemaFactory -
System.setProperty("javax.xml.validation.SchemaFactory:http://www.w3.org/XML/XMLSchema/v1.1","org.apache.xerces.jaxp.validation.XMLSchema11Factory");
4. I tried by creating the Imported Archive objects for all the Xerces jars that we require for validation, within the same SWCV, namespace. But still I get the same exception as above (IllegalArgumentException)
5. The link [http://help.sap.com/saphelp_nw70/helpdata/en/b6/8097f5a5edea4f8dfc87ac87082b22/content.htm ] mentions that we need to place all the necessary jars at location /cluster/server/bin/ext /. But even after placing the jars there, I get the same exception.
I am not sure how we need to handle this. Has anybody faced a similar situation? Any suggestions?
Regards,
Sudheer