oracle / graal

GraalVM compiles Java applications into native executables that start instantly, scale fast, and use fewer compute resources 🚀
https://www.graalvm.org
Other
20.26k stars 1.62k forks source link

Cannot call Soap service with jax-ws #2188

Closed troosan closed 3 years ago

troosan commented 4 years ago

Describe GraalVM and your environment :

Apple clang version 11.0.0 (clang-1100.0.33.17)
Target: x86_64-apple-darwin19.4.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@(#)PROGRAM:ld  PROJECT:ld64-530
BUILD 18:57:17 Dec 13 2019
configured to support archs: armv6 armv7 armv7s arm64 arm64e arm64_32 i386 x86_64 x86_64h armv6m armv7k armv7m armv7em
Library search paths:
    /usr/local/lib
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/lib
Framework search paths:
    /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/
Undefined symbols for architecture x86_64:
  "_main", referenced from:
     implicit entry/start for main executable
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Have you verified this issue still happens when using the latest snapshot? Not yet

Describe the issue Calling a Soap service fails

Steps to reproduce the issue I created a little test project to reproduce the issue. You can find it here:

  1. Step one: git clone https://github.com/troosan/quarkus-jaxws-client-test.git
  2. Step two: mvn clean package -Pnative

Expected behavior Service gets called successfuly

Additional context When adding --report-unsupported-elements-at-runtime the build succeeds, but I get the following error at runtim

Caused by: com.sun.xml.internal.ws.model.RuntimeModelerException: [failed to localize] runtime.modeler.no.operations(org.acme.soap_service.v1.MySoapService)
    at com.sun.xml.internal.ws.model.RuntimeModeler.buildRuntimeModel(RuntimeModeler.java:308)
    at com.sun.xml.internal.ws.db.DatabindingImpl.<init>(DatabindingImpl.java:85)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:59)
    at com.sun.xml.internal.ws.db.DatabindingProviderImpl.create(DatabindingProviderImpl.java:43)
    at com.sun.xml.internal.ws.db.DatabindingFactoryImpl.createRuntime(DatabindingFactoryImpl.java:105)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.buildRuntimeModel(WSServiceDelegate.java:875)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.createSEIPortInfo(WSServiceDelegate.java:892)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.addSEI(WSServiceDelegate.java:855)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:435)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
    at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
    at javax.xml.ws.Service.getPort(Service.java:119)
    at org.acme.soap_service.v1.MySoapService_Service.getMySoapServicePort(MySoapService_Service.java:52)
    at org.acme.ExampleResource.hello(ExampleResource.java:22)

without the option the error is similar

Caused by: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.resolveClass(Class) is reachable: The declaring class of this element has been substituted, but this element is not present in the substitution class
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
cstancu commented 4 years ago

Is it possible that the com.sun.xml.internal.ws.model.RuntimeModelerException: [failed to localize] runtime.modeler.no.operations(org.acme.soap_service.v1.MySoapService) is caused by missing some reflection config for a dynamically allocated object? --report-unsupported-elements-at-runtime works as expected and I don't think that the runtime error is related to java.lang.ClassLoader.resolveClass(Class).

jramirez-isc commented 4 years ago

Hi @troosan I tried to reproduce the issue using your code, but I get an error when I run mvn clean package -Pnative

[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[WARNING] The POM for com.smartbear.soapui:soapui-maven-plugin:jar:5.1.3 is missing, no dependency information available
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  0.948 s
[INFO] Finished at: 2020-04-22T12:35:36-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin com.smartbear.soapui:soapui-maven-plugin:5.1.3 or one of its dependencies could not be resolved: Failure to find com.smartbear.soapui:soapui-maven-plugin:jar:5.1.3 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException

Is there any additional step I have to do?

troosan commented 4 years ago

@jramirez-isc you might have to add a maven repository to your settings.xml

  <pluginRepositories>
    <pluginRepository>
      <id>smartbear-sweden-plugin-repository</id>
      <url>http://www.soapui.org/repository/maven2/</url>
    </pluginRepository>
  </pluginRepositories>
jramirez-isc commented 4 years ago

@troosan Adding the repository to setting.xml didn't work for me, but adding it to the pom.xml file did. Now I'm getting a different error:

Joses-MacBook-Pro:quarkus-jaxws-client-test jramirez$ mvn clean package -Pnative
[INFO] Scanning for projects...
[INFO] 
[INFO] ---------------------< org.acme:code-with-quarkus >---------------------
[INFO] Building code-with-quarkus 1.0.0-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ code-with-quarkus ---
[INFO] Deleting /Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/target
[INFO] 
[INFO] --- jaxws-maven-plugin:2.5:wsimport (default) @ code-with-quarkus ---
[INFO] Processing: file:/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/src/wsdl/services/soap-service/V1/MySoapService.wsdl
[INFO] jaxws:wsimport args: [-keep, -s, '/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/src/main/java', -d, '/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/target/classes', -verbose, -encoding, UTF-8, -extension, -Xnocompile, -wsdllocation, /services/soap-service/V1/MySoapService.wsdl, -target, 2.1, -B-no-header, "file:/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/src/wsdl/services/soap-service/V1/MySoapService.wsdl"]
parsing WSDL...

Generating code...

org/acme/soap_service/interfaces/v1/CheckServiceHealthRequestType.java
org/acme/soap_service/interfaces/v1/CheckServiceHealthResponseType.java
org/acme/soap_service/interfaces/v1/ObjectFactory.java
org/acme/soap_service/interfaces/v1/package-info.java
org/acme/soap_service/v1/MySoapService.java
org/acme/soap_service/v1/MySoapService_Service.java
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 4 resources
[INFO] Copying 2 resources to services
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:compile (default-compile) @ code-with-quarkus ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 7 source files to /Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ code-with-quarkus ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.8.1:testCompile (default-testCompile) @ code-with-quarkus ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 2 source files to /Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/target/test-classes
[INFO] 
[INFO] --- soapui-maven-plugin:5.1.3:mock (soap-integration-test) @ code-with-quarkus ---
SoapUI 5.1.3 Maven2 MockService Runner
11:57:28,859 WARN  [SoapUI] Missing folder [/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/ext] for external libraries
11:57:28,860 INFO  [DefaultSoapUICore] Creating new settings at [/Users/jramirez/soapui-settings.xml]
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  4.335 s
[INFO] Finished at: 2020-05-14T11:57:29-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.smartbear.soapui:soapui-maven-plugin:5.1.3:mock (soap-integration-test) on project code-with-quarkus: Execution soap-integration-test of goal com.smartbear.soapui:soapui-maven-plugin:5.1.3:mock failed: An API incompatibility was encountered while executing com.smartbear.soapui:soapui-maven-plugin:5.1.3:mock: java.lang.ExceptionInInitializerError: null
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>com.smartbear.soapui:soapui-maven-plugin:5.1.3
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/jramirez/.m2/repository/com/smartbear/soapui/soapui-maven-plugin/5.1.3/soapui-maven-plugin-5.1.3.jar
[ERROR] urls[1] = file:/Users/jramirez/.m2/repository/com/smartbear/soapui/soapui/5.1.3/soapui-5.1.3.jar
[ERROR] urls[2] = file:/Users/jramirez/.m2/repository/junit/junit/4.11/junit-4.11.jar
[ERROR] urls[3] = file:/Users/jramirez/.m2/repository/org/hamcrest/hamcrest-core/1.3/hamcrest-core-1.3.jar
[ERROR] urls[4] = file:/Users/jramirez/.m2/repository/xmlbeans/xbean/fixed-2.4.0/xbean-fixed-2.4.0.jar
[ERROR] urls[5] = file:/Users/jramirez/.m2/repository/xmlbeans/xbean_xpath/2.4.0/xbean_xpath-2.4.0.jar
[ERROR] urls[6] = file:/Users/jramirez/.m2/repository/xmlbeans/xmlpublic/2.4.0/xmlpublic-2.4.0.jar
[ERROR] urls[7] = file:/Users/jramirez/.m2/repository/javax/xml/bind/jsr173_api/1.0/jsr173_api-1.0.jar
[ERROR] urls[8] = file:/Users/jramirez/.m2/repository/com/google/guava/guava/14.0/guava-14.0.jar
[ERROR] urls[9] = file:/Users/jramirez/.m2/repository/commons-collections/commons-collections/3.2.1/commons-collections-3.2.1.jar
[ERROR] urls[10] = file:/Users/jramirez/.m2/repository/commons-lang/commons-lang/2.4/commons-lang-2.4.jar
[ERROR] urls[11] = file:/Users/jramirez/.m2/repository/commons-io/commons-io/2.4/commons-io-2.4.jar
[ERROR] urls[12] = file:/Users/jramirez/.m2/repository/log4j/log4j/1.2.14/log4j-1.2.14.jar
[ERROR] urls[13] = file:/Users/jramirez/.m2/repository/commons-logging/commons-logging/1.1.1/commons-logging-1.1.1.jar
[ERROR] urls[14] = file:/Users/jramirez/.m2/repository/com/smartbear/utils/analytics/analytics-core/5.1.3-os/analytics-core-5.1.3-os.jar
[ERROR] urls[15] = file:/Users/jramirez/.m2/repository/com/smartbear/utils/analytics/out-app-analytics-provider/5.1.3-os/out-app-analytics-provider-5.1.3-os.jar
[ERROR] urls[16] = file:/Users/jramirez/.m2/repository/com/fifesoft/rsyntaxtextarea/2.5.0/rsyntaxtextarea-2.5.0.jar
[ERROR] urls[17] = file:/Users/jramirez/.m2/repository/jetty/jetty/6.1.26/jetty-6.1.26.jar
[ERROR] urls[18] = file:/Users/jramirez/.m2/repository/jetty/jetty-util/6.1.26/jetty-util-6.1.26.jar
[ERROR] urls[19] = file:/Users/jramirez/.m2/repository/jetty/servlet-api/2.5-20081211/servlet-api-2.5-20081211.jar
[ERROR] urls[20] = file:/Users/jramirez/.m2/repository/org/apache/ws/security/wss4j/1.6.16/wss4j-1.6.16.jar
[ERROR] urls[21] = file:/Users/jramirez/.m2/repository/org/opensaml/opensaml/2.5.1-1/opensaml-2.5.1-1.jar
[ERROR] urls[22] = file:/Users/jramirez/.m2/repository/org/opensaml/openws/1.4.2-1/openws-1.4.2-1.jar
[ERROR] urls[23] = file:/Users/jramirez/.m2/repository/org/opensaml/xmltooling/1.3.2-1/xmltooling-1.3.2-1.jar
[ERROR] urls[24] = file:/Users/jramirez/.m2/repository/joda-time/joda-time/1.6.2/joda-time-1.6.2.jar
[ERROR] urls[25] = file:/Users/jramirez/.m2/repository/net/sourceforge/htmlunit/htmlunit/2.7/htmlunit-2.7.jar
[ERROR] urls[26] = file:/Users/jramirez/.m2/repository/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar
[ERROR] urls[27] = file:/Users/jramirez/.m2/repository/org/w3c/css/sac/1.3/sac-1.3.jar
[ERROR] urls[28] = file:/Users/jramirez/.m2/repository/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7.jar
[ERROR] urls[29] = file:/Users/jramirez/.m2/repository/org/apache/httpcomponents/httpclient/4.1.1/httpclient-4.1.1.jar
[ERROR] urls[30] = file:/Users/jramirez/.m2/repository/org/apache/httpcomponents/httpmime/4.1.1/httpmime-4.1.1.jar
[ERROR] urls[31] = file:/Users/jramirez/.m2/repository/org/apache/httpcomponents/httpclient-cache/4.1.1/httpclient-cache-4.1.1.jar
[ERROR] urls[32] = file:/Users/jramirez/.m2/repository/org/apache/httpcomponents/httpcore/4.1.1/httpcore-4.1.1.jar
[ERROR] urls[33] = file:/Users/jramirez/.m2/repository/org/apache/httpcomponents/httpcore-nio/4.1.1/httpcore-nio-4.1.1.jar
[ERROR] urls[34] = file:/Users/jramirez/.m2/repository/org/apache/oltu/oauth2/org.apache.oltu.oauth2.client/0.31/org.apache.oltu.oauth2.client-0.31.jar
[ERROR] urls[35] = file:/Users/jramirez/.m2/repository/org/apache/oltu/oauth2/org.apache.oltu.oauth2.common/0.31/org.apache.oltu.oauth2.common-0.31.jar
[ERROR] urls[36] = file:/Users/jramirez/.m2/repository/org/codehaus/jettison/jettison/1.2/jettison-1.2.jar
[ERROR] urls[37] = file:/Users/jramirez/.m2/repository/org/apache/oltu/oauth2/org.apache.oltu.oauth2.httpclient4/0.31/org.apache.oltu.oauth2.httpclient4-0.31.jar
[ERROR] urls[38] = file:/Users/jramirez/.m2/repository/javax/activation/activation/1.1/activation-1.1.jar
[ERROR] urls[39] = file:/Users/jramirez/.m2/repository/javax/mail/mail/1.4/mail-1.4.jar
[ERROR] urls[40] = file:/Users/jramirez/.m2/repository/wsdl4j/wsdl4j/1.6.2-fixed/wsdl4j-1.6.2-fixed.jar
[ERROR] urls[41] = file:/Users/jramirez/.m2/repository/commons-ssl/not-yet-commons-ssl/0.3.11/not-yet-commons-ssl-0.3.11.jar
[ERROR] urls[42] = file:/Users/jramirez/.m2/repository/commons-cli/commons-cli/1.2/commons-cli-1.2.jar
[ERROR] urls[43] = file:/Users/jramirez/.m2/repository/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar
[ERROR] urls[44] = file:/Users/jramirez/.m2/repository/json/json-lib/2.2.2-jdk15/json-lib-2.2.2-jdk15.jar
[ERROR] urls[45] = file:/Users/jramirez/.m2/repository/ezmorph/ezmorph/1.0.5/ezmorph-1.0.5.jar
[ERROR] urls[46] = file:/Users/jramirez/.m2/repository/xom/xom/1.1/xom-1.1.jar
[ERROR] urls[47] = file:/Users/jramirez/.m2/repository/xerces/xmlParserAPIs/2.6.2/xmlParserAPIs-2.6.2.jar
[ERROR] urls[48] = file:/Users/jramirez/.m2/repository/jaxen/jaxen/1.1-beta-8/jaxen-1.1-beta-8.jar
[ERROR] urls[49] = file:/Users/jramirez/.m2/repository/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar
[ERROR] urls[50] = file:/Users/jramirez/.m2/repository/jdom/jdom/1.0/jdom-1.0.jar
[ERROR] urls[51] = file:/Users/jramirez/.m2/repository/swingx/swingx/soapui/swingx-soapui.jar
[ERROR] urls[52] = file:/Users/jramirez/.m2/repository/commons-codec/commons-codec/1.3/commons-codec-1.3.jar
[ERROR] urls[53] = file:/Users/jramirez/.m2/repository/org/codehaus/groovy/groovy-all/2.1.7/groovy-all-2.1.7.jar
[ERROR] urls[54] = file:/Users/jramirez/.m2/repository/rhino/js/1.7R2/js-1.7R2.jar
[ERROR] urls[55] = file:/Users/jramirez/.m2/repository/saxon/saxon/9.1.0.8j/saxon-9.1.0.8j.jar
[ERROR] urls[56] = file:/Users/jramirez/.m2/repository/saxon/saxon-dom/9.1.0.8j/saxon-dom-9.1.0.8j.jar
[ERROR] urls[57] = file:/Users/jramirez/.m2/repository/xmlunit/xmlunit/1.2/xmlunit-1.2.jar
[ERROR] urls[58] = file:/Users/jramirez/.m2/repository/xalan/xalan/2.7.1/xalan-2.7.1.jar
[ERROR] urls[59] = file:/Users/jramirez/.m2/repository/bouncycastle/bcprov-jdk15/144/bcprov-jdk15-144.jar
[ERROR] urls[60] = file:/Users/jramirez/.m2/repository/jtidy/jtidy/r872-jdk15/jtidy-r872-jdk15.jar
[ERROR] urls[61] = file:/Users/jramirez/.m2/repository/javax/jms/jms/1.1/jms-1.1.jar
[ERROR] urls[62] = file:/Users/jramirez/.m2/repository/hermesjms/hermes/1.14/hermes-1.14.jar
[ERROR] urls[63] = file:/Users/jramirez/.m2/repository/amf/flex-messaging-common/1.0/flex-messaging-common-1.0.jar
[ERROR] urls[64] = file:/Users/jramirez/.m2/repository/amf/flex-messaging-core/1.0/flex-messaging-core-1.0.jar
[ERROR] urls[65] = file:/Users/jramirez/.m2/repository/amf/flex-messaging-opt/1.0/flex-messaging-opt-1.0.jar
[ERROR] urls[66] = file:/Users/jramirez/.m2/repository/amf/flex-messaging-proxy/1.0/flex-messaging-proxy-1.0.jar
[ERROR] urls[67] = file:/Users/jramirez/.m2/repository/amf/flex-messaging-remoting/1.0/flex-messaging-remoting-1.0.jar
[ERROR] urls[68] = file:/Users/jramirez/.m2/repository/thoughtworks/xstream/1.3.1/xstream-1.3.1.jar
[ERROR] urls[69] = file:/Users/jramirez/.m2/repository/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar
[ERROR] urls[70] = file:/Users/jramirez/.m2/repository/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14.jar
[ERROR] urls[71] = file:/Users/jramirez/.m2/repository/org/samba/jcifs/jcifs/1.2.9/jcifs-1.2.9.jar
[ERROR] urls[72] = file:/Users/jramirez/.m2/repository/l2fprod/l2fprod-common-directorychooser/7.3/l2fprod-common-directorychooser-7.3.jar
[ERROR] urls[73] = file:/Users/jramirez/.m2/repository/l2fprod/l2fprod-common-fontchooser/7.3/l2fprod-common-fontchooser-7.3.jar
[ERROR] urls[74] = file:/Users/jramirez/.m2/repository/org/apache/santuario/xmlsec/1.4.5/xmlsec-1.4.5.jar
[ERROR] urls[75] = file:/Users/jramirez/.m2/repository/org/apache/xerces/xml-apis/2.9.1/xml-apis-2.9.1.jar
[ERROR] urls[76] = file:/Users/jramirez/.m2/repository/xalan/serializer/2.7.1/serializer-2.7.1.jar
[ERROR] urls[77] = file:/Users/jramirez/.m2/repository/xml-apis/xml-apis/1.3.04/xml-apis-1.3.04.jar
[ERROR] urls[78] = file:/Users/jramirez/.m2/repository/gnu/cajo/cajo/1.142/cajo-1.142.jar
[ERROR] urls[79] = file:/Users/jramirez/.m2/repository/org/apache/ws/commons/util/ws-commons-util/1.0.2/ws-commons-util-1.0.2.jar
[ERROR] urls[80] = file:/Users/jramirez/.m2/repository/com/btr/proxy-vole/20131209/proxy-vole-20131209.jar
[ERROR] urls[81] = file:/Users/jramirez/.m2/repository/com/jayway/jsonpath/json-path/0.9.1/json-path-0.9.1.jar
[ERROR] urls[82] = file:/Users/jramirez/.m2/repository/net/minidev/json-smart/1.2/json-smart-1.2.jar
[ERROR] urls[83] = file:/Users/jramirez/.m2/repository/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar
[ERROR] urls[84] = file:/Users/jramirez/.m2/repository/org/sonatype/install4j/i4jruntime/5.1.14/i4jruntime-5.1.14.jar
[ERROR] urls[85] = file:/Users/jramirez/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[maven.api, parent: null]]
[ERROR] 
[ERROR] -----------------------------------------------------
[ERROR] : ProxySelector must not be null.
[ERROR] -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

I also tried running in dev mode with ./mvnw quarkus:dev but got another error:

Joses-MacBook-Pro:quarkus-jaxws-client-test jramirez$ ./mvnw quarkus:dev
Exception in thread "main" java.lang.RuntimeException: Wrapper properties file '/Users/jramirez/Documents/github-issues/quarkus-jaxws-client-test/.mvn/wrapper/maven-wrapper.properties' does not exist.
    at org.apache.maven.wrapper.WrapperExecutor.forWrapperPropertiesFile(WrapperExecutor.java:54)
    at org.apache.maven.wrapper.MavenWrapperMain.main(MavenWrapperMain.java:60)
troosan commented 4 years ago

@jramirez-isc I added the missing mvnw files. But I'm not sure it will solve the first issue. Do you by any chance have a proxy defined? https://community.smartbear.com/t5/SoapUI-Pro/Can-t-start-under-OSX-when-system-proxy-is-selected/td-p/43732

jramirez-isc commented 4 years ago

@troosan Yes, the problem was my proxy settings. I could reproduce the issue you reported. I would suggest you use the native-image-agent to automatically detect all usages of dynamic features. It'll generate the reflect config files. As @cstancu said, in this case, the issue is caused by missing reflect config.

troosan commented 4 years ago

@jramirez-isc Thanks for the suggestion, I didn't know that tool. Unfortunately though it did not help. I updated the test project with the generated config.

I also added another rest endpoint that calls a webservice exposed on the internet (might not work if you are behind a proxy). The endpoint is http://localhost:8080/vat/GB/391313073 which calls the VIES webservice (https://ec.europa.eu/taxation_customs/vies/checkVatTestService.wsdl).

jramirez-isc commented 4 years ago

Hi @troosan, I see no errors when building it with GraalVM version 20.1.0. Can you please try that version? However, I got an error when testing http://localhost:8080/vat/GB/391313073 with the native image.

Caused by: javax.xml.ws.WebServiceException: Provider com.sun.xml.internal.ws.spi.ProviderImpl not found

This happens because the config for com.sun.xml is not added automatically. To include you can apply the filter suggested here in this comment. So you'd need to regenerate the config using the agent.

Also, make sure you specify all four config files in your application.properties:

    -H:ResourceConfigurationFiles=resource-config.json, \
    -H:ReflectionConfigurationFiles=reflect-config.json, \
    -H:JNIConfigurationFiles=jni-config.json, \
    -H:DynamicProxyConfigurationFiles=proxy-config.json, \
shourien commented 4 years ago

Hello @jramirez-isc, I have tried the above configurations as mentioned here for generating the native image and I was able to get past the above error by regenerating the config files using the filter and proceed further. However, I encountered another error

Sep 21, 2020 10:41:48 PM [com.sun.xml.ws.assembler.MetroConfigLoader]  getTubeCreators
SEVERE: MASM0004: No <tubelines> section found in the default [ jaxws-tubes-default.xml ] configuration file

I have jaxws-tubes-default.xml in my generated resource-config.json file, for reference below is the config.

{
  "resources":[
    {"pattern":"\\QMETA-INF/jaxws-tubes-default.xml\\E"},
    {"pattern":"\\QMETA-INF/services/com.sun.xml.ws.spi.db.BindingContextFactory\\E"},
    {"pattern":"\\QMETA-INF/services/java.nio.file.spi.FileSystemProvider\\E"},
    {"pattern":"\\QMETA-INF/services/javax.xml.bind.JAXBContext\\E"},
    {"pattern":"\\QMETA-INF/services/javax.xml.soap.SAAJMetaFactory\\E"},
    {"pattern":"\\QMETA-INF/services/javax.xml.stream.XMLInputFactory\\E"},
    {"pattern":"\\QMETA-INF/services/javax.xml.ws.spi.Provider\\E"},
    {"pattern":"\\Qcom/sun/xml/ws/util/version.properties\\E"}
  ],
  "bundles":[{"name":"com.sun.xml.ws.resources.tubelineassembly"}]
}
$ jar -tvf sample-1.0.0.jar | grep jaxws-tubes-default.xml
  2446 Tue Sep 22 08:29:10 AEST 2020 META-INF/jaxws-tubes-default.xml

I have also verified the contents of this file META-INF/jaxws-tubes-default.xml and its exactly as this Link I further had a look at the MetroConfigLoader.java file for jaxws-ri here Link and I believe it fails at the following line

if (defaultConfig.getTubelines() == null) {
            throw LOGGER.logSevereException(new IllegalStateException(TubelineassemblyMessages.MASM_0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(defaultFileName)));
        }

Do you have any pointers or clues that I can use to continue investigating further?

GraalVM version -> 20.1.0 CE or EE -> CE Build Time or run time failure -> run-time failure JDK version -> JDK11

$ gcc --version
gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-28)
$ java -Xinternalversion
OpenJDK 64-Bit Server VM (11.0.7+10-jvmci-20.1-b02) for linux-amd64 JRE (11.0.7+10-jvmci-20.1-b02), built on Apr 21 2020 13:02:22 by "buildslave" with gcc 7.3.0
shourien commented 4 years ago

I can confirm this problem persists even with Java 8. GraalVM version -> 20.1.0 CE or EE -> CE JDK version -> JDK8

Sep 22, 2020 10:55:32 PM [com.sun.xml.internal.ws.assembler.MetroConfigLoader]  getTubeCreators
SEVERE: [failed to localize] MASM0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(jaxws-tubes-default.xml)
java.lang.IllegalStateException: [failed to localize] MASM0004_NO_TUBELINES_SECTION_IN_DEFAULT_CFG_FILE(jaxws-tubes-default.xml)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.init(MetroConfigLoader.java:136)
at com.sun.xml.internal.ws.assembler.MetroConfigLoader.<init>(MetroConfigLoader.java:104)
at com.sun.xml.internal.ws.assembler.TubelineAssemblyController.getTubeCreators(TubelineAssemblyController.java:78)
at com.sun.xml.internal.ws.assembler.MetroTubelineAssembler.createClient(MetroTubelineAssembler.java:103)
at com.sun.xml.internal.ws.client.Stub.createPipeline(Stub.java:328)
at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:295)
at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:228)
at com.sun.xml.internal.ws.client.Stub.<init>(Stub.java:243)
at com.sun.xml.internal.ws.client.sei.SEIStub.<init>(SEIStub.java:84)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getStubHandler(WSServiceDelegate.java:814)
at com.sun.xml.internal.ws.client.WSServiceDelegate.createEndpointIFBaseProxy(WSServiceDelegate.java:803)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:436)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:404)
at com.sun.xml.internal.ws.client.WSServiceDelegate.getPort(WSServiceDelegate.java:386)
at javax.xml.ws.Service.getPort(Service.java:119)
at org.acme.soap_service.v1.MySoapService_Service.getMySoapServicePort(MySoapService_Service.java:68)
shourien commented 3 years ago

Finally I got this working.. Had to switch to apache cxf ws implementation. Used the latest 3.4.0 plugin and include 2 libraries cxf-rt-frontend-jaxws, cxf-rt-transports-http.

Regenerated the config files and finally able to invoke the Webservice.

cstancu commented 3 years ago

Thanks letting us know!

shourien commented 3 years ago

However, I would like to point out that I had to resort to -H:+ReportUnsupportedElementsAtRuntime even while using the latest GraalVM 20.2.0. Else I encounter the following error when the image is built. Could you please confirm if applying this flag is recommended? I picked up this idea from referring apache documentation

[server:25]     analysis: 128,956.00 ms,  3.92 GB
Error: com.oracle.svm.hosted.substitute.DeletedElementException: Unsupported method java.lang.ClassLoader.defineClass1(ClassLoader, String, byte[], int, int, ProtectionDomain, String) is reachable
To diagnose the issue, you can add the option --report-unsupported-elements-at-runtime. The unsupported element is then reported at run time when it is accessed the first time.
Detailed message:
Trace:
    at parsing java.lang.ClassLoader.defineClass(ClassLoader.java:1017)
Call path from entry point to java.lang.ClassLoader.defineClass(String, byte[], int, int, ProtectionDomain):
    at java.lang.ClassLoader.defineClass(ClassLoader.java:1015)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:878)
    at com.oracle.svm.reflect.ClassLoader_defineClass_c6c343b4d6dc22ca64eb2d8503b13ac9c340dcb3_386.invoke(Unknown Source)
    at java.lang.reflect.Method.invoke(Method.java:566)
    at javax.xml.transform.TransformerException.printStackTrace(TransformerException.java:345)
    at javax.xml.transform.TransformerException.printStackTrace(TransformerException.java:285)
    at com.oracle.svm.jni.functions.JNIFunctions.ExceptionDescribe(JNIFunctions.java:768)
    at com.oracle.svm.core.code.IsolateEnterStub.JNIFunctions_ExceptionDescribe_b5412f7570bccae90b000bc37855f00408b2ad73(generated:0)

Error: Use -H:+ReportExceptionStackTraces to print stacktrace of underlying exception
Error: Image build request failed with exit status 1
ambition-consulting commented 3 years ago

Also, you will be having a tough time when using cxf security, which by default is now using ehcache, which itself is OSGI based...

troosan commented 3 years ago

I'm actually surprised this was closed, as the issue is not fixed. The "fix" is to use another library.

sm3sher commented 1 year ago

So for now there is no way to successfully build a native image by using soap services with JAX-WS?