Hi Viraj,

I used the schema from connector and also I tried to create the schema from
the exact payload that I received before the data mapper. In both cases I'm
getting the same error.

Please find the payload and input output schama:

{
   "id":"PS9VE7M",
   "incident_number":3,
   "created_on":"2016-06-15T11:33:51Z",
   "status":"resolved",
   "pending_actions":[

   ],
   "html_url":"https://connectordemo.pagerduty.com/incidents/PS9VE7M";,
   "incident_key":"3c45415469ed415d8137b8ea9fe2fc03",
   "service":{
      "id":"P4OWETP",
      "name":"testService",
      "html_url":"https://connectordemo.pagerduty.com/services/P4OWETP";,
      "deleted_at":null,
      "description":"This is for testing purpose"
   },
   "escalation_policy":{
      "id":"PDJQDGY",
      "name":"Default",
      "deleted_at":null
   },
   "assigned_to_user":null,
   "trigger_summary_data":{
      "subject":"serviceTest"
   },
   "trigger_details_html_url":"
https://connectordemo.pagerduty.com/incidents/PS9VE7M/log_entries/Q324O08PK4VLJV
",
   "trigger_type":"web_trigger",
   "last_status_change_on":"2016-06-15T15:33:51Z",
   "last_status_change_by":null,
   "number_of_escalations":0,
   "resolved_by_user":null,
   "assigned_to":[

   ],
   "urgency":"high"
}



==================================================

*pdJiraConfig_inputSchema.json :*

{
  "id" : "http://wso2jsonschema.org";,
  "title" : "root",
  "$schema" : "http://json-schema.org/draft-04/schema#";,
  "properties" : {
    "last_status_change_on" : {
      "id" : "http://wso2jsonschema.org/last_status_change_on";,
      "type" : "string"
    },
    "status" : {
      "id" : "http://wso2jsonschema.org/status";,
      "type" : "string"
    },
    "created_on" : {
      "id" : "http://wso2jsonschema.org/created_on";,
      "type" : "string"
    },
    "last_status_change_by" : {
      "id" : "http://wso2jsonschema.org/last_status_change_by";,
      "type" : "string"
    },
    "incident_key" : {
      "id" : "http://wso2jsonschema.org/incident_key";,
      "type" : "string"
    },
    "trigger_type" : {
      "id" : "http://wso2jsonschema.org/trigger_type";,
      "type" : "string"
    },
    "resolved_by_user" : {
      "id" : "http://wso2jsonschema.org/resolved_by_user";,
      "type" : "string"
    },
    "incident_number" : {
      "id" : "http://wso2jsonschema.org/incident_number";,
      "type" : "number"
    },
    "urgency" : {
      "id" : "http://wso2jsonschema.org/urgency";,
      "type" : "string"
    },
    "id" : {
      "id" : "http://wso2jsonschema.org/id";,
      "type" : "string"
    },
    "html_url" : {
      "id" : "http://wso2jsonschema.org/html_url";,
      "type" : "string"
    },
    "assigned_to_user" : {
      "id" : "http://wso2jsonschema.org/assigned_to_user";,
      "type" : "string"
    },
    "number_of_escalations" : {
      "id" : "http://wso2jsonschema.org/number_of_escalations";,
      "type" : "number"
    },
    "service" : {
      "id" : "http://wso2jsonschema.org/service";,
      "properties" : {
        "html_url" : {
          "id" : "http://wso2jsonschema.org/service/html_url";,
          "type" : "string"
        },
        "id" : {
          "id" : "http://wso2jsonschema.org/service/id";,
          "type" : "string"
        },
        "description" : {
          "id" : "http://wso2jsonschema.org/service/description";,
          "type" : "string"
        },
        "name" : {
          "id" : "http://wso2jsonschema.org/service/name";,
          "type" : "string"
        },
        "deleted_at" : {
          "id" : "http://wso2jsonschema.org/service/deleted_at";,
          "type" : "string"
        }
      },
      "type" : "object"
    },
    "escalation_policy" : {
      "id" : "http://wso2jsonschema.org/escalation_policy";,
      "properties" : {
        "id" : {
          "id" : "http://wso2jsonschema.org/escalation_policy/id";,
          "type" : "string"
        },
        "name" : {
          "id" : "http://wso2jsonschema.org/escalation_policy/name";,
          "type" : "string"
        },
        "deleted_at" : {
          "id" : "http://wso2jsonschema.org/escalation_policy/deleted_at";,
          "type" : "string"
        }
      },
      "type" : "object"
    },
    "trigger_summary_data" : {
      "id" : "http://wso2jsonschema.org/trigger_summary_data";,
      "properties" : {
        "subject" : {
          "id" : "http://wso2jsonschema.org/trigger_summary_data/subject";,
          "type" : "string"
        }
      },
      "type" : "object"
    },
    "trigger_details_html_url" : {
      "id" : "http://wso2jsonschema.org/trigger_details_html_url";,
      "type" : "string"
    }
  },
  "type" : "object"
}



=======================================================================
*pdJiraConfig_outputSchema.json:*

{
  "id" : "http://wso2jsonschema.org";,
  "title" : "root",
  "$schema" : "http://json-schema.org/draft-04/schema#";,
  "properties" : {
    "issueFields" : {
      "id" : "http://wso2jsonschema.org/issueFields";,
      "properties" : {
        "fields" : {
          "id" : "http://wso2jsonschema.org/issueFields/fields";,
          "properties" : {
            "reporter" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/reporter
",
              "properties" : {
                "name" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/reporter/name";,
                  "type" : "string"
                }
              },
              "type" : "object"
            },
            "summary" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/summary";,
              "type" : "string"
            },
            "timetracking" : {
              "id" : "
http://wso2jsonschema.org/issueFields/fields/timetracking";,
              "properties" : {
                "originalEstimate" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/timetracking/originalEstimate";,
                  "type" : "string"
                },
                "remainingEstimate" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/timetracking/remainingEstimate
",
                  "type" : "string"
                }
              },
              "type" : "object"
            },
            "project" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/project";,
              "properties" : {
                "key" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/project/key";,
                  "type" : "string"
                }
              },
              "type" : "object"
            },
            "issuetype" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/issuetype
",
              "properties" : {
                "id" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/issuetype/id";,
                  "type" : "string"
                }
              },
              "type" : "object"
            },
            "priority" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/priority
",
              "properties" : {
                "id" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/priority/id";,
                  "type" : "string"
                }
              },
              "type" : "object"
            },
            "description" : {
              "id" : "
http://wso2jsonschema.org/issueFields/fields/description";,
              "type" : "string"
            },
            "labels" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/labels";,
              "items" : [ {
                "id" : "
http://wso2jsonschema.org/issueFields/fields/labels/0";,
                "type" : "string"
              } ],
              "type" : "array"
            },
            "assignee" : {
              "id" : "http://wso2jsonschema.org/issueFields/fields/assignee
",
              "properties" : {
                "name" : {
                  "id" : "
http://wso2jsonschema.org/issueFields/fields/assignee/name";,
                  "type" : "string"
                }
              },
              "type" : "object"
            }
          },
          "type" : "object"
        }
      },
      "type" : "object"
    }
  },
  "type" : "object"
}

On Mon, Jun 20, 2016 at 4:59 PM, Viraj Rajaguru <[email protected]> wrote:

> Hi Keerthika,
>
> It seems the schema and the received payload doesn't match each other. Can
> you send us the payload just before the datamapper mediator.(Log
> level="full") We will find input and output schemas from [1] and [2]. Hope
> connector store contains updated connectors with schemas. Or else please
> share gov:datamapper/pdJiraConfig_inputSchema.json and gov:datamapper/
> pdJiraConfig_outputSchema.json as well.
>
> Thanks,
> Viraj.
>
> [1] -
> https://store.wso2.com/store/assets/esbconnector/6f3b4bb7-054a-4aaf-a579-3f32c3eca2d3
> [2] -
> https://store.wso2.com/store/assets/esbconnector/b6424572-c92c-4422-a8e2-36db83d98e81
>
>
> On Mon, Jun 20, 2016 at 4:39 PM, Keerthika Mahendralingam <
> [email protected]> wrote:
>
>> Hi Nuwan,
>>
>> Using ESB 5.0.0-BETA.
>>
>> Thanks,
>> Keerthika
>>
>> On Mon, Jun 20, 2016 at 4:25 PM, Nuwan Pallewela <[email protected]> wrote:
>>
>>> Hi Keerthika,
>>>
>>> What is the ESB version you are using?
>>>
>>> Thanks,
>>> Nuwan
>>>
>>> On Mon, Jun 20, 2016 at 4:03 PM, Keerthika Mahendralingam <
>>> [email protected]> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I am getting the following error when I used data mapper to create an
>>>> integration scenario. I installed the tool from
>>>> http://builder1.us1.wso2.org/~developerstudio/devstudio-tooling-esb/5.0.0/Beta/composite/
>>>> and used input output schema from jira and pagerduty connector schema.
>>>>
>>>> I have added the proxy and data mapper configuration at the end.
>>>>
>>>> What could be the reason for the following error?
>>>>
>>>> [2016-06-20 15:11:10,720] DEBUG - wire HTTPS-Sender I/O dispatcher-3 >>
>>>> "[\r][\n]"
>>>>
>>>> [2016-06-20 15:11:10,720] DEBUG - wire HTTPS-Sender I/O dispatcher-3 >>
>>>> "352[\r][\n]"
>>>>
>>>> [2016-06-20 15:11:10,721] DEBUG - wire HTTPS-Sender I/O dispatcher-3 >>
>>>> "
>>>> {"id":"PS9VE7M","incident_number":3,"created_on":"2016-06-15T11:33:51Z","status":"resolved","pending_actions":[],"html_url":"
>>>> https://connectordemo.pagerduty.com/incidents/PS9VE7M
>>>> ","incident_key":"3c45415469ed415d8137b8ea9fe2fc03","service":{"id":"P4OWETP","name":"testService","html_url":"
>>>> https://connectordemo.pagerduty.com/services/P4OWETP","deleted_at":null,"description":"This
>>>> is for testing
>>>> purpose"},"escalation_policy":{"id":"PDJQDGY","name":"Default","deleted_at":null},"assigned_to_user":null,"trigger_summary_data":{"subject":"serviceTest"},"trigger_details_html_url":"
>>>> https://connectordemo.pagerduty.com/incidents/PS9VE7M/log_entries/Q324O08PK4VLJV
>>>> ","trigger_type":"web_trigger","last_status_change_on":"2016-06-15T15:33:51Z","last_status_change_by":null,"number_of_escalations":0,"resolved_by_user":null,"assigned_to":[],"urgency":"high"}
>>>> [\r][\n]"
>>>>
>>>> [2016-06-20 15:11:10,722] DEBUG - wire HTTPS-Sender I/O dispatcher-3 >>
>>>> "0[\r][\n]"
>>>>
>>>> [2016-06-20 15:11:10,723] DEBUG - wire HTTPS-Sender I/O dispatcher-3 >>
>>>> "[\r][\n]"
>>>>
>>>> [2016-06-20 15:11:10,731]  WARN - JacksonJSONSchema Element name not
>>>> found : jsonObject
>>>>
>>>> [2016-06-20 15:11:10,732]  WARN - JacksonJSONSchema Element name not
>>>> found : jsonObject
>>>>
>>>> [2016-06-20 15:11:10,732] ERROR - SequenceMediator java.lang.String
>>>> cannot be cast to java.util.Map
>>>>
>>>> java.lang.ClassCastException: java.lang.String cannot be cast to
>>>> java.util.Map
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.engine.core.schemas.JacksonJSONSchema.getElementTypeByName(JacksonJSONSchema.java:111)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.engine.input.readers.XMLReader.startElement(XMLReader.java:141)
>>>>
>>>> at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org.apache.xerces.impl.XMLNSDocumentScannerImpl.scanStartElement(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown
>>>> Source)
>>>>
>>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>>
>>>> at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
>>>>
>>>> at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
>>>>
>>>> at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
>>>>
>>>> at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown
>>>> Source)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.engine.input.readers.XMLReader.read(XMLReader.java:95)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.engine.input.InputModelBuilder.buildInputModel(InputModelBuilder.java:52)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.engine.core.mapper.MappingHandler.doMap(MappingHandler.java:59)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.DataMapperMediator.transform(DataMapperMediator.java:245)
>>>>
>>>> at
>>>> org.wso2.carbon.mediator.datamapper.DataMapperMediator.mediate(DataMapperMediator.java:217)
>>>>
>>>> at
>>>> org.apache.synapse.mediators.AbstractListMediator.mediate(AbstractListMediator.java:87)
>>>>
>>>> at
>>>> org.apache.synapse.mediators.base.SequenceMediator.mediate(SequenceMediator.java:292)
>>>>
>>>> at
>>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.mediateFromContinuationStateStack(Axis2SynapseEnvironment.java:774)
>>>>
>>>> at
>>>> org.apache.synapse.core.axis2.Axis2SynapseEnvironment.injectMessage(Axis2SynapseEnvironment.java:282)
>>>>
>>>> at
>>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.handleMessage(SynapseCallbackReceiver.java:546)
>>>>
>>>> at
>>>> org.apache.synapse.core.axis2.SynapseCallbackReceiver.receive(SynapseCallbackReceiver.java:179)
>>>>
>>>> at org.apache.axis2.engine.AxisEngine.receive(AxisEngine.java:180)
>>>>
>>>> at
>>>> org.apache.synapse.transport.passthru.ClientWorker.run(ClientWorker.java:255)
>>>>
>>>> at
>>>> org.apache.axis2.transport.base.threads.NativeWorkerPool$1.run(NativeWorkerPool.java:172)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
>>>>
>>>> at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
>>>>
>>>> at java.lang.Thread.run(Thread.java:722)
>>>>
>>>> *Proxy Service:*
>>>>
>>>> <?xml version="1.0" encoding="UTF-8"?>
>>>> <proxy xmlns="http://ws.apache.org/ns/synapse";
>>>>        name="createIssue"
>>>>        transports="https,http"
>>>>        statistics="disable"
>>>>        trace="disable"
>>>>        startOnLoad="true">
>>>>    <target>
>>>>       <inSequence>
>>>>          <pagerduty.getIncidentById configKey="pdConfig">
>>>>             <incidentId>PS9VE7M</incidentId>
>>>>          </pagerduty.getIncidentById>
>>>>          <datamapper config="gov:datamapper/pdJiraConfig.dmc"
>>>>
>>>>  inputSchema="gov:datamapper/pdJiraConfig_inputSchema.json"
>>>>
>>>>  outputSchema="gov:datamapper/pdJiraConfig_outputSchema.json"
>>>>                      inputType="XML"
>>>>                      outputType="XML"/>
>>>>          <jira.createIssue configKey="jiraConfig">
>>>>             <issueFields>{json-eval($.issueFields)}</issueFields>
>>>>          </jira.createIssue>
>>>>          <respond/>
>>>>       </inSequence>
>>>>       <outSequence/>
>>>>       <faultSequence/>
>>>>    </target>
>>>>    <description/>
>>>> </proxy>
>>>>
>>>> *pdJiraConfig.dmc:*
>>>>
>>>> function map_S_root_S_root( ){
>>>> var outputroot={};
>>>>
>>>>
>>>> outputroot = {};
>>>> outputroot.issueFields = {};
>>>> outputroot.issueFields.fields = {};
>>>>
>>>>
>>>> outputroot.issueFields.fields.description = inputroot.html_url;
>>>> return outputroot;
>>>> }
>>>>
>>>> Thanks,
>>>> Keerthika.
>>>> --
>>>> <[email protected]>
>>>> Keerthika Mahendralingam
>>>> Software Engineer
>>>> Mobile :+94 (0) 776 121144
>>>> [email protected]
>>>> WSO2, Inc.
>>>> lean . enterprise . middleware
>>>>
>>>
>>>
>>>
>>> --
>>> ----------------------------------------------------------
>>>
>>> *Nuwan Chamara Pallewela*
>>>
>>>
>>> *Software Engineer*
>>>
>>> *WSO2, Inc. *http://wso2.com
>>> *lean . enterprise . middleware*
>>>
>>> Email   *[email protected] <[email protected]>*
>>> Mobile  *+94719079739 <%2B94719079739>@*
>>>
>>>
>>>
>>
>>
>> --
>> <[email protected]>
>> Keerthika Mahendralingam
>> Software Engineer
>> Mobile :+94 (0) 776 121144
>> [email protected]
>> WSO2, Inc.
>> lean . enterprise . middleware
>>
>
>
>
> --
> Viraj Rajaguru
> Associate Technical Lead
> WSO2 Inc. : http://wso2.com
>
> Mobile: +94 77 3683068
>
>
>
>


-- 
<[email protected]>
Keerthika Mahendralingam
Software Engineer
Mobile :+94 (0) 776 121144
[email protected]
WSO2, Inc.
lean . enterprise . middleware
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to