Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/308.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin_Java_Web Services_Maven_Soap_Jax Rs - Fatal编程技术网

Java 无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin

Java 无法在JDK8上使用org.jvnet.jax-ws-commons.jaxws-maven-plugin,java,web-services,maven,soap,jax-rs,Java,Web Services,Maven,Soap,Jax Rs,我正在使用org.jvnet.jax-ws-commons:jaxws-maven插件为Soap服务生成客户机存根。升级到JDK8导致此操作失败,出现以下错误: Failed to read schema document 'xxx.xsd', because 'file' access is not allowed due to restriction set by the accessExternalSchema property. 什么的 Failed to read DTD 'XMLS

我正在使用org.jvnet.jax-ws-commons:jaxws-maven插件为Soap服务生成客户机存根。升级到JDK8导致此操作失败,出现以下错误:

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

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

这是为什么?我如何解决这一问题?

JDK8中的默认限制似乎已更改

我们发现:

然而,我很难找到如何将其应用于Maven插件,但传递jvm参数起到了作用:

 <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>

org.jvnet.jax-ws-commons
jaxws-maven插件
${jaxws.plugin.version}
wsimport
真的
真的
${basedir}/src/main/wsdl/
foo.wsdl
-Djavax.xml.accessExternalDTD=all
-Djavax.xml.accessExternalSchema=all