cancel
Showing results for 
Search instead for 
Did you mean: 

Mapping error: cannot produce target element

Former Member
0 Kudos

Hi all,

I have a JDBC to File scenario. When trying to send a message the data is correctly read from the database but not output file is generated in the receiver.

I checked the monitor and there is an error when the mapping is happening:

Cannot produce target element /ns1:msgT_createBusinessPartner/externalBusinessPartnerID. Check xml instance is valid for source xsd and target-field mapping fulfills requirements of target xsd

I have tested the mapping in the design area and it works fine. So I wonder if this have something to do with the format of the datatype I created for the sender? Should it match exactly the format of the xml message generated by the jdbc adapter?

The payload generated by the jdbc adapter has the following format:

<resulset_1>

<row>

<EXTERNALPERSONID>00001</EXTERNALPERSOND>

<NAME>Test</NAME>

...

</row>

</resulset_1>

I created a new datatype with the same format, but I'm still having the same error.

Please help.

Thanks in advance,

Jon

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hey

please test ur message mapping as shown in the following blog

/people/michal.krawczyk2/blog/2005/09/16/xi-how-to-test-your-mapping-in-real-life-scenarios

Thanx

Aamir

Former Member
0 Kudos

Hi,

I have tested it as explained in the blog, and I'm getting the same error.

Comparing to the test xml generated, I can see that my payload does not have the following format for the main tag:

<ns0:resultset_1 xmlns:ns0="http://curam.com/prototype">

...

</ns0:resultset_1>

Instead it has this:

<resulset_1>

...

</resulset_1>

This main tag can be set in the configuration of the JDBC Adapter, should I change it there?

Former Member
0 Kudos

Hey

do one thing,instead of changing JDBC adapter,remove namespace completely and then test

/people/sameer.shadab/blog/2005/12/05/how-to-remove-namespaces-in-mapping--xi

Thanx

Aamir

Former Member
0 Kudos

Thanks Aamir,

I removed the namespace in the mapping as explained in the blog, the payload now matches the format of the datatype. When I copy it to the test the fields are populated correctly and are green

However when I run the test I'm still getting the error "Cannot produce target element".

I'm even getting the error when I use the generated test data.

Why is this happening?

I don't know if it has something to do but I changed all data type's field names to uppercase, cause the payload has them in uppercase as well.

Thanks for your help.

Message was edited by:

Jon Igual

Former Member
0 Kudos

Hi Aamir,

I put back the namespace and it is working again. Should I change then the JDBC Adapter?

Points have been rewarded to you all, you are being very helpful.

Former Member
0 Kudos

Hey

you get "Cannot produce target element" if some mandatory field has not been mapped(this includes the node fields as well) so please make sure that all the fileds including nodes of the receiver have been mapped correctly.

second cause can be that the XML itself is not well formed,please paste the XML structure here via which you are testing the mapping

Thanx

Aamir

Former Member
0 Kudos

Hey

>>Should I change then the JDBC Adapter?

no,if its working fine then don't make any changes in adapter.

looks like u were having some cache issue

Thanx

Aamir

Former Member
0 Kudos

Thanks Aamir,

I was not mapping the main node of the receiver, sorry about that... I'm new in XI and I'm still a bit confused.

I'm pasting now the payload and it's mapping it correctly.

Thanks again for your help!

Points rewarded.

Former Member
0 Kudos

don't be confused about anything,all that matters is that the scenario is working fine:)

SDN is always here for any references

Answers (4)

Answers (4)

Former Member
0 Kudos

Hey Jon,

It could be that, when you are picking the data from the database, there could be some empty rows, but where as in your source structure the fields could be mandatory.

In such case a mapping error will be thrown.so the for the data again, or else if you can get the complete source xml try testing it in message mapping, it will show the exact line where its cribbing, try to debug and fix. If you need any help get back to us.

I Hope this help should solve your issue.

reward if useful

thanks,

Younus

Former Member
0 Kudos

Hi Jon

In order to investigate this please do the following:

Put the message payload from the SXMB_MONI in the message mapping Test and run to see if you still get the error. If yes, then its a mapping related problem. If no, then cash refresh is required.

regards

vijendra

Former Member
0 Kudos

Vijendra,

I have put the payload message in the mapping test and it is failing with the same error message, so it is definitely a mapping problem.

When I paste the payload the datatype's fields are populated with the values, but the circle in their left (before in green) is red, as if they weren't populated.

Thanks.

Message was edited by:

Jon Igual

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>>I have put the payload message in the mapping test and it is failing with the same error message, so it is definitely a mapping problem.

Do not paste as it is Payload..It will throw error. In Sxmb_Moni selete the message and go to the Pay load and select all and right click go for view source and paster it in Message Mapping test and execute it and check it out

Regards

Agasthuri Doss

Former Member
0 Kudos

Hi Jon,

If you done the mapping perfectly, some times the fields which are having the occurence 1..1 does not get the values due to validations mentioned or lack of data. Test your mapping once and check the display queue for fields which are having the occurence 1..1

Hope it will helps ..:)

Cheers

Veera

Former Member
0 Kudos

Hi Veeranjaneyulu,

Thanks for your help. I tested it again and the fields with occurrence 1..1 are mapped ok. I have also populated all the fields in the message I'm sending. I'm still getting the same error though.

agasthuri_doss
Active Contributor
0 Kudos

Hi,

>>So I wonder if this have something to do with the format of the datatype I created for the sender? Should it match exactly the format of the xml message generated by the jdbc adapter?

F7 is to check whether the Mapping is fine that is whether you have mapped the source and target and Mandatory filelds like that...

We have to make sure that incoming Data meets the requiremnt of our Mapping only then it will pass.

Should it match exactly the format of the xml message generated by the jdbc adapter?

YES

Regards

Agasthuri Doss

Former Member
0 Kudos

Hi Agasthuri,

Thanks for answering so quickly.

I already changed my datatype to match exactly the xml generated by the adapter and I'm getting the same error.

My datatype has the following format:

resulset_1

row

... my fields ...

Any suggestions?