Fixing problem with WebService Client Generation Error with JDK8
If you’re generating a WebService client in JDK8 and you’re having issues related to accessExternalSchema, similar to
schema_reference: Failed to read schema document 'xjc.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.
then, this recipe might be helpful.
One of the possibilities is to create a file named jaxp.properties (if it doesn’t exist) under $JDK8_HOME/jre/lib and then write this line in it (take a look at the documentation here for more details):
javax.xml.accessExternalSchema = all
However, the solution I prefer, in case you’re using Maven (e.g., jaxws-maven-plugin) to generate your client, is to specify the vmArg that defines that property, like the following:
... <plugin> <groupId>org.jvnet.jax-ws-commons</groupId> <artifactId>jaxws-maven-plugin</artifactId> <version>2.2.1</version> <configuration> <wsdlDirectory>src/main/resources/wsdl</wsdlDirectory> <wsdlLocation>/wsdl/*</wsdlLocation> <vmArgs> <strong><vmArg>-Djavax.xml.accessExternalSchema=all</vmArg></strong> </vmArgs> ... </configuration> </plugin> ...
All explanations were made in place. Therefore, there’s nothing useful to add here, I suppose…