CQ Connector is generating StringIndexOutOfBoundsException
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
I have the synchronization working from RTC to CQ, but no updates from CQ to RTC the interop gateway is reporting 4 errors, and the console shows these 4 errors.
Any suggestions for troubleshooting this further are appreciated :)
-Sean
Any suggestions for troubleshooting this further are appreciated :)
-Sean
17 Jul 2009 08:31:02,328 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.apache.catalina.session.ManagerBase - Start expire sessions StandardManager at 1247837
462328 sessioncount 0
17 Jul 2009 08:31:02,328 [ContainerBackgroundProcessor[StandardEngine[Catalina]]] DEBUG org.apache.catalina.session.ManagerBase - End expire sessions StandardManager processingTi
me 0 expired sessions: 0
17 Jul 2009 08:31:04,281 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Got connection at 0 for CQ Interop Polling
17 Jul 2009 08:31:04,281 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Using CQInteropEventHandler-TR-HK/CQ-CQ Interop Polling
17 Jul 2009 08:31:04,312 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Releasing CQInteropEventHandler-TR-HK/CQ-CQ Interop Polling
17 Jul 2009 08:31:04,312 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of change history records read: 4
java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseContents(CQNoteEntry.java:131)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseCQContents(CQNoteEntry.java:109)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.formatNotes(CQInteropPollingManager.java:339)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.generatePropertyValue(CQInteropPollingManager.java:299)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.createProperties(CQInteropPollingManager.java:239)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.prepareRecordsForProcessing(CQInteropPollingManager.java:498)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.synchronizeIncoming(CQInteropPollingManager.java:607)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.pollingIncoming(PollingThread.java:48)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.run(PollingThread.java:31)
java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseContents(CQNoteEntry.java:131)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseCQContents(CQNoteEntry.java:109)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.formatNotes(CQInteropPollingManager.java:339)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.generatePropertyValue(CQInteropPollingManager.java:299)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.createProperties(CQInteropPollingManager.java:239)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.prepareRecordsForProcessing(CQInteropPollingManager.java:498)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.synchronizeIncoming(CQInteropPollingManager.java:607)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.pollingIncoming(PollingThread.java:48)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.run(PollingThread.java:31)
java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseContents(CQNoteEntry.java:131)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseCQContents(CQNoteEntry.java:109)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.formatNotes(CQInteropPollingManager.java:339)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.generatePropertyValue(CQInteropPollingManager.java:299)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.createProperties(CQInteropPollingManager.java:239)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.prepareRecordsForProcessing(CQInteropPollingManager.java:498)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.synchronizeIncoming(CQInteropPollingManager.java:607)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.pollingIncoming(PollingThread.java:48)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.run(PollingThread.java:31)
java.lang.StringIndexOutOfBoundsException
at java.lang.String.substring(String.java:1088)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseContents(CQNoteEntry.java:131)
at com.ibm.rational.connector.cq.teamapi.common.internal.CQNoteEntry.parseCQContents(CQNoteEntry.java:109)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.formatNotes(CQInteropPollingManager.java:339)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.generatePropertyValue(CQInteropPollingManager.java:299)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.createProperties(CQInteropPollingManager.java:239)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.prepareRecordsForProcessing(CQInteropPollingManager.java:498)
at com.ibm.rational.connector.cq.gateway.CQInteropPollingManager.synchronizeIncoming(CQInteropPollingManager.java:607)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.pollingIncoming(PollingThread.java:48)
at com.ibm.rational.connector.cq.gateway.polling.PollingThread.run(PollingThread.java:31)
17 Jul 2009 08:31:04,406 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - No changes to TR-HK/CQ
17 Jul 2009 08:31:04,406 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of change history records read: 0
17 Jul 2009 08:31:04,406 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of records processed:0
17 Jul 2009 08:31:04,406 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of records generation errors:4
17 Jul 2009 08:31:04,421 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of records ignored:0
17 Jul 2009 08:31:04,421 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of records suppressed:0
17 Jul 2009 08:31:04,421 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Number of records deleted:0
17 Jul 2009 08:31:04,421 [CQ Interop Polling] DEBUG com.ibm.rational.interop.level2 - Total Number of records not processed:0
8 answers
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
We've seen this happen when the CQ schema is not using the standard Notes package that comes with CQ. Are you using it, or have you "rolled your own" notes/comments implementation?
This can also happen if your synchronization rule is causing bad data to be written to the Notes_Log field in CQ. What does the property mapping for the Notes_Log field in your sync rule look like? Does it specify use of the Work Item Comments Transformer? The online help topic for configuration synchronization of work item comments with CQ notes is http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.connector.cq.doc/topics/t_mapping_comments.html
Also, what version of RTC and the CQ Connector are you using? In the 2.0 release, some changes were made to deal with unexpected formatting of the Notes_Log field.
This can also happen if your synchronization rule is causing bad data to be written to the Notes_Log field in CQ. What does the property mapping for the Notes_Log field in your sync rule look like? Does it specify use of the Work Item Comments Transformer? The online help topic for configuration synchronization of work item comments with CQ notes is http://publib.boulder.ibm.com/infocenter/rtc/v2r0m0/topic/com.ibm.team.connector.cq.doc/topics/t_mapping_comments.html
Also, what version of RTC and the CQ Connector are you using? In the 2.0 release, some changes were made to deal with unexpected formatting of the Notes_Log field.
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
John,
Thanks again for the quick responses here, this is in fact the Notes 5.1 field but it looks like it is a standard configuration. This is RTC 1.0.1.1 and Gateway M20090225-1543 with CQ 7.1, but the strange thing is that I am not synchronizing any comments right now are they mandatory?
-Sean
Thanks again for the quick responses here, this is in fact the Notes 5.1 field but it looks like it is a standard configuration. This is RTC 1.0.1.1 and Gateway M20090225-1543 with CQ 7.1, but the strange thing is that I am not synchronizing any comments right now are they mandatory?
-Sean
<xml>
<syncRule>
<name>sample02.cq.tr-hk.cq.Faults</name>
<externalTypeName>com.ibm.rational.clearquest.Fault</externalTypeName>
<syncItemTypeName>WorkItem</syncItemTypeName>
<syncItemTypeNsURI>com.ibm.team.workitem</syncItemTypeNsURI>
<syncItemTypeQualifier></syncItemTypeQualifier>
<itemManager>com.ibm.team.interop.service.managers.workitem.WorkItemManager</itemManager>
<externalManager>com.ibm.team.interop.service.managers.clearquest.CQExternalManager</externalManager>
<maxCycleCount>0</maxCycleCount>
<syncAllItemStates>false</syncAllItemStates>
<propertyMappings>
<propertyMapping>
<externalPropertyName>project_ref</externalPropertyName>
<itemPropertyName>Category</itemPropertyName>
<incoming>true</incoming>
<outgoing>true</outgoing>
<itemIdentifier>false</itemIdentifier>
<externalIdentifier>false</externalIdentifier>
<externalModifier>false</externalModifier>
<requiredItemProperties></requiredItemProperties>
<requiredExternalProperties></requiredExternalProperties>
<referenceSyncRule>sample02.cq.tr-hk.cq.Projects</referenceSyncRule>
</propertyMapping>
<propertyMapping>
<externalPropertyName>id</externalPropertyName>
<itemPropertyName>attribute:smallString:CQ Id</itemPropertyName>
<incoming>true</incoming>
<outgoing>false</outgoing>
<itemIdentifier>false</itemIdentifier>
<externalIdentifier>true</externalIdentifier>
<externalModifier>false</externalModifier>
<requiredItemProperties></requiredItemProperties>
<requiredExternalProperties></requiredExternalProperties>
</propertyMapping>
<propertyMapping>
<externalPropertyName>title</externalPropertyName>
<itemPropertyName>Summary</itemPropertyName>
<incoming>true</incoming>
<outgoing>true</outgoing>
<itemIdentifier>false</itemIdentifier>
<externalIdentifier>false</externalIdentifier>
<externalModifier>false</externalModifier>
<requiredItemProperties></requiredItemProperties>
<requiredExternalProperties></requiredExternalProperties>
</propertyMapping>
<propertyMapping>
<externalPropertyName>jazz_work_item</externalPropertyName>
<itemPropertyName>Id</itemPropertyName>
<incoming>false</incoming>
<outgoing>true</outgoing>
<itemIdentifier>true</itemIdentifier>
<externalIdentifier>false</externalIdentifier>
<externalModifier>false</externalModifier>
<requiredItemProperties></requiredItemProperties>
<requiredExternalProperties></requiredExternalProperties>
</propertyMapping>
<propertyMapping>
<externalPropertyName>assigned_to</externalPropertyName>
<itemPropertyName>Owner</itemPropertyName>
<incoming>true</incoming>
<outgoing>true</outgoing>
<itemIdentifier>false</itemIdentifier>
<externalIdentifier>false</externalIdentifier>
<externalModifier>false</externalModifier>
<requiredItemProperties></requiredItemProperties>
<requiredExternalProperties></requiredExternalProperties>
<referenceSyncRule>sample02.cq.tr-hk.cq.users</referenceSyncRule>
</propertyMapping>
</propertyMappings>
</syncRule>
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
The error is coming from code that processes all changes that occur to a CQ record when it is saved, before determining which fields are configured for synchronization. (First all the information about which fields were changed is collected, then the changed fields that are configured for synchronization are sent to the Jazz server.) So there seems to be something unusual in the notes data for the records that you are having problems with. Presumably, the problem doesn't occur with records that have no notes? Does it seem to occur with any record that has notes, or only certain ones? Can you copy and paste in all the information from the Notes Log field in the Notes tab of a record which has the problem, so we can see if there is something unusual about it?
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
Hi Sean....
The changes made in CQ are remembered in a record type called JazzConnectorChangeEvents. Could you go into a CQ client and see
if there are records in that table? The easiest way is to write a query (see http://jazz.net/library/technote/89, in the Testing the CQ Connector section.) There should be some records since you saw an error while they were being processed, and therefore, they should not have been deleted.
If so, please use the CQ client's export record facility (File > Export > Records...) to create a "dump" of the records. Pick JazzConnectorChangeEvents as the record type, and select "Export All records". On the next page of the wizard, click on "add all". In the next few screens you can take the defaults, but you might want to direct the export to a particular file.
Send me the results. My email is in my profile....
Rich Piazza
Jazz CQ Connector team
The changes made in CQ are remembered in a record type called JazzConnectorChangeEvents. Could you go into a CQ client and see
if there are records in that table? The easiest way is to write a query (see http://jazz.net/library/technote/89, in the Testing the CQ Connector section.) There should be some records since you saw an error while they were being processed, and therefore, they should not have been deleted.
If so, please use the CQ client's export record facility (File > Export > Records...) to create a "dump" of the records. Pick JazzConnectorChangeEvents as the record type, and select "Export All records". On the next page of the wizard, click on "add all". In the next few screens you can take the defaults, but you might want to direct the export to a particular file.
Send me the results. My email is in my profile....
Rich Piazza
Jazz CQ Connector team
![](http://jazz.net/_images/myphoto/edbf3a47336873717a92f6f0fae0e1cb.jpg)
Just a follow up, that when I setup RTC 2.x to sync comments it was better at handling the issue, and failed with the error you might expect.
-Sean
Outgoing at 8/5/09 9:47:36 AM CDT
Error occurred:
java.lang.RuntimeException: com.ibm.team.interop.service.managers.clearquest.common.InteropException: com.ibm.team.interop.service.managers.clearquest.common.InteropException: The contents of the Notes_Log field does not conform to the CQ Notes package formatting. This field cannot be used for comment synchronization.
com.ibm.team.interop.service.managers.clearquest.common.InteropException: com.ibm.team.interop.service.managers.clearquest.common.InteropException: The contents of the Notes_Log field does not conform to the CQ Notes package formatting. This field cannot be used for comment synchronization.
-Sean