Uploaded image for project: 'Red Hat Fuse'
  1. Red Hat Fuse
  2. ENTESB-17391

CamelK+AtlasMap NullPointerException reading ADM file

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Obsolete
    • Icon: Major Major
    • camel-k-future
    • fuse-7.9-GA
    • Atlas Map, Camel-K
    • None
    • False
    • False
    • % %
    • Todo
    • Hide

      Uncompress the attached Camel K project and run with:

      kamel run --dev transform.xml --resource individual.xml --resource test.adm
      

       

      You should see the following exception

      ERROR [io.atl.cor.DefaultAtlasContext] (Camel (camel-1) thread #0 - timer://xml) null: java.lang.NullPointerException
      [1] 	at io.atlasmap.core.DefaultAtlasCompoundClassLoader.getResource(DefaultAtlasCompoundClassLoader.java:50)
      [1] 	at java.base/java.lang.ClassLoader.getResourceAsStream(ClassLoader.java:1737)
      [1] 	at javax.xml.transform.SecuritySupport$4.run(Unknown Source)
      [1] 	at java.base/java.security.AccessController.doPrivileged(Native Method)
      [1] 	at javax.xml.transform.SecuritySupport.getResourceAsStream(Unknown Source)
      [1] 	at javax.xml.transform.FactoryFinder.findJarServiceProvider(Unknown Source)
      [1] 	at javax.xml.transform.FactoryFinder.find(Unknown Source)
      [1] 	at javax.xml.transform.TransformerFactory.newInstance(Unknown Source)
      [1] 	at io.atlasmap.xml.core.XmlIOHelper.<init>(XmlIOHelper.java:42)
      [1] 	at io.atlasmap.xml.module.XmlModule.init(XmlModule.java:75)
      [1] 	at io.atlasmap.core.DefaultAtlasContext.init(DefaultAtlasContext.java:222)
      [1] 	at io.atlasmap.core.DefaultAtlasContext.createSession(DefaultAtlasContext.java:881)
      [1] 	at org.apache.camel.component.atlasmap.AtlasMapEndpoint.onExchange(AtlasMapEndpoint.java:179)
      [1] 	at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
      [1] 	at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66)
      [1] 	at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172)
      [1] 	at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463)
      [1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179)
      [1] 	at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64)
      [1] 	at org.apache.camel.processor.Pipeline.process(Pipeline.java:184)
      [1] 	at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398)
      [1] 	at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:209)
      [1] 	at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76)
      [1] 	at java.base/java.util.TimerThread.mainLoop(Timer.java:556)
      [1] 	at java.base/java.util.TimerThread.run(Timer.java:506)
      

      Running similar XML Camel using Camel Quarkus, all executes well.

      Uncompress the Camel Quarkus attached project and run with:

      mvn clean compile quarkus:dev
      

      You should see the following output:

      INFO  [xml-route] (Camel (quarkus-camel-example-xml) thread #0 - timer://from-xml) after: {"fullName":"Some","addressLine1":"Somewhere","addressLine2":"Somewhere","addressLine3":"Somewhere"}
      

       

      Comparing both dependency versions for Camel Quarkus AtlasMap I see both, Camel K and Camel Quarkus, are the same:

      [DEBUG] org.apache.camel:camel-atlasmap:jar:3.10.0.fuse-800010-redhat-00001:compile (version managed from 3.10.0.fuse-800010-redhat-00001)
      
      Show
      Uncompress the attached Camel K project and run with: kamel run --dev transform.xml --resource individual.xml --resource test.adm   You should see the following exception ERROR [io.atl.cor.DefaultAtlasContext] (Camel (camel-1) thread #0 - timer: //xml) null : java.lang.NullPointerException [1] at io.atlasmap.core.DefaultAtlasCompoundClassLoader.getResource(DefaultAtlasCompoundClassLoader.java:50) [1] at java.base/java.lang. ClassLoader .getResourceAsStream( ClassLoader .java:1737) [1] at javax.xml.transform.SecuritySupport$4.run(Unknown Source) [1] at java.base/java.security.AccessController.doPrivileged(Native Method) [1] at javax.xml.transform.SecuritySupport.getResourceAsStream(Unknown Source) [1] at javax.xml.transform.FactoryFinder.findJarServiceProvider(Unknown Source) [1] at javax.xml.transform.FactoryFinder.find(Unknown Source) [1] at javax.xml.transform.TransformerFactory.newInstance(Unknown Source) [1] at io.atlasmap.xml.core.XmlIOHelper.<init>(XmlIOHelper.java:42) [1] at io.atlasmap.xml.module.XmlModule.init(XmlModule.java:75) [1] at io.atlasmap.core.DefaultAtlasContext.init(DefaultAtlasContext.java:222) [1] at io.atlasmap.core.DefaultAtlasContext.createSession(DefaultAtlasContext.java:881) [1] at org.apache.camel.component.atlasmap.AtlasMapEndpoint.onExchange(AtlasMapEndpoint.java:179) [1] at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61) [1] at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:66) [1] at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:172) [1] at org.apache.camel.processor.errorhandler.RedeliveryErrorHandler$SimpleTask.run(RedeliveryErrorHandler.java:463) [1] at org.apache.camel.impl.engine.DefaultReactiveExecutor$Worker.schedule(DefaultReactiveExecutor.java:179) [1] at org.apache.camel.impl.engine.DefaultReactiveExecutor.scheduleMain(DefaultReactiveExecutor.java:64) [1] at org.apache.camel.processor.Pipeline.process(Pipeline.java:184) [1] at org.apache.camel.impl.engine.CamelInternalProcessor.process(CamelInternalProcessor.java:398) [1] at org.apache.camel.component.timer.TimerConsumer.sendTimerExchange(TimerConsumer.java:209) [1] at org.apache.camel.component.timer.TimerConsumer$1.run(TimerConsumer.java:76) [1] at java.base/java.util.TimerThread.mainLoop(Timer.java:556) [1] at java.base/java.util.TimerThread.run(Timer.java:506) Running similar XML Camel using Camel Quarkus, all executes well. Uncompress the Camel Quarkus attached project and run with: mvn clean compile quarkus:dev You should see the following output: INFO [xml-route] (Camel (quarkus-camel-example-xml) thread #0 - timer: //from-xml) after: { "fullName" : "Some" , "addressLine1" : "Somewhere" , "addressLine2" : "Somewhere" , "addressLine3" : "Somewhere" }   Comparing both dependency versions for Camel Quarkus AtlasMap I see both, Camel K and Camel Quarkus, are the same: [DEBUG] org.apache.camel:camel-atlasmap:jar:3.10.0.fuse-800010-redhat-00001:compile (version managed from 3.10.0.fuse-800010-redhat-00001)

      Using Red Hat Camel K v1.4

      A camel route fails to execute the AtlasMap camel component. The route throws a NullPointerException.

      Camel AtlasMap finds the ADM file, but then fails.

      The same Camel code works well when running locally with Camel Quarkus.

       

              toigaras@redhat.com tomohisa igarashi
              bmesegue@redhat.com Bruno Meseguer
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: