Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » [Teneo] Lazy Properties, Instrumentation, Teneo+Hibernate
[Teneo] Lazy Properties, Instrumentation, Teneo+Hibernate [message #534994] Thu, 20 May 2010 23:11 Go to next message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Posting it again... since I forgot to add [teneo] to the subject...
------------------------------------------------------------ ----------------------
I am trying to get lazy properties to work with Teneo, but got stuck at this exception trying to start my app:

java.lang.NoSuchMethodError: com.me.MyPackageImpl.$javassist_read_ecorePackage()Lorg/ecli pse/emf/ecore/EcorePackage;
at com.me.MyPackageImpl.initializePackageContents(SubmissionTyp ePackageImpl.java:645)

I am running the InstrumentTask against my classes as described in the docs.

Are there any known issues with Hibernate instrumented classes and Teneo/EMF? Any ideas of what could have been gone wrong?

thanks,
Re: [Teneo] Lazy Properties, Instrumentation, Teneo+Hibernate [message #535014 is a reply to message #534994] Fri, 21 May 2010 04:55 Go to previous messageGo to next message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
You are the first in 4-5 years of Teneo existence to try this I am afraid... I have no experience with it myself. I
guess what happens is that also the generated EPackageImpl got instrumented. I checked the hibernate manual and it seems
that you can specify which classes to instrument. So you could skip the generated EPackageImpl in the instrumentation
task I guess.

btw, if you are using EMF on the server side (in a webapp for example) then you can consider also using the Texo
project. The Texo project generates code which is pure java (so no compile time dependencies) and is much easier to use
in combination with ORM's like Hibernate or EclipseLink. The Texo project also supports generating the orm.xml directly
from an ecore model or xsd. In addition it supports XML/XMI serialization (making use of EMF's capabilities) and a
runtime model (the EPackage).

See here for more information:
http://wiki.eclipse.org/Texo

gr. Martin

Lemao wrote:
> Posting it again... since I forgot to add [teneo] to the subject...
> ------------------------------------------------------------
> ----------------------
> I am trying to get lazy properties to work with Teneo, but got stuck at
> this exception trying to start my app:
>
> java.lang.NoSuchMethodError:
> com.me.MyPackageImpl.$javassist_read_ecorePackage()Lorg/ecli
> pse/emf/ecore/EcorePackage;
> at com.me.MyPackageImpl.initializePackageContents(SubmissionTyp
> ePackageImpl.java:645)
>
> I am running the InstrumentTask against my classes as described in the
> docs.
> Are there any known issues with Hibernate instrumented classes and
> Teneo/EMF? Any ideas of what could have been gone wrong?
>
> thanks,


--

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] Lazy Properties, Instrumentation, Teneo+Hibernate [message #535176 is a reply to message #535014] Fri, 21 May 2010 13:35 Go to previous messageGo to next message
Lemao  is currently offline Lemao Friend
Messages: 48
Registered: December 2009
Member
Hi Martin,

Thanks for the answer. It was indeed the problem. I tightened the file filter a bit and am only instrumenting the *Impl files except the factory/package ones. That got me past the exception.

I then got into another one which seems more Hibernate related (could emf/teneo have any impact? not sure). I basically get an NPE in EntityEntry.requiresDirtyCheck() in FieldInterceptorHelper.extractFieldInterceptor(entity).isDir ty() when flushing:

	public boolean requiresDirtyCheck(Object entity) {
		
		boolean isMutableInstance = 
				status != Status.READ_ONLY && 
				persister.isMutable();
		
		return isMutableInstance && (
				getPersister().hasMutableProperties() ||
				!FieldInterceptionHelper.isInstrumented( entity ) ||
				FieldInterceptionHelper.extractFieldInterceptor( entity).isDirty()
			);
		
	}


The Texo project looks interesting. My understanding is that it takes the same EMF models but generates its own Java representation, right? Also read that adapters/notifications are not generated/supported. This could be show stopper for us. I will take a closer look.

Once again, thanks for your help.
Re: [Teneo] Lazy Properties, Instrumentation, Teneo+Hibernate [message #535187 is a reply to message #535176] Fri, 21 May 2010 13:52 Go to previous message
Martin Taal is currently offline Martin TaalFriend
Messages: 5468
Registered: July 2009
Senior Member
Hi Lemao,
Hmm, I can really say if Teneo does something related to this NPE. You should debug into the extractFieldInterceptor to
see why it returns null (looking at the source code it can do that).

Regarding Texo, yes please take a look, I am interested in getting feedback on this project.

Regarding notifiers/adapters, I am considering making it possible to generate adapters/notifiers also for Texo but I am
not yet sure if that's possible for list/set associations without creating custom list/set implementations (which I
would like to avoid as it really complicates integration with other frameworks).
There is a bugzilla for this also:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=313493

I am now working on supporting jaxb model annotations. After that I will revisit the adapter/notifier topic (gives me
also some extra days of thinking about it).

gr. Martin

Lemao wrote:
> Hi Martin,
> Thanks for the answer. It was indeed the problem. I tightened the file
> filter a bit and am only instrumenting the *Impl files except the
> factory/package ones. That got me past the exception.
> I then got into another one which seems more Hibernate related (could
> emf/teneo have any impact? not sure). I basically get an NPE in
> EntityEntry.requiresDirtyCheck() in
> FieldInterceptorHelper.extractFieldInterceptor(entity).isDir ty() when
> flushing:
>
>
> public boolean requiresDirtyCheck(Object entity) {
>
> boolean isMutableInstance = status !=
> Status.READ_ONLY && persister.isMutable();
>
> return isMutableInstance && (
> getPersister().hasMutableProperties() ||
> !FieldInterceptionHelper.isInstrumented( entity ) ||
> FieldInterceptionHelper.extractFieldInterceptor(
> entity).isDirty()
> );
>
> }
>
>
> The Texo project looks interesting. My understanding is that it takes
> the same EMF models but generates its own Java representation, right?
> Also read that adapters/notifications are not generated/supported. This
> could be show stopper for us. I will take a closer look.
> Once again, thanks for your help.
>


--

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
Previous Topic:EMF Dynamic Templates
Next Topic:[CDO] Server config file for gastro example
Goto Forum:
  


Current Time: Fri Apr 26 03:11:33 GMT 2024

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

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

Back to the top