Topic
  • 1 reply
  • Latest Post - ‏2013-05-07T18:07:33Z by vradhik
SamehA.Razek
SamehA.Razek
3 Posts

Pinned topic DataStewardship Customization error

‏2011-10-17T14:22:44Z |
I am trying to customize the DS UI to add extension to TCRMAdminContEquivBObj, I am using the following code to do that

AdminSysKey.SubmitAddAction()
//Added by Sameh A.Razek---------------------------------------
TCRMAdminContEquivBObjType adminContEquivBObj= getAdminContEquivBObj().getTCRMAdminContEquivBObjType();
TCRMExtensionType adminTcrmExtension = CustomerFactory.eINSTANCE.createTCRMExtensionType();
XPartyAdminSysKeyBObjExtType xAdminContEquivBObj = CustomerFactory.eINSTANCE.createXPartyAdminSysKeyBObjExtType();

String DATE_FORMAT = "yyyy-MM-dd";
SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
Calendar calendar = Calendar.getInstance(); // today
String todayDate = sdf.format(calendar.getTime());
xAdminContEquivBObj.setPartyLastChangesDate(todayDate);
xAdminContEquivBObj.setSyncFlag("N");

adminTcrmExtension.setExtendedObject("XPartyAdminSysKeyBObjExt");
adminTcrmExtension.getCommonExtensionBObj().add(xAdminContEquivBObj);
//set Extension in the main object
adminContEquivBObj.setTCRMExtension(adminTcrmExtension);
//-------------------------------------------------------------

but I got the following error:
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:118)
at javax.faces.component.UICommand.broadcast(UICommand.java:387)
at javax.faces.component.UIViewRoot.broadcastEvents(UIViewRoot.java:458)
at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:763)
at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:82)
at com.sun.faces.lifecycle.Phase.doPhase(Phase.java:100)
at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:118)
at javax.faces.webapp.FacesServlet.service(FacesServlet.java:265)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1536)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:1470)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:131)
at com.ibm.mdm.ui.filter.SessionFilter.doFilter(SessionFilter.java:124)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.mdm.ui.filter.CharacterEncodingFilter.doFilter(CharacterEncodingFilter.java:64)
at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:188)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:116)
at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:77)
at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:858)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:824)
at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:458)
at com.ibm.ws.webcontainer.servlet.ServletWrapperImpl.handleRequest(ServletWrapperImpl.java:175)
at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:91)
at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:862)
at com.ibm.ws.webcontainer.WSWebContainer.handleRequest(WSWebContainer.java:1583)
at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:178)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:455)
at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:384)
at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:83)
at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:138)
at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:204)
at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:775)
at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:905)
at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1550)
Caused by: javax.faces.el.EvaluationException: java.lang.RuntimeException: Invalid entry feature 'TCRMExtensionType.commonExtensionBObj'
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:102)
at com.sun.faces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:102)
... 36 more
Caused by: java.lang.RuntimeException: Invalid entry feature 'TCRMExtensionType.commonExtensionBObj'
at org.eclipse.emf.ecore.util.BasicFeatureMap.validate(BasicFeatureMap.java:94)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFeatureMap.java:1555)
at org.eclipse.emf.ecore.util.BasicFeatureMap.addUnique(BasicFeatureMap.java:1)
at org.eclipse.emf.common.util.BasicEList.add(BasicEList.java:626)
at org.eclipse.emf.ecore.util.BasicFeatureMap.doAdd(BasicFeatureMap.java:523)
at org.eclipse.emf.ecore.util.BasicFeatureMap.add(BasicFeatureMap.java:1296)
at org.eclipse.emf.ecore.util.FeatureMapUtil$FeatureEList.add(FeatureMapUtil.java:751)
at pagecode.partyMaintenance.AdminSysKey.SubmitAddAction(AdminSysKey.java:461)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:37)
at java.lang.reflect.Method.invoke(Method.java:599)
at org.apache.el.parser.AstValue.invoke(AstValue.java:131)
at org.apache.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:277)
at com.sun.faces.application.MethodBindingMethodExpressionAdapter.invoke(MethodBindingMethodExpressionAdapter.java:88)
... 37 more

I changed the customer.ecore to remove the changeable="false" from <eStructuralFeatures xsi:type="ecore:EReference" name="commonExtensionBObj and that error no more there

<eClassifiers xsi:type="ecore:EClass" name="TCRMExtensionType">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="name" value="TCRMExtension_._type"/>
<details key="kind" value="elementOnly"/>
</eAnnotations>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="extendedObject" eType="ecore:EDataType http://www.eclipse.org/emf/2003/XMLType#//String">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="ExtendedObject"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EAttribute" name="commonExtensionBObjGroup"
unique="false" upperBound="-1" eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EFeatureMapEntry">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="group"/>
<details key="name" value="CommonExtensionBObj:group"/>
<details key="namespace" value="##targetNamespace"/>
</eAnnotations>
</eStructuralFeatures>
<eStructuralFeatures xsi:type="ecore:EReference" name="commonExtensionBObj" upperBound="-1"
eType="#//CommonExtensionBObjType" volatile="true" transient="true"
derived="true" containment="true" resolveProxies="false">
<eAnnotations source="http:///org/eclipse/emf/ecore/util/ExtendedMetaData">
<details key="kind" value="element"/>
<details key="name" value="CommonExtensionBObj"/>
<details key="namespace" value="##targetNamespace"/>
<details key="group" value="CommonExtensionBObj:group"/>
</eAnnotations>
</eStructuralFeatures>
</eClassifiers>

but now I get another error

XML Request
<?xml version="1.0" encoding="UTF-8"?>
<TCRMService xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="mobilyRequest.xsd">
<RequestControl>
<requestID>1919413376280705024</requestID>
<DWLControl>
<requesterName>cusadmin</requesterName>
<requesterLocale>en</requesterLocale>
<clientSystemName>DataStewardship</clientSystemName>
<userRole>RoV Rules Admin</userRole>
</DWLControl>
</RequestControl>
<TCRMTx>
<TCRMTxType>addPartyAdminSysKey</TCRMTxType>
<TCRMTxObject>TCRMAdminContEquivBObj</TCRMTxObject>
<TCRMObject>
<TCRMAdminContEquivBObj>
<PartyId>331318669717401842</PartyId>
<AdminPartyId>IVR</AdminPartyId>
<AdminSystemType>16</AdminSystemType>
<Description/>
<TCRMExtension>
<ExtendedObject>XPartyAdminSysKeyBObjExt</ExtendedObject>
<CommonExtensionBObj xsi:type="XPartyAdminSysKeyBObjExtType">
<PartyLastChangesDate>2011-10-17</PartyLastChangesDate>
<SyncFlag>N</SyncFlag>
</CommonExtensionBObj>
</TCRMExtension>
</TCRMAdminContEquivBObj>
</TCRMObject>
</TCRMTx>
</TCRMService>

XML Response
<?xml version="1.0" encoding="UTF-8"?>
<TCRMService xmlns="http://customer.dwl.com">espaceSchemaLocation="mobilyResponse.xsd">
<ResponseControl>
<ResultCode>FATAL</ResultCode>
<ServiceTime>1344</ServiceTime>
<DWLControl>
<clientSystemName>DataStewardship</clientSystemName>
<requesterLanguage>100</requesterLanguage>
<requesterLocale>en</requesterLocale>
<requesterName>cusadmin</requesterName>
<requestID>1919413376280705024</requestID>
<userRole>RoV Rules Admin</userRole>
</DWLControl>
</ResponseControl>
<TxResponse>
<RequestType>addPartyAdminSysKey</RequestType>
<TxResult>
<ResultCode>FATAL</ResultCode>
<DWLError>
<ComponentType>106</ComponentType>
<ErrorMessage>Parser DWLTransaction failed. The format of the message is not correct or an application error occurred.</ErrorMessage>
<ErrorType>READERR</ErrorType>
<LanguageCode>100</LanguageCode>
<ReasonCode>4928</ReasonCode>
<Severity>0</Severity>
<Throwable>com.dwl.base.requestHandler.exception.RequestParserException: Exception_myErrorHandler_SAXParseError: The parsing of the XML failed at the following position. XML = org.xml.sax.SAXParseException: cvc-elt.2: The value of {abstract} in the element declaration for 'CommonExtensionBObj' must be false.; line number = 23; column number = 72</Throwable>
</DWLError>
</TxResult>
</TxResponse>
</TCRMService>
any advice?
  • vradhik
    vradhik
    3 Posts

    Re: DataStewardship Customization error

    ‏2013-05-07T18:07:33Z  

    Thanks for the fix you mentioned for the java.lang.RuntimeException: Invalid entry feature 'TCRMExtensionType.commonExtensionBObj'

    This is probably of no use to you now.. but this is what I did for setting the TCRMExtension on a txn object and it works fine for me is -

    TCRMAdminContEquivBObjType adminContEquivBObj= getAdminContEquivBObj().getTCRMAdminContEquivBObjType();

    TCRMExtensionType adminTcrmExtension = CustomerFactory.eINSTANCE.createTCRMExtensionType();

    XPartyAdminSysKeyBObjExtType xAdminContEquivBObj = CustomerFactory.eINSTANCE.createXPartyAdminSysKeyBObjExtType();

    String DATE_FORMAT = "yyyy-MM-dd";
    SimpleDateFormat sdf = new SimpleDateFormat(DATE_FORMAT);
    Calendar calendar = Calendar.getInstance(); // today
    String todayDate = sdf.format(calendar.getTime());
    xAdminContEquivBObj.setPartyLastChangesDate(todayDate);
    xAdminContEquivBObj.setSyncFlag("N");

    adminTcrmExtension.getExtendedObject().add("XPartyAdminSysKeyBObjExt");

    adminTcrmExtension.getCommonExtensionBObjGroup().add(CustomerPackage.eINSTANCE.getDocumentRoot_XPartyAdminSysKeyBObjExt(),  xAdminContEquivBObj);

    //set Extension in the main object
    adminContEquivBObj.setTCRMExtension(adminTcrmExtension);