Uploaded image for project: 'CXF'
  1. CXF
  2. CXF-8340 Graalvm native image fails to run
  3. CXF-8366

allow to disable asmhelper generation



    • Type: Sub-task
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 3.4.0
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
    • Environment:

      all env. Win 10 on my laptor.

    • Estimated Complexity:



      I have succeed to make cxf running on quarkus in native. Goal of quarkus is to reduce memory footprint and speed up run time. 

      So, we have to move asm generation to build time.

      I have sucessfully done it on native part by doing susbstitution but it is not possible on jvm for all asmhelper usage. Because some asm generation are done from static method so it can not been overriden or substitute on parent class easily.

      Goal is to be able to override some class and inject the new instance to inject the class generated by quarkus on compile time directly to cxf and avoid asm generation during runtime.

      SOLUTION 1:

      I need that we have a factory class with singleton pattern wherer we can set instance and override and which can be set on CXFNonSpringServlet and JaxWsProxyFactoryBean.

      SOLUTION 2:

       add static method to add method to ASMHelper tocache class ever generated.

      Map<String, Class<?>> cache;

      and proxy this method in JAXBExtensionHelper/JAXBUtils /WrapperHelperCompiler with addGeneratedClass method and before generating class check if already in cache.

      JAXBContextInitializer is not static and use a pure ASMHelper. I propose to use JAXBUtils cache and check it before generating code.


      List of main class with asm generation:

      • org.apache.cxf.wsdl.JAXBExtensionHelper.createExtensionClass is a static method.

      So it can not been override and I can not change the class instance and inject it.

      Can you change that to a factory and an instance.  (best is to have the factory

      - org.apache.cxf.common.jaxb.JAXBUtils .createNamespaceWrapper

      • org.apache.cxf.endpoint.dynamic.TypeClassInitializer$ExceptionCreator. createExceptionClass

      - org.apache.cxf.jaxb.JAXBDataBinding.compileWrapperHelper or WrapperHelperCompiler 

      - org.apache.cxf.jaxb.JAXBContextInitializer.createFactory




            • Assignee:
              dufoli olivier dufour
            • Votes:
              0 Vote for this issue
              1 Start watching this issue


              • Created: