syndesisio / syndesis-integration-runtime

Apache License 2.0
1 stars 6 forks source link

Error with datamapper #10

Open rhuss opened 7 years ago

rhuss commented 7 years ago

When deploying an integration with a datamapper included:

---
flows:
- steps:
  - kind: endpoint
    uri: twitter-mention
  - kind: endpoint
    uri: atlas:mapping-step-2.json
  - kind: log
    message: Hello, I was mentioned ${body}
    loggingLevel: INFO
  - kind: endpoint
    uri: salesforce-upsert-contact

and with this mapping file

{
  "AtlasMapping": {
    "jsonType": "io.atlasmap.v2.AtlasMapping",
    "dataSource": [
      {
        "jsonType": "io.atlasmap.v2.DataSource",
        "id": "twitter4j.Status",
        "uri": "atlas:java?className=twitter4j.Status",
        "dataSourceType": "SOURCE"
      },
      {
        "jsonType": "io.atlasmap.v2.DataSource",
        "id": "io.syndesis.connector.salesforce.Contact",
        "uri": "atlas:java?className=io.syndesis.connector.salesforce.Contact",
        "dataSourceType": "TARGET"
      }
    ],
    "mappings": {
      "mapping": [
        {
          "jsonType": "io.atlasmap.v2.Mapping",
          "mappingType": "MAP",
          "inputField": [
            {
              "jsonType": "io.atlasmap.java.v2.JavaField",
              "name": "screenName",
              "path": "/user/screenName",
              "fieldType": "STRING",
              "docId": "twitter4j.Status"
            }
          ],
          "outputField": [
            {
              "jsonType": "io.atlasmap.java.v2.JavaField",
              "name": "TwitterScreenName__c",
              "path": "/TwitterScreenName__c",
              "fieldType": "STRING",
              "docId": "io.syndesis.connector.salesforce.Contact"
            }
          ]
        }
      ]
    },
    "name": "UI.486657",
    "lookupTables": {
      "lookupTable": []
    },
    "properties": {
      "property": []
    }
  }
}

I get the following error:

com.mediadriver.atlas.api.v2.AtlasValidationException: com.fasterxml.jackson.databind.exc.InvalidTypeIdException: Could not resolve type id 'io.atlasmap.v2.AtlasMapping' into a subtype of [simple type, class com.mediadriver.atlas.v2.AtlasMapping]: no such class found
 at [Source: java.io.InputStreamReader@fe38a6f; line: 1, column: 29]
    at com.mediadriver.atlas.core.v2.AtlasMappingService.loadMappingJson(AtlasMappingService.java:123)
    at org.apache.camel.component.atlasmap.AtlasEndpoint.onExchange(AtlasEndpoint.java:180)
    at org.apache.camel.impl.ProcessorEndpoint$1.process(ProcessorEndpoint.java:71)
    at org.apache.camel.util.AsyncProcessorConverterHelper$ProcessorToAsyncProcessorBridge.process(AsyncProcessorConverterHelper.java:61)
    at org.apache.camel.processor.SendProcessor.process(SendProcessor.java:145)
    at org.apache.camel.management.InstrumentationProcessor.process(InstrumentationProcessor.java:77)
    at org.apache.camel.processor.RedeliveryErrorHandler.process(RedeliveryErrorHandler.java:541)
    at org.apache.camel.processor.CamelInternalProcessor.process(CamelInternalProcessor.java:198)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:120)
    at org.apache.camel.processor.Pipeline.process(Pipeline.java:83)

It seems that somewhere still the package com.mediadriver.atlas is referenced but should be io.atlasmap

@jimmidyson any idea where this comes from ?

dsimansk commented 7 years ago

@rhuss I've seen it today also and I suspect old version of camel-atlasmap that was released on 26th Apr.

rhuss commented 7 years ago

@dsimansk you are right: The json mapping references the new io.atlasmap, but thats nothing on the classpath for this old component. I will update the camel-atlasmap to the latest version.

rhuss commented 7 years ago

Openend issue at https://github.com/atlasmap/camel-atlasmap/issues/9 for that. Is not so trivial, though as we need to re-implement some missing features.