You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/07/28 15:09:34 UTC

[GitHub] [camel-k] kyal2000 opened a new issue #2534: Component: AtlasMap - NullPointerException

kyal2000 opened a new issue #2534:
URL: https://github.com/apache/camel-k/issues/2534


   We already discussed this one on Zulip:
   
   Dennis Wiesemann: I want to use a AtlasMap mapping in my Route
   My Route looks as follows:
   ```
   from("timer:java?period=10000")
                 .setBody()
                   .constant(<JSON Object>)
                 .to("log:info")
                 .to("atlasmap:pricesJsonXml.adm")
                 .to("log:info");
   ```
   Run command: `kamel run --dev -n demo-case AtlasTest.java --source pricesJsonXml.adm --compression`
   
   I'm getting this error: `AtlasMap context cannot initialize without mapping definition, ignoring: Mapping URI=null`
   With an NullPointerException
   
   Does anyone know where this comes from?
   
   Thanks in advance
   
   Aurélien Pupier: I think the --source is not the right argument:
   from kamel run --help:
   --source stringArray             Add source file to your integration, this is added to the list of files listed as arguments of the command
   I think it should be --resource to use:
   --resource stringArray           Add a runtime resource from a Configmap, a Secret or a file (syntax: [configmap|secret|file]:name[/key][@path], where name represents the local file path or the configmap/secret name, key optionally represents the configmap/secret key to be filtered and path represents the destination path)
   
   Dennis Wiesemann: Yes you're right my bad i copied the wrong command i already used --resource
   
   Luca Burgazzoli: does it work with --resource ?
   
   Dennis Wiesemann: No i get this error with --resource
   
   Luca Burgazzoli: can you try with 'atlasmap:classpath:/pricesJsonXml.adm'
   
   Dennis Wiesemann: Got the same exception
   
   Luca Burgazzoli: ok, one last attempt
   
   Luca Burgazzoli: --resource file:pricesJsonXml.adm@/tmp/pricesJsonXml.adm
   
   Luca Burgazzoli: then atlasmap:file:/tmp/pricesJsonXml.adm
   
   Dennis Wiesemann: When running the run command i get:
   panic: runtime error: invalid memory address or nil pointer dereference
   
   Luca Burgazzoli: which version of camel k ?
   
   Dennis Wiesemann: 1.5
   
   Luca Burgazzoli: try without the @
   
   Luca Burgazzoli: --resource file:pricesJsonXml.adm
   
   Luca Burgazzoli: then atlasmap:file:/etc/camel/resources/pricesJsonXml.adm
   
   Luca Burgazzoli: Dennis Wiesemann said:
   
   When running the run command i get:
   panic: runtime error: invalid memory address or nil pointer dereference
   
   @Pasquale Congiusti ^^^
   
   Dennis Wiesemann: First of all sorry
   Forgot to upgrade the local kamel client :-)
   now both alternatives throw the same NullPointerException as before
   
   Luca Burgazzoli: ok, needs to be investigated more
   
   Luca Burgazzoli: mind opening an issue ?
   
   Dennis Wiesemann: Okay i'll open one


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] kyal2000 commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
kyal2000 commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-904514808


   I tried this and still get an error but it's no more a NullPointerException 
   
   This is my hole log:
   ```
   [1] ←[39m←[38;5;145m2021-08-24 10:12:33,425←[39m←[38;5;188m ←[39m←[38;5;107mINFO ←[39m←[38;5;188m [←[39m←[38;5;69minfo←[39m←[38;5;188m] (←[39m←[38;5;71mCamel (camel-1) thread #0 - timer://java←[39m←[38;5;188m) ←[39m←[38;5;151mExchange[ExchangePattern: InOnly, BodyType: String, Body: {"hello":"world"}]←[3
   9m←[38;5;203m←[39m←[38;5;227m
   [1] ←[39m←[38;5;145m2021-08-24 10:12:33,430←[39m←[38;5;188m ←[39m←[38;5;203mERROR←[39m←[38;5;188m [←[39m←[38;5;69morg.apa.cam.pro.err.DefaultErrorHandler←[39m←[38;5;188m] (←[39m←[38;5;71mCamel (camel-1) thread #0 - timer://java←[39m←[38;5;188m) ←[39m←[38;5;151mFailed delivery for (MessageId: 5E28F1107275
   2ED-0000000000000004 on ExchangeId: 5E28F11072752ED-0000000000000004). Exhausted after delivery attempt: 1 caught: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[]
   [1]
   [1] Message History (complete message history is disabled)
   [1] ---------------------------------------------------------------------------------------------------------------------------------------
   [1] RouteId              ProcessorId          Processor                                                                        Elapsed (ms)
   [1] [route1            ] [route1            ] [from[timer://java?period=10000]                                               ] [         5]
   [1]     ...
   [1] [route1            ] [to2               ] [atlasmap:file:/tmp/atlas.adm                                                  ] [         0]
   [1]
   [1] Stacktrace
   [1] ---------------------------------------------------------------------------------------------------------------------------------------
   [1] ←[39m←[38;5;203m: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[]
   [1]     at org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:45)
   [1]     at org.apache.camel.support.AbstractExchange.setException(AbstractExchange.java:589)
   [1]     at org.apache.camel.support.DefaultExchange.setException(DefaultExchange.java:27)
   [1]     at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:69)
   [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:210)
   [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)
   [1] Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
   [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]     ... 10 more
   [1] ←[39m←[38;5;227m
   [1] ←[39m←[38;5;145m2021-08-24 10:12:33,432←[39m←[38;5;188m ←[39m←[38;5;137mWARN ←[39m←[38;5;188m [←[39m←[38;5;69morg.apa.cam.com.tim.TimerConsumer←[39m←[38;5;188m] (←[39m←[38;5;71mCamel (camel-1) thread #0 - timer://java←[39m←[38;5;188m) ←[39m←[38;5;151mError processing exchange. Exchange[5E28F11072752E
   D-0000000000000004]. Caused by: [org.apache.camel.CamelExecutionException - Exception occurred during execution on the exchange: Exchange[]]←[39m←[38;5;203m: org.apache.camel.CamelExecutionException: Exception occurred during execution on the exchange: Exchange[]
   [1]     at org.apache.camel.CamelExecutionException.wrapCamelExecutionException(CamelExecutionException.java:45)
   [1]     at org.apache.camel.support.AbstractExchange.setException(AbstractExchange.java:589)
   [1]     at org.apache.camel.support.DefaultExchange.setException(DefaultExchange.java:27)
   [1]     at org.apache.camel.support.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:69)
   [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:210)
   [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)
   [1] Caused by: javax.xml.transform.TransformerFactoryConfigurationError: Provider org.apache.xalan.processor.TransformerFactoryImpl not found
   [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]     ... 10 more
   [1] ←[39m←[38;5;227m
   ```
   
   I even tried a new small "hello world mapping" to check if there is a problem with my mapping but i got the same error


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-904626422


   According to the stacktrace, it seems that the runtime is missing `xalan` dependencies. Can you try the same by forcing that dependency (via `-d` option with run command)? I wonder if those classes are removed by the Quarkus runtime because it is instantiated at runtime and therefore not available when needed. In such case, the workaround proposed in #2558 may be useful as well.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] kyal2000 commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
kyal2000 commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-904695172


   With the `xalan` dependency it works thank you


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-896120145


   I've run the following route with version 1.5:
   ```
       from("timer:java?period=10000")
                     .setBody()
                       .constant("{\"hello\":\"world\"}")
                     .to("log:info")
                     .to("atlasmap:file:/tmp/atlas.adm")
                     .to("log:info");
   ```
   I've provided the configuration file expected by the route via `--resource`:
   ```
   kamel run AtlasMap.java --dev --resource file:atlasmap-mapping.adm@/tmp/atlas.adm
   ```
   It's working as expected. Can you please attach the whole log to troubleshoot better the problem? Also, in order to confirm that the configuration file is correctly uploaded into the expected location, you can check by listing it via:
   ```
   kubectl exec --stdin --tty atlas-map-f4454498d-cbd5m -- ls -larth /tmp/atlas.adm
   ```
   where `atlas-map-f4454498d-cbd5m` is the name of the running pod.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] kyal2000 commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
kyal2000 commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-904525964


   I just tested it with a JSON to JSON Mapping and this one works fine
   
   So the error only appears with the JSON to XML Mapping


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] kyal2000 closed issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
kyal2000 closed issue #2534:
URL: https://github.com/apache/camel-k/issues/2534


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-k] squakez commented on issue #2534: Component: AtlasMap - NullPointerException

Posted by GitBox <gi...@apache.org>.
squakez commented on issue #2534:
URL: https://github.com/apache/camel-k/issues/2534#issuecomment-890995314


   Thanks for reporting, I'm going to have a look soon.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org