cancel
Showing results for 
Search instead for 
Did you mean: 

Child data not coming on to the client.

Former Member
0 Kudos

Hi All,

I have created a smart sync Application where Header data is coming on to the client but when i pres the synckey for seeing the child values i aam getting the following error.

Error: 500

Location: /ZDEVFSE/start

Internal Servlet Error:

java.lang.NullPointerException

at com.philips.fsm.DEVFSE.dataaccess.SmartSyncDBAccess.getItemFieldValue(SmartSyncDBAccess.java:285)

at com.philips.fsm.DEVFSE.dataaccess.TableContentProvider.getTableWithSyncBoInstanceItems(TableContentProvider.java:237)

at com.philips.fsm.DEVFSE.FSMCONTROLLERFSE.showSelectedSyncBoDetails(FSMCONTROLLERFSE.java:181)

at com.philips.fsm.DEVFSE.FSMCONTROLLERFSE.doHandleEvent(FSMCONTROLLERFSE.java:80)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)

at org.apache.tomcat.core.Handler.service(Handler.java:287)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

at java.lang.Thread.run(Thread.java:534)

can any one help me what could be the probable reasons.Also how to check the whether the child data is getting downl;oaded to theclient or not in MI server.

Thanks

Regards

Devendra

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi All,

I have created a smart sync Application where Header data is coming on to the client but when i pres the synckey for seeing the child values i aam getting the following error.

Error: 500

Location: /ZDEVFSE/start

Internal Servlet Error:

java.lang.NullPointerException

at com.philips.fsm.DEVFSE.dataaccess.SmartSyncDBAccess.getItemFieldValue(SmartSyncDBAccess.java:285)

at com.philips.fsm.DEVFSE.dataaccess.TableContentProvider.getTableWithSyncBoInstanceItems(TableContentProvider.java:237)

at com.philips.fsm.DEVFSE.FSMCONTROLLERFSE.showSelectedSyncBoDetails(FSMCONTROLLERFSE.java:181)

at com.philips.fsm.DEVFSE.FSMCONTROLLERFSE.doHandleEvent(FSMCONTROLLERFSE.java:80)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)

at org.apache.tomcat.core.Handler.service(Handler.java:287)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

at java.lang.Thread.run(Thread.java:534)

can any one help me what could be the probable reasons.Also how to check the whether the child data is getting downl;oaded to theclient or not in MI server.

Also when i press the sync button i am getting the following message

• Synchronization started

• Successfully connected with server.

• Processing of inbound data began.

• Exception while proccessing method SMARTSYNC : java.lang.RuntimeException: Inbound processing of container with index 3 failed: Cannot insert as entity already exists for IClassDescriptor/Key: cZDEVFSE_010/7917495 : m0007917494 : Inbound processing of container with index 3 failed: Cannot insert as entity already exists for IClassDescriptor/Key: cZDEVFSE_010/7917495 : m0007917494

Thanks

Regards

Devendra

Former Member
0 Kudos

HI Devendra,

which MI Version, SP and patch level are you running?

You can see what has been sent down to the client in the MEREP_MON transaction when checking the worklists. May set in the MEREP_PD --> Synchronizer Tab in columnn "save data" for your sync bo to "A", wich indicates ALL.

Rgds Thomas

Former Member
0 Kudos

hello deven.

the child data cZDEVFSE_010/7917495 is actually being sent to your device only

that SmartSync cannot insert it into the database since the same row having the

same key exists. check your worklist monitor if the same row had been sent to

the client already; if it has been sent, try checking your syncBo mapping for your

child rows.

regards

jo

Former Member
0 Kudos

Hi Jo,

For this sync key 0007918162 i m getting the data in the worklist monitor.

Line items: R/3 key=10200292, synchronization key=0007918162, action=M, item number=0

Line items: add=4, changed=1, deleted=2, not changed=0

but for the sync key 0007918140 i am not getting the data its throwing the error

Line items: R/3 key=10203262, synchronization key=0007918140, action=M, item number=8

Line items: add=4, changed=1, deleted=1, not changed=0

java.lang.NullPointerException

at com.philips.fsm.DEV.dataaccess.SmartSyncDBAccess.getItemFieldValue(SmartSyncDBAccess.java:285)

at com.philips.fsm.DEV.dataaccess.TableContentProvider.getTableWithSyncBoInstanceItems(TableContentProvider.java:237)

at com.philips.fsm.DEV.FSMCONTROLLERDEV.showSelectedSyncBoDetails(FSMCONTROLLERDEV.java:181)

at com.philips.fsm.DEV.FSMCONTROLLERDEV.doHandleEvent(FSMCONTROLLERDEV.java:80)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGetNotThreadSafe(AbstractMEHttpServlet.java:347)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.doGet(AbstractMEHttpServlet.java:689)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)

at com.sap.ip.me.api.runtime.jsp.AbstractMEHttpServlet.service(AbstractMEHttpServlet.java:313)

at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)

at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:405)

at org.apache.tomcat.core.Handler.service(Handler.java:287)

at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)

at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:806)

at org.apache.tomcat.core.ContextManager.service(ContextManager.java:752)

at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:213)

at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)

at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:501)

at java.lang.Thread.run(Thread.java:534)

Also i am unable to interpret the details as i have mentioned above from worklist monitor the only difference i can see is in the "deleted" value for first synckey it's value is 1 nad for the second its value is 2.Other than this i am not able to find any interpretation from worklist monitor.Is it due to primary key issue..please guide me.

Thanks

Regards

Devendra

kishorg
Advisor
Advisor
0 Kudos

Hi Deva,

<<<

com.sap.ip.me.spi.persist.IPersistenceException: Cannot insert as entity already exists for IClassDescriptor/Key:

>>

I think it is because of insufficient key field mappings in the GETDETAIL BAPI Wrapper. Just have a look at the key field mappings of the GETDETAIL in your syncbo and make it sure that you have properly mapped all the key fields.

Just check, there is no chance for getting more than one record in the BAPI Wrappers if you have only one field as key in your SyncBO(applicable to GETLIST also)...

refer this forum also.. I have already discussed a similar problem in this thread..

<<<

java.lang.NullPointerException

at com.philips.fsm.DEV.dataaccess.SmartSyncDBAccess.getItemFieldValue(SmartSyncDBAccess.java:285)

>>>

You just check, whether u have properly handled the null values in the getItemFieldValue() method.

Certain fields can have null values if we are not filling any values for that fields while creating that field or selecting data from the back end itself(like date field)..

This null pointer values we have to explicitly check within the getItemFieldValue() method..

Use this method for fetching the data for ITEM.

public String getItemFieldValue(Row item, String itemFieldName) {

RowDescriptor rd = item.getRowDescriptor();

FieldDescriptor fd = rd.getFieldDescriptor(itemFieldName);

BasisFieldType bft = fd.getFieldType();

try {

<b>if (bft == BasisFieldType.N) {

NumericField nf = item.getNumericField(fd);

try {

return nf.getValueWithLeadingZeros();

} catch (RuntimeException e) {

return "";

}</b>} else {

Field f = item.getField(fd);

if (f == null) {

return "";

} else if (f.getValue() == null)

return "";

else if (f.getValue() != null) {

if (bft == BasisFieldType.D) {

String aDa = f.getValue().toString();

if (!aDa.equals("")) {

Date fDa = Date.valueOf(aDa);

return formater.format(fDa);

}

}

return f.getValue().toString();

} else

return "";

}

} catch (SmartSyncException ssex) {

System.out.println(ssex.getMessage());

return null;

}

}

We have to handle the null values like mentioned as bold above.

Refer these links also..

Regards,

Kishor Gopinathan

Former Member
0 Kudos

hello deven,

the NullPointerException issue seems not related to the child data not sent to

client. i would suggest you to look at the cause of the NullPointerException at

com.philips.fsm.DEV.dataaccess.SmartSyncDBAccess.getItemFieldValue(SmartSyncDBAccess.java:285).

you may post what's on the line 285 for us to look at.

>Line items: add=4, changed=1, deleted=1, not changed=0

i think this means that you have 4 added, 1 changed and 1 deleted items from

your syncbo. check on your trace file for exceptions and errors from the time you

sync your client till when the sync completed (with or without errors). in cases

when there are duplicate key insertions e.g. that syncbo will not be updated and

exception is thrown.

regards

jo

Former Member
0 Kudos

Hi Jo/Kishor,

I have made a new application and checked the syncbo mapping for key field issues after that theapplication got successfully deployed on to my client and i am getting all the header as well as child values..

but when i changed something in backend and press the sync button i am getting following error and not getting the updated data.

Successfully connected with server.

• Processing of inbound data began.

• Exception while proccessing method SMARTSYNC : java.lang.RuntimeException: Inbound processing of container with index 6 failed: Cannot insert as entity already exists for IClassDescriptor/Key: cZFSESCH_010/7918679 : m0007918676 : Inbound processing of container with index 6 failed: Cannot insert as entity already exists for IClassDescriptor/Key: cZFSESCH_010/7918679 : m0007918676

when i see my trace log in client it dislay following mssg corresponding to m0007918676 .

20061215 15:20:11:329] D [MI/Persistence ] PersistenceManagerImpl.beginTransaction():false

[20061215 15:20:11:329] D [MI/Smartsync ] Start Processing message with processor TOP_DELTA_MODIFY using PersistenceWriter

[20061215 15:20:11:329] D [MI/Persistence ] PersistenceManagerImpl.get(IClassDescriptor,IAttributeDescriptor,Object):(IClassDescriptor(Name: cZFSESCH_TOP)),(IAttributeDescriptor(Name: state)),7918676

[20061215 15:20:11:329] D [MI/Persistence ] PersistenceWriterImpl.beginUpdate()(cZFSESCH_TOP,7918676)(5)(458292E467BF002E02000000A75165A5)(10001913)(SEDA WILFREDO)(10201945)()

[20061215 15:20:11:329] D [MI/Persistence ] PersistenceWriterImpl.beginInsert()(cZFSESCH_010,7918679)(0007918676)(5)(000021002055)()(Mr Wilfredo Seda)(ZCM1)(1166137200000)(35100000)(38700000)()

[20061215 15:20:11:329] E [MI/Smartsync ] Inbound processing of container with index 6 failed: Cannot insert as entity already exists for IClassDescriptor/Key: cZFSESCH_010/7918679 : <InboundProcessingError timestamp="2006-12-15-16-20-11"><RowProcessorDispatcherDump type="nonObservable" ><Action>m</Action><TopRowKey>0007918676</TopRowKey><ChildRowKey> </ChildRowKey><RequestId> </RequestId><StateID> </StateID></RowProcessorDispatcherDump></InboundProcessingError>

com.sap.ip.me.spi.persist.IPersistenceException: Cannot insert as entity already exists for IClassDescriptor/Key: cZFSESCH_010/7918679

at com.sap.ip.me.spi.persist.IPersistenceException.throwForInsertExisting(IPersistenceException.java:62)

at com.sap.ip.me.spi.persist.IPersistenceException.throwForInsertExisting(IPersistenceException.java:57)

at com.sap.ip.me.persist.fileio.spi.ObjectTable.insert(ObjectTable.java:213)

can u please help me for the same.

Thanks

Regards

Devendra

Former Member
0 Kudos

Hi Jo/Kishor,

I checked the bcakend there were two identical records(duplicate)but if am constantly facing this problem is there is any solution provided by SAP for the same.I sam using SP18 at present.

Thanks

regards

Devendra

kishorg
Advisor
Advisor
0 Kudos

Hi Deva,

Hope you have a clear idea of 'Key field mappings in the case of SyncBOs'.

The key field mapping in the case of SyncBo is to uniquely identify the records eventhough we have synckey as key field which is for the SmartSync Runtime to identify the records distinctively.

Just check these things also.. go through this..

You can see the Structure that you used as the table parameter of the GETLIST BAPI Wrapper as the Export parameter of the GETDETAIL Bapi Wrapper. Framework would use this export parameter to find out the conflict(if you are changing the same data in the mobile client and in the MI server, then it is marked as a conflict. Changes to the same TOP record or changes to the same ITEM record or changes to the different ITEM records of the same TOP record are will be treated as conflict.If you are adding one more item to the same TOP record and in the backend changes to the another ITEM record of the same TOP record. this can also..)

There is a problem in the GETDETAIL BAPI wrapper. Framework will report as a conflict, if we are not filling the EXPORT parameter of the GETDETAIL Bapi Wrapper exactly same as that one we selected in the TABLE parameter of the GETLIST.(based on the collected table records in the GETLIST Wrapper, we might have one or more keys. Based on these keys, we are selecting the

GETDETAIL data.If the particular row of data we selected for the GETLIST wrapper and the data we are EXPORTING in the GETDETAIL Wrapper for the same Header (TOP ) data are different , then the framework will treat this as a conflict since the data already present in the replica DB and that one in the back end are different because of improper selection in the GETDETAIL wrapper)...

refer this forum also..

If all these things are ok, then it might be a bug for SP 18..

Regards,

Kishor Gopinathan

Former Member
0 Kudos

Hi Kishor,

Thanks a lot for ur help. My problem is solved.Actually there were two identical records in th R/3 system (testing data)that was giving the problem i thinkk.

Thanks Again.

Regards

Devendra

Answers (0)