Cannot use org.jvnet.jax-ws-commons.jaxws-maven-plugin on JDK8
Asked Answered
S

1

9

I'm using org.jvnet.jax-ws-commons:jaxws-maven-plugin to generate client stubs for Soap services. Upgrading to JDK8 made this fail with following error:

Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property.

and something like

Failed to read DTD 'XMLSchema.dtd', because 'file' access is not allowed due to restriction set by the accessExternalDTD property.

Why is this and how can I fix this?

Sorrel answered 22/5, 2014 at 18:49 Comment(0)
S
27

Seems restriction default have changed in JDK8.

Found this: http://wiki.netbeans.org/FaqWSDLExternalSchema

It was however hard for me to find out how to apply this to the Maven plugin, but passing jvm arguments worked:

 <plugin>
    <groupId>org.jvnet.jax-ws-commons</groupId>
    <artifactId>jaxws-maven-plugin</artifactId>
    <version>${jaxws.plugin.version}</version>
    <executions>
      <execution>
        <goals>
          <goal>wsimport</goal>
        </goals>
        <configuration>
          <verbose>true</verbose>
          <xdebug>true</xdebug>
          <wsdlDirectory>${basedir}/src/main/wsdl/</wsdlDirectory>
          <wsdlFiles>
            <wsdlFile>foo.wsdl</wsdlFile>
          </wsdlFiles>
          <vmArgs>
            <vmArg>-Djavax.xml.accessExternalDTD=all</vmArg>
            <vmArg>-Djavax.xml.accessExternalSchema=all</vmArg>
          </vmArgs>
        </configuration>
      </execution>
    </executions>
  </plugin>
Sorrel answered 22/5, 2014 at 18:51 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.