【问题标题】:Cannot use org.jvnet.jax-ws-commons.jaxws-maven-plugin on JDK8无法在 JDK8 上使用 org.jvnet.jax-ws-commons.jaxws-maven-plugin
【发布时间】:2014-05-22 18:49:05
【问题描述】:

我正在使用 org.jvnet.jax-ws-commons:jaxws-maven-plugin 为 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.

为什么会这样,我该如何解决?

【问题讨论】:

    标签: java web-services maven soap jax-rs


    【解决方案1】:

    似乎限制默认值在 JDK8 中已更改。

    找到这个:http://wiki.netbeans.org/FaqWSDLExternalSchema

    然而,我很难找到如何将它应用到 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>
    

    【讨论】:

      猜你喜欢
      • 2017-07-18
      • 1970-01-01
      • 1970-01-01
      • 2018-01-18
      • 2014-08-21
      • 2018-08-17
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多