On Jul 17, 2007, at 9:25 AM, Ueberbach, Michael wrote:

Hi Jacek,

I had to make a little break, now I'm trying to get back to the last situation.

Following your last advices:

reducing the persistance.xml to the neccessary elements works for deploying, but does not help in fetching data. In fact the same exception
(...Could not locate metadata for the class ...) is thrown.

I checked the code again:
- no field is annotated
- every getter is annotated (at least with @Basic)
- every other method named with get... Is annotated @Transient

Therefore the access type has to be clear (= PROPERTY). Nevertheless this is not recognized.

So I've tried two things:

First:
I put a xml mapping file (orm.xml) inside the deployment jar, where I explicitly set the access type to PROPERTY for all classes.
The deployment works, but the warning

"<1.0.0-SNAPSHOT-SNAPSHOT nonfatal user error> org.apache.openjpa.util.UserException: Type "de.lama.sample3.stammdaten.ejb.PersonBean" attempts to use both field and property access. Only one access method is permitted."

remains and the method call still doesn't work.

Second:
I deployed the whole stuff unchanged (except the deployment plan) to a jboss server(4.04) to compare the results. Here everything works as expected.

As result it seems to me that if there isn't an error inside the deployed code that jboss does not find, there must be something wrong with parsing the classes annotations in geronimo resp. openjpa.

I haven't looked into your problem in detail, but I don't think you can conclude from hibernate's ability to deploy an app X that X is entirely spec compliant and can be deployed on all other compliant jpa implementations.

Out of curiousity why are you using property access? I have yet to understand why anyone would do this given a choice.... hoping for enlightenment.

thanks
david jencks



regards
Michael


-----Ursprüngliche Nachricht-----
Von: Ueberbach, Michael [mailto:[EMAIL PROTECTED]
Gesendet: Dienstag, 10. Juli 2007 18:06
An: user@geronimo.apache.org; [EMAIL PROTECTED]
Betreff: AW: Problems using openJPA

Hi Jacek,

Thanks for your hints. To the first point: I've already seen this in the spec. I'm quite shure there is no access via the instance variables (but I will prove it again). I will also try to eliminate the entries in persistance.xml that are not neccessary. I'll tell the results as soon as possible.

Michael

-----Ursprüngliche Nachricht-----
Von: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Im Auftrag von Jacek Laskowski
Gesendet: Dienstag, 10. Juli 2007 11:19
An: user@geronimo.apache.org
Betreff: Re: Problems using openJPA

On 7/10/07, Ueberbach, Michael <[EMAIL PROTECTED]> wrote:
Hello Jacek,

meanwhile I'm able to send the jar I deployed to geronimo. I attach it to this mail, sources should be included. Also the persistence.xml that is used. As you can see I put @Basic annotations to all property getters explicitly (although I think this should be default) to make shure that access should be done by property (and not by field). Nevertheless this seems not be recognized by openJPA. It would be great if you have any idea why and what should be done.

Hi Michael,

I've just started looking into it, but thought I'd tell you that when you use property-based access (via getters) you should not access the entity state via instance fields.

You don't need to specify vendor element in the persistence.xml file.
Geronimo defaults to OpenJPA. According to the spec (6.2.1.4 provider
p.135):

The provider element must be specified if the application is dependent upon a particular persistence provider being used.

You don't need to specify class elements in Java EE env (as opposed to Java SE env). The container looks for other files unless exclude- unlisted-classes element is specified (which is not the case in your example).

See if that helps out. Going to spot other (mis)uses of the spec that might cause the trouble.

Jacek

--
Jacek Laskowski
http://www.JacekLaskowski.pl

Reply via email to