Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » NoSuchMethodError _persistence_set(Ljava/lang/String;Ljava/lang/Object;)V
NoSuchMethodError _persistence_set(Ljava/lang/String;Ljava/lang/Object;)V [message #557997] Thu, 09 September 2010 18:10 Go to next message
Fericit Bostan is currently offline Fericit Bostan
Messages: 68
Registered: June 2010
Member
I'm using EclipseLink 2.1 on GlassFish 3.0.1. I'm building my project with Maven and everything seems to work very well. The issue I'm running into is the my project (projectB) is referencing another project (projectA), which contains a @MappedSuperclass. The entities within projectB extend the mapped superclass, which should not be an issue.

The problem arises when I run the application, I get the following exception message:

javax.ejb.TransactionRolledbackLocalException: Exception thrown from bean: java.lang.NoSuchMethodError: com.intraxinc.persistence.entity.UUIDEntityBean._persistence_set(Ljava/lang/String;Ljava/lang/Object;)V
	at com.sun.ejb.containers.BaseContainer.checkExceptionClientTx(BaseContainer.java:4978)


I looked at the generated artifacts and I see classes for all my entities that are within my project (projectB) but none from projectA. Do I need to run the CanonicalModelProcessor and static weave on projectA as part of the build processes for these to be generated?

Thanks...
Re: NoSuchMethodError _persistence_set(Ljava/lang/String;Ljava/lang/Object;)V [message #558007 is a reply to message #557997] Thu, 09 September 2010 18:50 Go to previous messageGo to next message
Fericit Bostan is currently offline Fericit Bostan
Messages: 68
Registered: June 2010
Member
I decided to try and run the static weave and the CanonicalModelProcessor on projectA to see if it would generate the missing methods on my base artifacts. And it did, from what I can see, generate the missing methods on my classes that were defined as @Embeddable, but it did not on my classes that were defined as @MappedSuperclass.

So I'm a bit confused as to where to go from here. I can't mark my @MappedSuperclass as an @Entity because there is no @Id field on it. But the _persistence_xxx methods do not get generated otherwise. So what can I do to get these methods to generate?

Thanks...
Re: NoSuchMethodError _persistence_set(Ljava/lang/String;Ljava/lang/Object;)V [message #558626 is a reply to message #557997] Mon, 13 September 2010 18:04 Go to previous messageGo to next message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

The issue is that EclipseLink needs to weave the class, but because it is contained in another project it cannot be weaved, or was already loaded.

If you can isolate a simple test case, please log a bug. Could be something specific with @MappedSuperclass.

A workaround is to disable internal weaving,
"eclipselink.weaving.internal"="false"

Using method/property access for the class would probably also avoid the issue.


James : Wiki : Book : Blog : Twitter
Re: NoSuchMethodError _persistence_set(Ljava/lang/String;Ljava/lang/Object;)V [message #558633 is a reply to message #558626] Mon, 13 September 2010 18:24 Go to previous message
Fericit Bostan is currently offline Fericit Bostan
Messages: 68
Registered: June 2010
Member
Hi James,
Thanks for the reply. It appears that it is not being weaved, as you said, because the class exists within another project. I'll try to create a test case that I can attach to a bug, so it can be investigated.

The interesting part of all this is that I modified by base project (projectA) by having EclipseLink weave the classes as part of the build. My initial thought was perhaps EclipseLink could weave the advise into the base project and it would no longer be an issue. Unfortunately, because the class is marked as @MappedSuperclass, the methods are not generated - the class is not weaved. But if I change the annotation from @MappedSuperclass to @Embeddable, then the class does get weaved as expected. I'm guessing this is a bug because if I add an Entity to this project that extends the @MappedSuperclass, everything generates as expected.

I'll work on getting a test case pulled together.
Thanks for the help...
Previous Topic:How do you select delimit-identifiers at runtime?
Next Topic:Transform foreign keys in One-To-One Relationship
Goto Forum:
  


Current Time: Wed Oct 01 18:17:06 GMT 2014

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

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