WebService Client Generation Error with JDK8

后端 未结 23 2504
既然无缘
既然无缘 2020-11-27 08:50

I need to consume a web service in my project. I use NetBeans so I right-clicked on my project and tried to add a new \"Web Service Client\". Last time I checked, this was t

相关标签:
23条回答
  • 2020-11-27 09:40

    NetBeans update their tutorial for JDK8 and this Issue:

    Getting Started with JAX-WS Web Services -> Enabling Access to External Schema

    0 讨论(0)
  • 2020-11-27 09:41

    The following works for wsimport 2.2.9 included in jdk 1.8.0_66:

    wsimport -J-Djavax.xml.accessExternalSchema=all ....
    
    0 讨论(0)
  • 2020-11-27 09:41

    In my case adding:

    javax.xml.accessExternalSchema = all
    

    to jaxp.properties didn't work, I've to add:

    javax.xml.accessExternalDTD = all
    

    My environment is linux mint 17 and java 8 oracle. I'll put it there as an answer for people with the same problem.

    0 讨论(0)
  • 2020-11-27 09:42

    Well, I found the solution. (based on http://docs.oracle.com/javase/7/docs/api/javax/xml/XMLConstants.html#ACCESS_EXTERNAL_SCHEMA)

    Create a file named jaxp.properties (if it doesn't exist) under /path/to/jdk1.8.0/jre/lib and then write this line in it:

    javax.xml.accessExternalSchema = all
    

    That's all. Enjoy JDK 8.

    0 讨论(0)
  • 2020-11-27 09:45

    I run ant builds within Eclipse IDE (4.4, Luna, on Windows 7 x64). Rather than modifying the installed JRE lib or any ant scripts (I have multiple projects that include XJC in their builds), I prefer to change Eclipse Settings "External Tools Configurations" and add the following to the VM arguments for the Ant build configuration:

    -Djavax.xml.accessExternalSchema=all
    
    0 讨论(0)
  • 2020-11-27 09:45

    If you are using ant you can add a jvmarg to your java calls:

    <jvmarg value="-Djavax.xml.accessExternalSchema=all" />
    
    0 讨论(0)
提交回复
热议问题