Topic
  • 10 replies
  • Latest Post - ‏2012-03-27T16:18:57Z by SystemAdmin
SystemAdmin
SystemAdmin
938 Posts

Pinned topic Get extension object in Core entity

‏2012-03-19T13:38:15Z | mdm-migration
Hi All,

Quick question,

I am getting exception like TCRMPersonNameBObj incompatible with XPersonNameBObjExt while trying something like following
XPersonNameBObjExt preferredPersonName =

Vector<XPersonNameBObjExt> personNames = partyComponent.getAllPersonNames(theParty.getPartyId(), TCRMRecordFilter.ACTIVE, theParty.getControl());

Please let me know where to look for to find actual cause of this error.

Please ask me if you need more information.
Thanks and Regards,
Amit
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-19T13:48:45Z  
    Just to update, I am using MDM version 9.0.2
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-19T14:06:01Z  
    Hi,

    Have you tested the data extension is basically working, by running the transactions addPersonName and getPersonName?

    You might also get a TCRMPersonNameBObj returned if there is no extension data in the database for some records and it is defined as a side-table extension.

    A safer way to code this is to assume the records are TCRMPersonNameBObj until you need to access the extension data (and then check the type).

    Hope that helps, Catherine.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-25T21:41:29Z  
    Hi,

    Have you tested the data extension is basically working, by running the transactions addPersonName and getPersonName?

    You might also get a TCRMPersonNameBObj returned if there is no extension data in the database for some records and it is defined as a side-table extension.

    A safer way to code this is to assume the records are TCRMPersonNameBObj until you need to access the extension data (and then check the type).

    Hope that helps, Catherine.
    Thanks a lot,

    But it is still not working. I checked all the schema files are up to date.

    BTW just to update you on this issue, I found that same cast is working fine in composite. The failure happens in a post type behavior extension. Is there any reason for latest XSD not available to the behavior extension but is available to composite?

    Regards,
    Amit
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-26T09:27:05Z  
    Thanks a lot,

    But it is still not working. I checked all the schema files are up to date.

    BTW just to update you on this issue, I found that same cast is working fine in composite. The failure happens in a post type behavior extension. Is there any reason for latest XSD not available to the behavior extension but is available to composite?

    Regards,
    Amit
    Hi,

    It doesn't have anything to do with the XML schema, which is only used for parsing the XML request and constructing the response.

    If the exact same code works in a business proxy, but not in the behavior extension, then that is odd. Can you post the exception stack trace? If it isn't getting logged, then add a try catch to the behavior extension code.

    Thanks, Catherine.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-26T11:35:41Z  
    Hi,

    It doesn't have anything to do with the XML schema, which is only used for parsing the XML request and constructing the response.

    If the exact same code works in a business proxy, but not in the behavior extension, then that is odd. Can you post the exception stack trace? If it isn't getting logged, then add a try catch to the behavior extension code.

    Thanks, Catherine.
    Yes, same is my concern that why is this code not working in behavior extension.

    I attached the SystemErr.log please see if there is anything helpful.
    Also for fyi, both Behavior and Composite are in two different projects. I am trying to check if there is any Jar dependency which is creating this issue.

    One more thing, this code is working perfect on my local workbench, but it is not working on my AIX Server environment, I am not sure if environment has anything to do with that or not.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-26T12:01:09Z  
    Yes, same is my concern that why is this code not working in behavior extension.

    I attached the SystemErr.log please see if there is anything helpful.
    Also for fyi, both Behavior and Composite are in two different projects. I am trying to check if there is any Jar dependency which is creating this issue.

    One more thing, this code is working perfect on my local workbench, but it is not working on my AIX Server environment, I am not sure if environment has anything to do with that or not.
    Following is that error code which is working on my local and not on AIX server.

    TCRMPartyComponent partyComponent = (TCRMPartyComponent)TCRMClassFactory.getTCRMComponent(TCRMCorePropertyKeys.PARTY_COMPONENT);

    Vector<XPersonNameBObjExt> personNames = partyComponent.getAllPersonNames(theParty.getPartyId(), TCRMRecordFilter.ACTIVE, theParty.getControl());
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-26T12:50:55Z  
    Following is that error code which is working on my local and not on AIX server.

    TCRMPartyComponent partyComponent = (TCRMPartyComponent)TCRMClassFactory.getTCRMComponent(TCRMCorePropertyKeys.PARTY_COMPONENT);

    Vector<XPersonNameBObjExt> personNames = partyComponent.getAllPersonNames(theParty.getPartyId(), TCRMRecordFilter.ACTIVE, theParty.getControl());
    Hi,

    If the code works on your local environment but not on the AIX server, then the issue is one of configuration on the AIX server. You can test that by calling the transaction getPersonName against the AIX server and seeing if you get back the data extension fields (assuming there is some data to retrieve from the database - if there isn't, use addPersonName to add an extended person name, and then query the same record).

    The most likely reasons for the different behavior is that the tcrm_extension.properties file which is being loaded on the AIX server does not include the properties to register the data extension. This could be because you need to package the updated properties files from your workspace into the MDM.ear properties.jar file.

    Hope that helps, Catherine.
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-27T04:02:29Z  
    Hi,

    If the code works on your local environment but not on the AIX server, then the issue is one of configuration on the AIX server. You can test that by calling the transaction getPersonName against the AIX server and seeing if you get back the data extension fields (assuming there is some data to retrieve from the database - if there isn't, use addPersonName to add an extended person name, and then query the same record).

    The most likely reasons for the different behavior is that the tcrm_extension.properties file which is being loaded on the AIX server does not include the properties to register the data extension. This could be because you need to package the updated properties files from your workspace into the MDM.ear properties.jar file.

    Hope that helps, Catherine.
    Hi Catherine,

    This still not worked. I am again not sure what is wrong, but I kind of verified all the properties and XSDs. This ClassCast is still coming. I am working on it and will try to debug and find the differences which may be causing this issue. If I find the resolution, I will post it.

    Regards,
    Amit
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-27T13:59:36Z  
    Hi Catherine,

    This still not worked. I am again not sure what is wrong, but I kind of verified all the properties and XSDs. This ClassCast is still coming. I am working on it and will try to debug and find the differences which may be causing this issue. If I find the resolution, I will post it.

    Regards,
    Amit
    Hi Catherine,

    Does use of DTD is still supported?
    We are using DTDs all over the place. For the extensions all we have DTDs only. Do you see any reason my changes are not working because of XSDs are not used?

    Just to mention again, changes are working fine on my local workbench.

    Regards,
    Amit
  • SystemAdmin
    SystemAdmin
    938 Posts

    Re: Get extension object in Core entity

    ‏2012-03-27T16:18:57Z  
    Hi Catherine,

    Does use of DTD is still supported?
    We are using DTDs all over the place. For the extensions all we have DTDs only. Do you see any reason my changes are not working because of XSDs are not used?

    Just to mention again, changes are working fine on my local workbench.

    Regards,
    Amit
    Hi,

    I don't know what version of MDM Server you are on. DTDs have been deprecated and I think were removed from v10. But if its working for you on your local development environment, then there's nothing wrong with your code, properties files or DTDs in that environment.

    The DTD's or XSD's are used when the XML request is parsed by the server and when the XML response is constructed. If you have problems with the XML response, then that can be because of issues with the XSD or DTD.

    For the situation you are seeing it is more likely that either the remote server is not picking up the correct version of the properties files, or the correct version of the code. So rebuilding and redeploying the MDM.ear on the remote server and doing basic testing of the data extension in that environment is the way to go.

    Hope that helps, Catherine.