Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8340

Graalvm native image fails to run

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Open
    • Priority: Major
    • Resolution: Unresolved
    • Affects Version/s: 3.3.7
    • Fix Version/s: None
    • Component/s: Core
    • Estimated Complexity:
      Unknown

      Description

      Hello,

      My app is using spring boot 2.3.1 and CXF 3.3.7. I managed to create Graalvm native image, now I am trying to fix the issues that is happening during native image run. Currently I am encountering following issue. Looks like the native image fails when tries to create bean for the soap service. Any help would be appreciated. 

      I raised this issue with Spring GraalVM native community and they pointed the issue to CXF. Hence I am reaching out here for help.

      https://github.com/spring-projects-experimental/spring-graalvm-native/issues/273

       

      Here is the config method that creates the soap service

       

      @Bean("PublishingServiceClient")
          public PublishingService getPublishingClient(Bus bus, SoapServiceConfig soapServiceConfig) {
              final JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
              factory.setBus(bus);
              factory.setServiceClass(PublishingService.class);
              factory.setAddress(soapServiceConfig.getUrl());
              factory.setServiceName(new QName(name));
              final List<Feature> features = factory.getFeatures();
              if(soapServiceConfig.getMaxNumberOfRetries() > 0) {
                  features.add(getFailoverFeature(soapServiceConfig));
              }
              return (PublishingService) factory.create();
          }
      	
      	private Feature getFailoverFeature(SoapServiceConfig soapServiceConfig) {
              final RetryStrategy retryStrategy = new RetryStrategy();
              retryStrategy.setMaxNumberOfRetries(soapServiceConfig.getMaxNumberOfRetries());
              retryStrategy.setDelayBetweenRetries(soapServiceConfig.getDelayBetweenRetries());
              final List<String> addressList = new LinkedList<>();
              addressList.add(soapServiceConfig.getUrl());
              retryStrategy.setAlternateAddresses(addressList);
              final FailoverFeature failoverFeature = new FailoverFeature();
              failoverFeature.setStrategy(retryStrategy);
              return failoverFeature;
          }
      

      Here is error while running native image

      [2020-09-08 15:43:52.112-0500] [APP]  INFO 23684 --- [main] o.a.c.w.s.f.ReflectionServiceFactoryBean : Creating Service {http://mywebservice.com/publish}PublishingServiceService from class com.mywebservice.publish.PublishingService
      Fatal error reported via JNI: JVM_GetSystemPackage called:  Unimplemented
      Stacktrace Stage 2:
      
        SP 00000000007ce680 IP 00007ff7749dbf93  [image code] com.oracle.svm.core.code.IsolateEnterStub.JNIFunctions_FatalError_dea4272cf8e20ff701a0a73f7a6d5d75e3401653(IsolateEnterStub.java:0)
        SP 00000000007ce7c0 IP 00007ff7766cc9f4  [image code] java.lang.Package.getSystemPackage0(Package.java)
        SP 00000000007ce820 IP 00007ff7766cc8bb  [image code] java.lang.Package.getSystemPackage(Package.java:544)
        SP 00000000007ce860 IP 00007ff7766bb44c  [image code] java.lang.ClassLoader.getPackage(ClassLoader.java:1618)
        SP 00000000007ce8b0 IP 00007ff7766bb38b  [image code] java.lang.ClassLoader.getPackage(ClassLoader.java:1616)
        SP 00000000007ce900 IP 00007ff7766bb38b  [image code] java.lang.ClassLoader.getPackage(ClassLoader.java:1616)
        SP 00000000007ce950 IP 00007ff7772a3d9b  [image code] org.apache.cxf.common.util.ASMHelper$TypeHelperClassLoader.defineClass(ASMHelper.java:392)
        SP 00000000007ce9b0 IP 00007ff7772a8ab3  [image code] org.apache.cxf.common.util.ASMHelper.loadClass(ASMHelper.java:321)
        SP 00000000007ce9f0 IP 00007ff7774f2827  [image code] org.apache.cxf.jaxws.WrapperClassGenerator.generatePackageInfo(WrapperClassGenerator.java:267)
        SP 00000000007cea50 IP 00007ff7774ef654  [image code] org.apache.cxf.jaxws.WrapperClassGenerator.createWrapperClass(WrapperClassGenerator.java:169)
        SP 00000000007ceb30 IP 00007ff7774f09be  [image code] org.apache.cxf.jaxws.WrapperClassGenerator.generate(WrapperClassGenerator.java:122)
        SP 00000000007ceb70 IP 00007ff77754cd2c  [image code] org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.generatedWrapperBeanClass(JaxWsServiceFactoryBean.java:672)
        SP 00000000007ceb90 IP 00007ff77754d3a9  [image code] org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.getExtraClass(JaxWsServiceFactoryBean.java:642)
        SP 00000000007cebf0 IP 00007ff777699076  [image code] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.buildServiceFromClass(ReflectionServiceFactoryBean.java:463)
        SP 00000000007cec80 IP 00007ff77754c131  [image code] org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.buildServiceFromClass(JaxWsServiceFactoryBean.java:693)
        SP 00000000007ceca0 IP 00007ff7776b4182  [image code] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.initializeServiceModel(ReflectionServiceFactoryBean.java:529)
        SP 00000000007cece0 IP 00007ff77769ba2b  [image code] org.apache.cxf.wsdl.service.factory.ReflectionServiceFactoryBean.create(ReflectionServiceFactoryBean.java:262)
        SP 00000000007ced10 IP 00007ff77754c2d1  [image code] org.apache.cxf.jaxws.support.JaxWsServiceFactoryBean.create(JaxWsServiceFactoryBean.java:199)
        SP 00000000007ced40 IP 00007ff7772f55a8  [image code] org.apache.cxf.frontend.AbstractWSDLBasedEndpointFactory.createEndpoint(AbstractWSDLBasedEndpointFactory.java:103)
        SP 00000000007cedb0 IP 00007ff7772f9796  [image code] org.apache.cxf.frontend.ClientFactoryBean.create(ClientFactoryBean.java:91)
        SP 00000000007cedf0 IP 00007ff7772fb02a  [image code] org.apache.cxf.frontend.ClientProxyFactoryBean.create(ClientProxyFactoryBean.java:159)
        SP 00000000007cee40 IP 00007ff7774df366  [image code] org.apache.cxf.jaxws.JaxWsProxyFactoryBean.create(JaxWsProxyFactoryBean.java:142)
        SP 00000000007ceeb0 IP 00007ff7764dd302  [image code] com.myapp.config.CxfConfig.gePublishingClient(CxfConfig.java:71)
        SP 00000000007ceee0 IP 00007ff7750f7c24  [image code] com.oracle.svm.reflect.CxfConfig_gePublishingClient_3d3d3b652097ee9557dd0cbed555428ec2c537c9.invoke(Unknown Source)
        SP 00000000007cef10 IP 00007ff7767445d9  [image code] java.lang.reflect.Method.invoke(Method.java:498)
        SP 00000000007cef40 IP 00007ff7788167ae  [image code] org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:154)
        SP 00000000007cefb0 IP 00007ff7787e2546  [image code] org.springframework.beans.factory.support.ConstructorResolver.instantiate(ConstructorResolver.java:650)
        SP 00000000007ceff0 IP 00007ff7787e29dd  [image code] org.springframework.beans.factory.support.ConstructorResolver.instantiateUsingFactoryMethod(ConstructorResolver.java:635)
        SP 00000000007cf110 IP 00007ff7787b3c3e  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateUsingFactoryMethod(AbstractAutowireCapableBeanFactory.java:1338)
        SP 00000000007cf140 IP 00007ff7787acb88  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1177)
        SP 00000000007cf1a0 IP 00007ff7787adbf3  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
        SP 00000000007cf220 IP 00007ff7787abf36  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
        SP 00000000007cf290 IP 00007ff7787cc0f9  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
        SP 00000000007cf2c0 IP 00007ff7787bff4e  [image code] org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$2c40051508af481f3e2b011afbd5800cdeae9fd3.getObject(Unknown Source)
        SP 00000000007cf2d0 IP 00007ff77880713b  [image code] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
        SP 00000000007cf340 IP 00007ff7787c2fc5  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
        SP 00000000007cf3d0 IP 00007ff77879b8a0  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        SP 00000000007cf3d0 IP 00007ff77879b8a0  [image code] org.springframework.beans.factory.config.DependencyDescriptor.resolveCandidate(DependencyDescriptor.java:276)
        SP 00000000007cf3e0 IP 00007ff7787f53b8  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.doResolveDependency(DefaultListableBeanFactory.java:1304)
        SP 00000000007cf460 IP 00007ff7787fffdc  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.resolveDependency(DefaultListableBeanFactory.java:1224)
        SP 00000000007cf4b0 IP 00007ff7787e63c9  [image code] org.springframework.beans.factory.support.ConstructorResolver.resolveAutowiredArgument(ConstructorResolver.java:884)
        SP 00000000007cf520 IP 00007ff7787e022b  [image code] org.springframework.beans.factory.support.ConstructorResolver.createArgumentArray(ConstructorResolver.java:788)
        SP 00000000007cf640 IP 00007ff7787dbda9  [image code] org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:227)
        SP 00000000007cf730 IP 00007ff7787aad0f  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1358)
        SP 00000000007cf770 IP 00007ff7787acef0  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1204)
        SP 00000000007cf7d0 IP 00007ff7787adbf3  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:557)
        SP 00000000007cf850 IP 00007ff7787abf36  [image code] org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:517)
        SP 00000000007cf8c0 IP 00007ff7787cc0f9  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:323)
        SP 00000000007cf8f0 IP 00007ff7787bff4e  [image code] org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$2c40051508af481f3e2b011afbd5800cdeae9fd3.getObject(Unknown Source)
        SP 00000000007cf900 IP 00007ff77880713b  [image code] org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:226)
        SP 00000000007cf970 IP 00007ff7787c2fc5  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:321)
        SP 00000000007cfa00 IP 00007ff7787fbcfa  [image code] org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
        SP 00000000007cfa00 IP 00007ff7787fbcfa  [image code] org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:893)
        SP 00000000007cfa60 IP 00007ff778a709a1  [image code] org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879)
        SP 00000000007cfaa0 IP 00007ff778a7668a  [image code] org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
        SP 00000000007cfb00 IP 00007ff7789fc201  [image code] org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
        SP 00000000007cfb20 IP 00007ff77885b17b  [image code] org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
        SP 00000000007cfb20 IP 00007ff77885b17b  [image code] org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
        SP 00000000007cfb50 IP 00007ff77885b1e9  [image code] org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
        SP 00000000007cfb70 IP 00007ff77885b978  [image code] org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
        SP 00000000007cfbe0 IP 00007ff77885c433  [image code] org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
        SP 00000000007cfc00 IP 00007ff7764da85a  [image code] org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
        SP 00000000007cfc00 IP 00007ff7764da85a  [image code] com.myapps.MainApplication.main(LocalAbeServiceApplication.java:23)
        SP 00000000007cfc70 IP 00007ff7749e917f  [image code] com.oracle.svm.core.JavaMainWrapper.runCore(JavaMainWrapper.java:149)
        SP 00000000007cfc70 IP 00007ff7749e917f  [image code] com.oracle.svm.core.JavaMainWrapper.run(JavaMainWrapper.java:184)
        SP 00000000007cfc70 IP 00007ff7749e917f  [image code] com.oracle.svm.core.code.IsolateEnterStub.JavaMainWrapper_run_5087f5482cc9a6abc971913ece43acb471d2631b(IsolateEnterStub.java:0)
      

        Attachments

          Activity

            People

            • Assignee:
              reta Andriy Redko
              Reporter:
              sendev1 sendev
            • Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated: