You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by "fluentintegrations (via GitHub)" <gi...@apache.org> on 2023/03/09 06:18:44 UTC

[GitHub] [camel-quarkus] fluentintegrations opened a new issue, #4633: AtlasMap - NullPointerException in native mode

fluentintegrations opened a new issue, #4633:
URL: https://github.com/apache/camel-quarkus/issues/4633

   The AtlasMap component throws a Nullpointer exception when trying to convert JSON to CSV. This is only occurring in native mode, JVM works without any issues.
   
   Camel quarkus version: 2.16.2.Final
   
   Mapping resource has been included in application properties:
   `quarkus.native.resources.includes=mapping/*.adm,mapping/*.json`
   
   
   Stacktrace is:
   `java.lang.NullPointerException
           at io.atlasmap.core.DefaultAtlasContext.validateVersion(DefaultAtlasContext.java:133)
           at io.atlasmap.core.DefaultAtlasContext.init(DefaultAtlasContext.java:176)
           at io.atlasmap.core.DefaultAtlasContext.createSession(DefaultAtlasContext.java:931)
           at org.apache.camel.component.atlasmap.AtlasMapEndpoint.onExchange(AtlasMapEndpoint.java:191)
           at org.apache.camel.support.ProcessorEndpoint$1.process(ProcessorEndpoint.java:61)
   `
   
   Input Json:
   `{
     "data": {
       "virtualPositions": {
         "virtualPositionEdge": [
           {
             "virtualPosition": {
               "ref": "WH11:LOC:BASE",
               "type": "BASE",
               "status": "ACTIVE",
               "quantity": 0,
               "productRef": "WH11",
               "groupRef": "LOC",
               "catalogue": {
                 "ref": "BASE"
               },
               "updatedOn": "2023-01-16T23:30:17.857Z",
               "createdOn": "2021-06-29T06:15:12.634Z"
             },
             "cursor": "Y3Vyc29yOi0tLWY1ODYyNDA4LWU1NTItNDE0Yy04MmIwLWRlOTNiZWEwYTFlM19fMTYyNDk0NzMxMjYzNA=="
           }
         ],
         "pageInfo": {
           "hasNextPage": false
         }
       }
     }
   }
   `
   
   Mapping:
   <img width="1728" alt="Screen Shot 2023-03-09 at 17 13 58" src="https://user-images.githubusercontent.com/126861290/223936389-ca69308e-308b-4f92-bc9f-afbbc1d08f77.png">
   
   [virtual-positions-to-csv-mapping.adm.zip](https://github.com/apache/camel-quarkus/files/10928395/virtual-positions-to-csv-mapping.adm.zip)
   
   Expected output is a CSV representation of the above JSON. 
   Actual is a Nullpointer exception.
   


-- 
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.apache.org

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


[GitHub] [camel-quarkus] jamesnetherton commented on issue #4633: AtlasMap - NullPointerException in native mode

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4633:
URL: https://github.com/apache/camel-quarkus/issues/4633#issuecomment-1463375068

   > Thank you @jamesnetherton. Adding the atlasmap.properties in the resources folder and to the list of quarkus.native.resources.includes resolved my issue.
   
   Glad that it solved the problem.
   
   Reopening the issue so we can fix this permanently in the AtlasMap extension. 


-- 
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-quarkus] fluentintegrations closed issue #4633: AtlasMap - NullPointerException in native mode

Posted by "fluentintegrations (via GitHub)" <gi...@apache.org>.
fluentintegrations closed issue #4633: AtlasMap - NullPointerException in native mode
URL: https://github.com/apache/camel-quarkus/issues/4633


-- 
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-quarkus] jamesnetherton commented on issue #4633: AtlasMap - NullPointerException in native mode

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton commented on issue #4633:
URL: https://github.com/apache/camel-quarkus/issues/4633#issuecomment-1461467110

   A classpath resource is attempted to be read and silently fails:
   
   https://github.com/atlasmap/atlasmap/blob/7f8feba99eee59d409ab96bd4f080b1a14823250/lib/core/src/main/java/io/atlasmap/core/DefaultAtlasContextFactory.java#L120
   
   With the debug log level enabled we see:
   
   ```
   2023-03-09 07:18:26,649 DEBUG [io.atl.cor.DefaultAtlasContextFactory] (main) Failed to read atlasmap.properties: java.lang.NullPointerException: inStream parameter is null
           at java.base@17.0.6/java.util.Objects.requireNonNull(Objects.java:233)
           at java.base@17.0.6/java.util.Properties.load(Properties.java:407)
           at io.atlasmap.core.DefaultAtlasContextFactory.init(DefaultAtlasContextFactory.java:116)
           at io.atlasmap.core.DefaultAtlasContextFactory.init(DefaultAtlasContextFactory.java:102)
           at io.atlasmap.core.DefaultAtlasContextFactory.getInstance(DefaultAtlasContextFactory.java:92)
           at io.atlasmap.core.DefaultAtlasContextFactory.getInstance(DefaultAtlasContextFactory.java:77)
   ```
   
   Try adding `atlasmap.properties` to `quarkus.native.resources.includes`.


-- 
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-quarkus] jamesnetherton closed issue #4633: AtlasMap - NullPointerException in native mode

Posted by "jamesnetherton (via GitHub)" <gi...@apache.org>.
jamesnetherton closed issue #4633: AtlasMap - NullPointerException in native mode
URL: https://github.com/apache/camel-quarkus/issues/4633


-- 
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-quarkus] fluentintegrations commented on issue #4633: AtlasMap - NullPointerException in native mode

Posted by "fluentintegrations (via GitHub)" <gi...@apache.org>.
fluentintegrations commented on issue #4633:
URL: https://github.com/apache/camel-quarkus/issues/4633#issuecomment-1462932187

   Thank you @jamesnetherton. Adding the `atlasmap.properties` in the resources folder and to the list of `quarkus.native.resources.includes` resolved my issue.


-- 
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