WebService Client Generation Error with JDK8

后端 未结 23 2708
既然无缘
既然无缘 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:55

    A very simple portable solution would be, to place the following line of code somewhere in a crucial part of your code, a part of which you are sure that it will be run (for example right in the main method):

    System.setProperty("javax.xml.accessExternalDTD", "all");
    

    This sets the needed system property programmatically, without having to do tricky maven pom.xml changes (which for some reason didn't work for me).

提交回复
热议问题