Я пытаюсь автоматически сгенерировать запросы SOAP, используя встроенный инструмент JDK wsimport.Кажется, файлы получают доступ к Интернету, потому что мне пришлось добавить аргумент «-Djavax.xml.accessExternalDTD = all».Теперь зависимости, кажется, разрешены.Но программа падает при ничего не возвращает.Мой звонок:
wsimport.exe <Path to .wsdl file> -Djavax.xml.accessExternalDTD=all
Сообщение об ошибке:
Exception in thread "main" com.sun.xml.internal.ws.util.ServiceConfigurationError: com.sun.tools.internal.ws.wscompile.Plugin:
Provider com.sun.tools.internal.ws.wscompile.plugin.at_generated.PluginImpl is specified in
jrt:/jdk.xml.ws/META-INF/services/com.sun.tools.internal.ws.wscompile.Pluginbut could not be instantiated:
java.lang.IllegalAccessException: class com.sun.xml.internal.ws.util.ServiceFinder$LazyIterator (in module java.xml.ws)
cannot access class com.sun.tools.internal.ws.wscompile.plugin.at_generated.PluginImpl (in module jdk.xml.ws) because module jdk.xml.ws
does not export com.sun.tools.internal.ws.wscompile.plugin.at_generated to module java.xml.ws
at java.xml.ws@9.0.1/com.sun.xml.internal.ws.util.ServiceFinder.fail(ServiceFinder.java:264)
at java.xml.ws@9.0.1/com.sun.xml.internal.ws.util.ServiceFinder.access$600(ServiceFinder.java:138)
at java.xml.ws@9.0.1/com.sun.xml.internal.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:512)
at java.xml.ws@9.0.1/com.sun.xml.internal.ws.util.ServiceFinder$CompositeIterator.next(ServiceFinder.java:407)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportOptions.findServices(WsimportOptions.java:654)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportOptions.getAllPlugins(WsimportOptions.java:221)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:402)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportOptions.parseArguments(WsimportOptions.java:247)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportTool.parseArguments(WsimportTool.java:364)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:187)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.wscompile.WsimportTool.run(WsimportTool.java:168)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:564)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.Invoker.invoke(Invoker.java:138)
at jdk.xml.ws@9.0.1/com.sun.tools.internal.ws.WsImport.main(WsImport.java:41)
Caused by: java.lang.IllegalAccessException: class com.sun.xml.internal.ws.util.ServiceFinder$LazyIterator (in module java.xml.ws)
cannot access class com.sun.tools.internal.ws.wscompile.plugin.at_generated.PluginImpl (in module jdk.xml.ws) because
module jdk.xml.ws does not export com.sun.tools.internal.ws.wscompile.plugin.at_generated to module java.xml.ws
at java.base/jdk.internal.reflect.Reflection.newIllegalAccessException(Reflection.java:361)
at java.base/jdk.internal.reflect.Reflection.ensureMemberAccess(Reflection.java:107)
at java.base/java.lang.Class.newInstance(Class.java:553)
at java.xml.ws@9.0.1/com.sun.xml.internal.ws.util.ServiceFinder$LazyIterator.next(ServiceFinder.java:508)
... 14 more