Hi Mohammad,
Tks for JIRA and patch
To have the tests still work, you would need to modify
https://svn.apache.org/repos/asf/james/imap/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/JPAHostSystem.java
This is the place where the openjpa is setup for the tests: add a line
(properties.put("openjpa.[xyz]) to take your mailbox.xml mapping file
into account.
I hope you will find [xyz] on
http://openjpa.apache.org/builds/latest/docs/manual/ref_guide.html :)
The additional src/main/resources/META-INF/persistence.xml is not needed.
(btw, my proposal was to leave the annotations and let the xml file
take precedence if needed)
Once jpa unit test ok, you can copy/paste the mapping file to conf/jpa
in container-spring project, change persistence.xml, and yes, you should
deactivate the 'resolve dependency from workspace' on that project and
install the mailbox-jpa via 'mvn install'.
Tks for all,
Eric
On 24/11/2010 07:56, Mohammad Naghavi wrote:
Hi,
sorry for being late. I opened the JIRA and attached the patch to it, it is
here:
https://issues.apache.org/jira/browse/IMAP-233
<https://issues.apache.org/jira/browse/IMAP-233>No I didn't leave the
annotations while I wanted to test the mapping files. I have placed the link
in persistence.xml but as you said it seems it doesn't find the metadata. I
run mvn install but as said all test cases related to mailbox fails.
should I explicitly turn the resolve dependency from workspace off for the
container-spring project?
Thanks
MN
________________________________________
PHP& ASP .Net 3.5 web developer
Java& C# desktop developer
www.mohamnag.com
On Mon, Nov 22, 2010 at 11:15 AM, Eric Charles<[email protected]> wrote:
Hi,
Mailing list has removed attachement.
Could you please open a JIRA for the "jpa mapping files" and attach there
the patch .
From the error, it may be that the openjpa entities are not enhanced with
the metadata.
Did you leave the annotations in the classes? If yes, run mvn install (it
will enhance) and ensure that the container-spring project does not resolve
dependencies from the workspace (otherwise it will load unenhanced
classes...).
Tks,
Eric
On 21/11/2010 23:23, Mohammad Naghavi wrote:
ok, I forgot to attach the patch, here it is.
________________________________________
PHP& ASP .Net 3.5 web developer
Java& C# desktop developer
www.mohamnag.com<http://www.mohamnag.com>
On Sun, Nov 21, 2010 at 10:54 PM, Mohammad Naghavi<[email protected]<mailto:
[email protected]>> wrote:
Hi there,
as I'm trying hard to move JPA Entity meta data to separated xml
files, trying to compile the apache-james-mailbox-jpa project from
command line gives me this:
1182 James WARN [main] openjpa.Enhance - Type "class
org.apache.james.mailbo
x.jpa.mail.model.openjpa.AbstractJPAMailboxMembership$MailboxIdUidKey"
loaded by
java.net.urlclassloa...@6a4d37e5 has no metadata; enhancing as
persistence awar
e. If you intended for "class
org.apache.james.mailbox.jpa.mail.model.openjpa.Ab
stractJPAMailboxMembership$MailboxIdUidKey" to be
persistence-capable, then this
means that OpenJPA could not find any metadata for "class
org.apache.james.mail
box.jpa.mail.model.openjpa.AbstractJPAMailboxMembership$MailboxIdUidKey".
This c
an happen if the directory containing your metadata is not in your
CLASSPATH, or
if your metadata files are not named properly. See the
documentation on metadat
a placement for more information.
and all the tests fail not finding the named queries. I have
places the persistence.xml file pointing to mailbox.xml for meta
data in src/main/resources like the screenshot:
http://yfrog.com/6z78330626p
and that they are also copied to target correctly. does anyone
have any idea why JPA isn't finding the meta data?
I have also generated a patch that you can apply for the changes I
made to IMAP code checked out from the head revision. I attach it
to this mail.
Thanks,
MN
________________________________________
PHP& ASP .Net 3.5 web developer
Java& C# desktop developer
www.mohamnag.com<http://www.mohamnag.com>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]