Menu

WebService Client Generation Error with JDK8

Goal

Fixing problem with WebService Client Generation Error with JDK8

Description

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.

How to

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: