Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] NullPointerException in Simplest Test Case
[Teneo] NullPointerException in Simplest Test Case [message #760191] Thu, 01 December 2011 15:04 Go to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Hey everyone!

So now we are experimenting with Teneo and it does not look good. We used Peter Friese's example as a base and added some other lines of his tutorial.

Iit is just these lines before the transaction is closed:

Query query = session
		.createQuery("SELECT library from Library library ");
List<Library> result = query.list();

for (Library l : result) {
	System.out.println(l);
	if (l.getBooks() != null) {
		for (Book b : l.getBooks()) {
			System.out.println("\t" + b.getTitle());
		}
	}
}


We anticipated some kind of exception, but not a this one:

Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:155)
	at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:106)
	at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
	at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
	at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
	at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
	at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
	at org.hibernate.loader.Loader.getRow(Loader.java:1230)
	at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
	at org.hibernate.loader.Loader.doQuery(Loader.java:724)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
	at org.hibernate.loader.Loader.loadCollection(Loader.java:2019)
	at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
	at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
	at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
	at org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollectionEventListener.onInitializeCollection(EMFInitializeCollectionEventListener.java:61)
	at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744)
	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
	at org.hibernate.collection.PersistentList.toArray(PersistentList.java:146)
	at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.doLoad(HibernatePersistableEList.java:147)
	at org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(PersistableEList.java:254)
	at org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegateSize(PersistableEList.java:496)
	at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:64)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.hasNext(AbstractEList.java:684)
	at library.main.LibraryDemo.main(LibraryDemo.java:73)


What's wrong with this code?

And another related question: Does someone know of a official statement about the status of the Teneo project? All we found was, that in June 2009 version 1.1.0 was released - since the newest version we found was 1.1.2 it looks like nobody is currently working on it, making it no good choice in productive projects.

Thanks in advance!
Re: [Teneo] NullPointerException in Simplest Test Case [message #760339 is a reply to message #760191] Thu, 01 December 2011 23:47 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi,
Teneo is quite alive, bugs are being solved, questions on the forum are actively being answered on a daily basis.
The development attention now goes a bit more to the Texo project (http://wiki.eclipse.org/Texo), but Teneo is for sure
supported and will be for the longer term also.

Did you check out the wiki pages:
http://wiki.eclipse.org/Teneo/Hibernate

There on the download/install page you can find the update site where the latest build is published. Can you try that
build and then check if the error still occurs?

gr. Martin

On 12/01/2011 04:04 PM, s.schulz wrote:
> Hey everyone!
>
> So now we are experimenting with Teneo and it does not look good. We used
> http://www.peterfriese.de/using-teneo-and-emf-to-store-your-data/ as a base and added
> http://eclipse.dzone.com/articles/using-teneo-emf-and-hibernate.
>
> Iit is just these lines before the transaction is closed:
>
> Query query = session
> .createQuery("SELECT library from Library library ");
> List<Library> result = query.list();
>
> for (Library l : result) {
> System.out.println(l);
> if (l.getBooks() != null) {
> for (Book b : l.getBooks()) {
> System.out.println("\t" + b.getTitle());
> }
> }
> }
>
> We anticipated some kind of exception, but not a this one:
>
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:155)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:106)
>
> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:128)
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:105)
> at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2114)
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1404)
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1332)
> at org.hibernate.loader.Loader.getRow(Loader.java:1230)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:603)
> at org.hibernate.loader.Loader.doQuery(Loader.java:724)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2019)
> at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
> at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollectionEventListener.onInitializeCollection(EMFInitializeCollectionEventListener.java:61)
>
> at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1744)
> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:366)
> at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:108)
> at org.hibernate.collection.PersistentList.toArray(PersistentList.java:146)
> at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.doLoad(HibernatePersistableEList.java:147)
> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(PersistableEList.java:254)
> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegateSize(PersistableEList.java:496)
> at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:64)
> at org.eclipse.emf.common.util.AbstractEList$EIterator.hasNext(AbstractEList.java:684)
> at library.main.LibraryDemo.main(LibraryDemo.java:73)
>
> What's wrong with this code?
>
> And another related question: Does someone know of a official statement about the status of the Teneo project? All we
> found was, that in June 2009 version 1.1.0 was released - since the newest version we found was 1.1.2 it looks like
> nobody is currently working on it, making it no good choice in productive projects.
>
> Thanks in advance!


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] NullPointerException in Simplest Test Case [message #760370 is a reply to message #760339] Fri, 02 December 2011 08:18 Go to previous messageGo to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
I tried multiple versions of Hibernate, but I could not get it to work with the newest version of Teneo either.

With Hibernate 3.6.0 it still logs:
Exception in thread "main" java.lang.NullPointerException
	at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:164)
	at org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:116)
	at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)
	at org.hibernate.type.AbstractType.hydrate(AbstractType.java:104)
	at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265)
	at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
	at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
	at org.hibernate.loader.Loader.getRow(Loader.java:1355)
	at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
	at org.hibernate.loader.Loader.doQuery(Loader.java:829)
	at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
	at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
	at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
	at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)
	at org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
	at org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollectionEventListener.onInitializeCollection(EMFInitializeCollectionEventListener.java:61)
	at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)
	at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
	at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
	at org.hibernate.collection.PersistentList.toArray(PersistentList.java:146)
	at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.doLoad(HibernatePersistableEList.java:159)
	at org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(PersistableEList.java:254)
	at org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegateList(PersistableEList.java:166)
	at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.delegateSize(HibernatePersistableEList.java:537)
	at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:64)
	at org.eclipse.emf.common.util.AbstractEList$EIterator.hasNext(AbstractEList.java:684)
	at library.main.LibraryDemo.main(LibraryDemo.java:73)

In the first line of this loop:
for (Book b : l.getBooks()) {
	System.out.println("\t" + b.getTitle());
}


BTW, is there another way to install Teneo to a server EAR instead of using the Eclipse installer, finding the plug-ins in the file system and copying them inside the lib folder of the EAR? It looks ugly and especially since the client side still needs half of the plug-ins it is a lot of maintenance work.

(On a side note: It's weird, we first installed SDK 1.2.0 from http://download.eclipse.org/modeling/emf/updates/interim/ , but the plug-in id shows its version as 1.1.2)
Re: [Teneo] NullPointerException in Simplest Test Case [message #760381 is a reply to message #760370] Fri, 02 December 2011 08:56 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hmm, looking at the error it seems that the object you are persisting refers to another object which is part of an
epackage which is not registered with Teneo. Did you register all the epackages with Teneo?

Btw, did you check out the wiki (?), there is a download & install page there also
(http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install), it lists the correct update site to use:
http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/

If you open this url in the browser then you get an index page with links to download individual jars.

The download & install page also gives a link for the update site of dependencies:
http://www.elver.org/eclipse/update/

That Teneo is at version 1.2.0 does not mean that each plugin needs to be at that version.

gr. Martin

On 12/02/2011 09:18 AM, s.schulz wrote:
> I tried multiple versions of Hibernate, but I could not get it to work with the newest version of Teneo either.
> With Hibernate 3.6.0 it still logs:
> Exception in thread "main" java.lang.NullPointerException
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:164)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:116)
>
> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)
> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:104)
> at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265)
> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
> at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
> at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)
> at
> org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
>
> at
> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollectionEventListener.onInitializeCollection(EMFInitializeCollectionEventListener.java:61)
>
> at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)
> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
> at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
> at org.hibernate.collection.PersistentList.toArray(PersistentList.java:146)
> at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.doLoad(HibernatePersistableEList.java:159)
> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(PersistableEList.java:254)
> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegateList(PersistableEList.java:166)
> at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.delegateSize(HibernatePersistableEList.java:537)
> at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:64)
> at org.eclipse.emf.common.util.AbstractEList$EIterator.hasNext(AbstractEList.java:684)
> at library.main.LibraryDemo.main(LibraryDemo.java:73)
> In the first line of this loop:
> for (Book b : l.getBooks()) {
> System.out.println("\t" + b.getTitle());
> }
>
>
> BTW, is there another way to install Teneo to a server EAR instead of using the Eclipse installer, finding the plug-ins
> in the file system and copying them inside the lib folder of the EAR? It looks ugly and especially since the client side
> still needs half of the plug-ins it is a lot of maintenance work.
> (On a side note: It's weird, we first installed SDK 1.2.0 from http://download.eclipse.org/modeling/emf/updates/interim/
> , but the plug-in id shows its version as 1.1.2)


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] NullPointerException in Simplest Test Case [message #760388 is a reply to message #760381] Fri, 02 December 2011 09:10 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Correction, the NPE occurs on this line:
eClass = (EClass) eContainerPackage.getEClassifier(eContainerEClassName);
so the eContainerPackage is null, this variable is set like this:
final EPackage eContainerPackage = theRegistry.getEPackage(nsuri);
so apparently the nsuri does not resolve to an EPackage.

Can you put a breakpoint there and check the nsuri to see if it is correct or not?

gr. Martin

On 12/02/2011 09:56 AM, Martin Taal wrote:
> Hmm, looking at the error it seems that the object you are persisting refers to another object which is part of an
> epackage which is not registered with Teneo. Did you register all the epackages with Teneo?
>
> Btw, did you check out the wiki (?), there is a download & install page there also
> (http://wiki.eclipse.org/Teneo/Hibernate/Download_and_Install), it lists the correct update site to use:
> http://download.eclipse.org/modeling/emf/teneo/updates/1.2.0/interim/
>
> If you open this url in the browser then you get an index page with links to download individual jars.
>
> The download & install page also gives a link for the update site of dependencies:
> http://www.elver.org/eclipse/update/
>
> That Teneo is at version 1.2.0 does not mean that each plugin needs to be at that version.
>
> gr. Martin
>
> On 12/02/2011 09:18 AM, s.schulz wrote:
>> I tried multiple versions of Hibernate, but I could not get it to work with the newest version of Teneo either.
>> With Hibernate 3.6.0 it still logs:
>> Exception in thread "main" java.lang.NullPointerException
>> at
>> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType$EContainerFeatureIDHolder.convertFromString(EContainerFeatureIDUserType.java:164)
>>
>>
>> at
>> org.eclipse.emf.teneo.hibernate.mapping.econtainer.EContainerFeatureIDUserType.nullSafeGet(EContainerFeatureIDUserType.java:116)
>>
>>
>> at org.hibernate.type.CustomType.nullSafeGet(CustomType.java:109)
>> at org.hibernate.type.AbstractType.hydrate(AbstractType.java:104)
>> at org.hibernate.persister.entity.AbstractEntityPersister.hydrate(AbstractEntityPersister.java:2265)
>> at org.hibernate.loader.Loader.loadFromResultSet(Loader.java:1527)
>> at org.hibernate.loader.Loader.instanceNotYetLoaded(Loader.java:1455)
>> at org.hibernate.loader.Loader.getRow(Loader.java:1355)
>> at org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:611)
>> at org.hibernate.loader.Loader.doQuery(Loader.java:829)
>> at org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:274)
>> at org.hibernate.loader.Loader.loadCollection(Loader.java:2166)
>> at org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:62)
>> at org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:627)
>> at
>> org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
>>
>>
>> at
>> org.eclipse.emf.teneo.hibernate.mapping.EMFInitializeCollectionEventListener.onInitializeCollection(EMFInitializeCollectionEventListener.java:61)
>>
>>
>> at org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1863)
>> at org.hibernate.collection.AbstractPersistentCollection.initialize(AbstractPersistentCollection.java:369)
>> at org.hibernate.collection.AbstractPersistentCollection.read(AbstractPersistentCollection.java:111)
>> at org.hibernate.collection.PersistentList.toArray(PersistentList.java:146)
>> at org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.doLoad(HibernatePersistableEList.java:159)
>> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.load(PersistableEList.java:254)
>> at org.eclipse.emf.teneo.mapping.elist.PersistableEList.delegateList(PersistableEList.java:166)
>> at
>> org.eclipse.emf.teneo.hibernate.mapping.elist.HibernatePersistableEList.delegateSize(HibernatePersistableEList.java:537)
>> at org.eclipse.emf.common.util.DelegatingEList.size(DelegatingEList.java:64)
>> at org.eclipse.emf.common.util.AbstractEList$EIterator.hasNext(AbstractEList.java:684)
>> at library.main.LibraryDemo.main(LibraryDemo.java:73)
>> In the first line of this loop:
>> for (Book b : l.getBooks()) {
>> System.out.println("\t" + b.getTitle());
>> }
>>
>>
>> BTW, is there another way to install Teneo to a server EAR instead of using the Eclipse installer, finding the plug-ins
>> in the file system and copying them inside the lib folder of the EAR? It looks ugly and especially since the client side
>> still needs half of the plug-ins it is a lot of maintenance work.
>> (On a side note: It's weird, we first installed SDK 1.2.0 from http://download.eclipse.org/modeling/emf/updates/interim/
>> , but the plug-in id shows its version as 1.1.2)
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] NullPointerException in Simplest Test Case [message #760394 is a reply to message #760381] Fri, 02 December 2011 09:38 Go to previous messageGo to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
> Did you register all the epackages with Teneo?

As far as I can tell, yes. As I said, this is a tutorial, so I am assuming everything should work as it is. These are the lines that should do the registering (at least it's what the comment says):

// register the model package with the data store
dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });


Actually we don't really need this example to work, we have our own working test scenario. We just encountered a LazyInitializationException and wanted to make some performance tests to find out how Teneo is able to load connected data and if it too suffers the n+1 problem. And as I said, we assumed an example should work out of the box and if it doesn't, maybe some of the surroundings are not okay, making our test scenario faulty.


> Btw, did you check out the wiki

Yes, we now use the correct version. What I meant was: When we first installed Teneo we used this other update site, which lists an obsolete version under the 1.2.0 branch.


> If you open this url in the browser then you get an index page with links to download individual jars.

Good to know that's the suggested method. I assume the client gets the same jars, since synchronizing plug-in versions with jar versions might be a bit to advanced? Do you know of some Documentation for a client-server approach to Teneo?

We just found people saying "We did this, but we encountered this specialized problem:", but nowhere does it state how they did it.
Re: [Teneo] NullPointerException in Simplest Test Case [message #760415 is a reply to message #760394] Fri, 02 December 2011 10:19 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
I have no direct idea why it does not work, Teneo has several testcases for the library model and they pass ofcourse. It
would be great if you can debug to see why the epackage is null, I wonder what the epackage uri is on which it fails...

Teneo is either used server or client side, if used client side then the client directly connects to the database. For a
full client-server solution the CDO project maybe interesting. CDO has a hibernate store which uses Teneo.
http://wiki.eclipse.org/CDO/Hibernate_Store

If used server side then people have developed their own client-server communication logic. But I am not involved in
that so I can't really help out there.

gr. Martin

On 12/02/2011 10:38 AM, s.schulz wrote:
>> Did you register all the epackages with Teneo?
>
> As far as I can tell, yes. As I said, this is a tutorial, so I am assuming everything should work as it is. These are
> the lines that should do the registering (at least it's what the comment says):
>
> // register the model package with the data store
> dataStore.setEPackages(new EPackage[] { LibraryPackage.eINSTANCE });
>
> Actually we don't really need this example to work, we have our own working test scenario. We just encountered a
> LazyInitializationException and wanted to make some performance tests to find out how Teneo is able to load connected
> data and if it too suffers the n+1 problem. And as I said, we assumed an example should work out of the box and if it
> doesn't, maybe some of the surroundings are not okay, making our test scenario faulty.
>
>> Btw, did you check out the wiki
>
> Yes, we now use the correct version. What I meant was: When we first installed Teneo we used this other update site,
> which lists an obsolete version under the 1.2.0 branch.
>
>> If you open this url in the browser then you get an index page with links to download individual jars.
>
> Good to know that's the suggested method. I assume the client gets the same jars, since synchronizing plug-in versions
> with jar versions might be a bit to advanced? Do you know of some Documentation for a client-server approach to Teneo?
> We just found people saying "We did this, but we encountered this specialized problem:", but nowhere does it state how
> they did it.


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] NullPointerException in Simplest Test Case [message #760440 is a reply to message #760415] Fri, 02 December 2011 11:39 Go to previous messageGo to next message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Thanks for your continuous effort to help.

> http://wiki.eclipse.org/CDO/Hibernate_Store

Thank you, I'll make sure to check it out.

> It would be great if you can debug to see why the epackage is null, I wonder what the epackage uri is on which it fails...

Now this is weird. In this case it uses the epackage URI of our other test scenario. I checked it ten times, this is not the URI used to register anything in the tutorial. I even closed the other projects completely and searched the entire workspace for the package name (its our company's name, so of course nothing should show up inside an external tutorial), but there is no reference to that package name anywhere.

What makes this even more difficult is in this loop:
for (Library l : result) {
	for (Book b : l.getBooks()) {
		System.out.println("\t" + b.getTitle());
	}
}

The outer loop contains Library objects that where found via a query of this session, the java objects have the correct name and package. Now why would he try to search for the books in some other package? And where does he get it from?


Edit: I got it, there was one line in the database where the other package was referenced, clearing the columns "econtainer_class", "e_container" and "e_container_feature_name" package helped.

[Updated on: Fri, 02 December 2011 11:49]

Report message to a moderator

Re: [Teneo] NullPointerException in Simplest Test Case [message #760451 is a reply to message #760440] Fri, 02 December 2011 12:30 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Are you accidentally having a database which contains records from another testcase? That could be the reason, that in
the table the wrong information is stored.

gr. Martin

On 12/02/2011 12:39 PM, s.schulz wrote:
> Thanks for your continuous effort to help.
>> http://wiki.eclipse.org/CDO/Hibernate_Store
>
> Thank you, I'll make sure to check it out.
>
>> It would be great if you can debug to see why the epackage is null, I wonder what the epackage uri is on which it
>> fails...
>
> Now this is weird. In this case it uses the epackage URI of our other test scenario. I checked it ten times, this is not
> the URI used to register anything in the tutorial. I even closed the other projects completely and searched the entire
> workspace for the package name (its our company's name, so of course nothing should show up inside an external
> tutorial), but there is no reference to that package name anywhere.
>
> What makes this even more difficult is in this loop:
> for (Library l : result) {
> for (Book b : l.getBooks()) {
> System.out.println("\t" + b.getTitle());
> }
> }
> The outer loop contains Library objects that where found via a query of this session, the java objects have the correct
> name and package. Now why would he try to search for the books in some other package? And where does he get it from?
>
>


--

With Regards, Martin Taal

Springsite/Elver.org
Office: Hardwareweg 4, 3821 BV Amersfoort
Postal: Nassaulaan 7, 3941 EC Doorn
The Netherlands
Cell: +31 (0)6 288 48 943
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] NullPointerException in Simplest Test Case [message #760455 is a reply to message #760451] Fri, 02 December 2011 12:46 Go to previous message
S. SchulzFriend
Messages: 72
Registered: September 2011
Member
Well, not accidentally... these columns were not used, so we figured we could share the database among applications. But we just watched the now functional SELECT query and noted that these columns are seemingly filled inside the select, so this was no good idea at all. Thanks again for your help!
Previous Topic:[CDO] More optimal mapping of EReferences ??
Next Topic:how modify the metamodel of EMF?
Goto Forum:
  


Current Time: Thu Apr 25 15:57:37 GMT 2024

Powered by FUDForum. Page generated in 0.03981 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top