| [Teneo / JPOX]  java.lang.StringIndexOutOfBoundsException [message #92730] | 
Wed, 08 August 2007 09:33   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: fc_supercanard.yahoo.fr 
 
Hello Martin, 
 
I am trying to import content into DB2 database from an xml file. 
I initialize jpoxDataStore, then create resource to handle things. 
 
Here is the exception : 
 
Exception in thread "main" java.lang.StringIndexOutOfBoundsException 
	at java.lang.String.substring(String.java:1088) 
	at org.jpox.store.OID.<init>(OID.java:105) 
	at  
 org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302) 
	at  
 org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683) 
	at  
 org.eclipse.emf.ecore.util.EObjectValidator.validate_UniqueI D(EObjectValidator.java:1095) 
	at  
 org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:195) 
	at  
 org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:168) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:127) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
	at  
 org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
	at  
 org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
	at  
 org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
	at  
 org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
	at  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:87) 
	at  
 org.eclipse.emf.teneo.resource.StoreResource.validateObject( StoreResource.java:421) 
	at  
 org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:408) 
	at  
 org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:353) 
	at DatastoreInstall.importCars(DatastoreInstall.java:116) 
	at DatastoreInstall.init(DatastoreInstall.java:37) 
	at DatastoreInstall.main(DatastoreInstall.java:127) 
 
 
 
I made a small testcase. I would be nice if you could take a look on it. 
I have sent on your mail all the files that you should need. 
 
Regards, 
 
Quentin
 |  
 |  
  | 
 | 
 | 
| Re: [Teneo / JPOX]  java.lang.StringIndexOutOfBoundsException [message #92867 is a reply to message #92852] | 
Thu, 09 August 2007 04:30   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: fc_supercanard.yahoo.fr 
 
Hi, 
 
The bugzilla is created. 
 
regards 
 
Martin Taal wrote: 
> Hi Quentin, 
> Thanks for the testcase it really facilitated finding this issue. There  
> is a bug in the StoreResource class in Teneo. I have solved this and  
> checked it in. I hoped to get a new release out this week but I am not  
> sure if I can manage that. 
> As a workaround In the mean time you can create your own resource class  
> by extending JpoxResource and overriding the attached method with the  
> method below. 
>  
> The correct attached method is: 
>     public void attached(EObject eObject) { 
>         attachedHelper(eObject); 
>         for (Iterator<EObject> tree =  
> getNonResolvingContent(eObject).basicIterator(); tree.hasNext();) { 
>             final Object obj = tree.next(); 
>             // before this called: 
>             // attachedHelper((EObject) obj); 
>             // however this resulted in child elements (which were  
> loaded) not being 
>             // added to the internal id map 
>             attached((EObject) obj); 
>         } 
>     } 
>  
> Can you also create a bugzilla for this and attach the testcases you  
> send me? Then I can add your testcases to the teneo test set. 
>  
> gr. Martin 
>  
>  
> french.cancan wrote: 
>> Hello Martin, 
>> 
>> I am trying to import content into DB2 database from an xml file. 
>> I initialize jpoxDataStore, then create resource to handle things. 
>> 
>> Here is the exception : 
>> 
>> Exception in thread "main" java.lang.StringIndexOutOfBoundsException 
>>     at java.lang.String.substring(String.java:1088) 
>>     at org.jpox.store.OID.<init>(OID.java:105) 
>>     at  
>>  org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate_UniqueI D(EObjectValidator.java:1095)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:195)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:168)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:127) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:87) 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.validateObject( StoreResource.java:421)  
>> 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:408)  
>> 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:353) 
>>     at DatastoreInstall.importCars(DatastoreInstall.java:116) 
>>     at DatastoreInstall.init(DatastoreInstall.java:37) 
>>     at DatastoreInstall.main(DatastoreInstall.java:127) 
>> 
>> 
>> 
>> I made a small testcase. I would be nice if you could take a look on it. 
>> I have sent on your mail all the files that you should need. 
>> 
>> Regards, 
>> 
>> Quentin 
>  
>
 |  
 |  
  | 
| Re: [Teneo / JPOX]  java.lang.StringIndexOutOfBoundsException [message #609433 is a reply to message #92730] | 
Wed, 08 August 2007 09:59   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi Quentin, 
Okay, I will look at it this evening. 
 
gr. Martin 
 
french.cancan wrote: 
> Hello Martin, 
>  
> I am trying to import content into DB2 database from an xml file. 
> I initialize jpoxDataStore, then create resource to handle things. 
>  
> Here is the exception : 
>  
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException 
>     at java.lang.String.substring(String.java:1088) 
>     at org.jpox.store.OID.<init>(OID.java:105) 
>     at  
>  org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)  
>  
>     at  
>  org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate_UniqueI D(EObjectValidator.java:1095)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:195)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:168)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:127) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:87) 
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.validateObject( StoreResource.java:421)  
>  
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:408)  
>  
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:353) 
>     at DatastoreInstall.importCars(DatastoreInstall.java:116) 
>     at DatastoreInstall.init(DatastoreInstall.java:37) 
>     at DatastoreInstall.main(DatastoreInstall.java:127) 
>  
>  
>  
> I made a small testcase. I would be nice if you could take a look on it. 
> I have sent on your mail all the files that you should need. 
>  
> Regards, 
>  
> Quentin 
 
 
--  
 
With Regards, Martin Taal 
 
Springsite/Elver.org 
Office: Hardwareweg 4, 3821 BV Amersfoort 
Postal: Nassaulaan 7, 3941 EC Doorn 
The Netherlands 
Tel: +31 (0)84 420 2397 
Fax: +31 (0)84 225 9307 
Mail: mtaal@springsite.com - mtaal@elver.org 
Web: www.springsite.com - www.elver.org
 |  
 |  
  | 
| Re: [Teneo / JPOX]  java.lang.StringIndexOutOfBoundsException [message #609440 is a reply to message #92730] | 
Thu, 09 August 2007 00:51   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Hi Quentin, 
Thanks for the testcase it really facilitated finding this issue. There is a bug in the  
StoreResource class in Teneo. I have solved this and checked it in. I hoped to get a new release out  
this week but I am not sure if I can manage that. 
As a workaround In the mean time you can create your own resource class by extending JpoxResource  
and overriding the attached method with the method below. 
 
The correct attached method is: 
	public void attached(EObject eObject) { 
		attachedHelper(eObject); 
		for (Iterator<EObject> tree = getNonResolvingContent(eObject).basicIterator(); tree.hasNext();) { 
			final Object obj = tree.next(); 
			// before this called: 
			// attachedHelper((EObject) obj); 
			// however this resulted in child elements (which were loaded) not being 
			// added to the internal id map 
			attached((EObject) obj); 
		} 
	} 
 
Can you also create a bugzilla for this and attach the testcases you send me? Then I can add your  
testcases to the teneo test set. 
 
gr. Martin 
 
 
french.cancan wrote: 
> Hello Martin, 
>  
> I am trying to import content into DB2 database from an xml file. 
> I initialize jpoxDataStore, then create resource to handle things. 
>  
> Here is the exception : 
>  
> Exception in thread "main" java.lang.StringIndexOutOfBoundsException 
>     at java.lang.String.substring(String.java:1088) 
>     at org.jpox.store.OID.<init>(OID.java:105) 
>     at  
>  org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)  
>  
>     at  
>  org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate_UniqueI D(EObjectValidator.java:1095)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:195)  
>  
>     at  
>  org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:168)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:127) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>  
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>     at  
>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:87) 
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.validateObject( StoreResource.java:421)  
>  
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:408)  
>  
>     at  
>  org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:353) 
>     at DatastoreInstall.importCars(DatastoreInstall.java:116) 
>     at DatastoreInstall.init(DatastoreInstall.java:37) 
>     at DatastoreInstall.main(DatastoreInstall.java:127) 
>  
>  
>  
> I made a small testcase. I would be nice if you could take a look on it. 
> I have sent on your mail all the files that you should need. 
>  
> Regards, 
>  
> Quentin 
 
 
--  
 
With Regards, Martin Taal 
 
Springsite/Elver.org 
Office: Hardwareweg 4, 3821 BV Amersfoort 
Postal: Nassaulaan 7, 3941 EC Doorn 
The Netherlands 
Tel: +31 (0)84 420 2397 
Fax: +31 (0)84 225 9307 
Mail: mtaal@springsite.com - mtaal@elver.org 
Web: www.springsite.com - www.elver.org
 |  
 |  
  | 
| Re: [Teneo / JPOX]  java.lang.StringIndexOutOfBoundsException [message #609441 is a reply to message #92852] | 
Thu, 09 August 2007 04:30   | 
 
Eclipse User  | 
 | 
 | 
   | 
 
Originally posted by: fc_supercanard.yahoo.fr 
 
Hi, 
 
The bugzilla is created. 
 
regards 
 
Martin Taal wrote: 
> Hi Quentin, 
> Thanks for the testcase it really facilitated finding this issue. There  
> is a bug in the StoreResource class in Teneo. I have solved this and  
> checked it in. I hoped to get a new release out this week but I am not  
> sure if I can manage that. 
> As a workaround In the mean time you can create your own resource class  
> by extending JpoxResource and overriding the attached method with the  
> method below. 
>  
> The correct attached method is: 
>     public void attached(EObject eObject) { 
>         attachedHelper(eObject); 
>         for (Iterator<EObject> tree =  
> getNonResolvingContent(eObject).basicIterator(); tree.hasNext();) { 
>             final Object obj = tree.next(); 
>             // before this called: 
>             // attachedHelper((EObject) obj); 
>             // however this resulted in child elements (which were  
> loaded) not being 
>             // added to the internal id map 
>             attached((EObject) obj); 
>         } 
>     } 
>  
> Can you also create a bugzilla for this and attach the testcases you  
> send me? Then I can add your testcases to the teneo test set. 
>  
> gr. Martin 
>  
>  
> french.cancan wrote: 
>> Hello Martin, 
>> 
>> I am trying to import content into DB2 database from an xml file. 
>> I initialize jpoxDataStore, then create resource to handle things. 
>> 
>> Here is the exception : 
>> 
>> Exception in thread "main" java.lang.StringIndexOutOfBoundsException 
>>     at java.lang.String.substring(String.java:1088) 
>>     at org.jpox.store.OID.<init>(OID.java:105) 
>>     at  
>>  org.eclipse.emf.teneo.jpox.resource.JPOXResource.getEObjectB yID(JPOXResource.java:302)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.resource.impl.ResourceImpl.getEObject( ResourceImpl.java:683)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate_UniqueI D(EObjectValidator.java:1095)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate_EveryDe faultConstraint(EObjectValidator.java:195)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.EObjectValidator.validate(EObject Validator.java:168)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:127) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.teneo.resource.NonLoadingDiagnostician.doVal idateContents(NonLoadingDiagnostician.java:49)  
>> 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:130) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:107) 
>>     at  
>>  org.eclipse.emf.ecore.util.Diagnostician.validate(Diagnostic ian.java:87) 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.validateObject( StoreResource.java:421)  
>> 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.validateContent s(StoreResource.java:408)  
>> 
>>     at  
>>  org.eclipse.emf.teneo.resource.StoreResource.save(StoreResou rce.java:353) 
>>     at DatastoreInstall.importCars(DatastoreInstall.java:116) 
>>     at DatastoreInstall.init(DatastoreInstall.java:37) 
>>     at DatastoreInstall.main(DatastoreInstall.java:127) 
>> 
>> 
>> 
>> I made a small testcase. I would be nice if you could take a look on it. 
>> I have sent on your mail all the files that you should need. 
>> 
>> Regards, 
>> 
>> Quentin 
>  
>
 |  
 |  
  | 
Powered by 
FUDForum. Page generated in 0.28634 seconds