Hi Sai,

When you run the tests in the mailbox-jpa module, there are no persistence.xml, but all the JPA properties are set via code.

If you look at the 3 classes in http://svn.apache.org/repos/asf/james/mailbox/trunk/jpa/src/test/java/org/apache/james/mailbox/jpa/ , you will see for example

 properties.put("openjpa.MetaDataFactory", "jpa(Types=" +
                JPAMailbox.class.getName() + ";" +
                AbstractJPAMessage.class.getName() + ";" +
                JPAMessage.class.getName() + ";" +
                JPAProperty.class.getName() + ";" +
                JPAUserFlag.class.getName() + ";" +
                JPASubscription.class.getName() + ")");

This is where you have to change to add the JPAEncryptedMessage.



When you run the server as a whole, you need to build the app module.

In this case, the file to change is
http://svn.apache.org/repos/asf/james/app/trunk/src/main/config/james/META-INF/persistence.xml

You will do 'mvn package', and the generated zip/tar.gz will contain that file.


I hope you can make it, even if I am a bit late for you work night.

Thx.


On 31/08/11 18:53, Saibabu Vallurupalli wrote:
Hi Eric,

O.k.. I agree with you. But I need little bit more details regarding what
should I do for the path. Since, I have the environment I can try this
locally and also deploy in our Test environment and perform quick regression
testing.

Path:
JPAMainboxManager.java is using JPAMessage object I need to modify the code
to use JPAEncryptedMessage and return the same.

I am trying this locally and the tests failed, Now my understanding is I
also need to change persistence.xml file. Since, I am not 100% used to the
development environment I need to know how Maven uses this file and from
where this file will be picked?

Can you please give me some insight about the path? I will be working
tonight to get this patch out. If you could help me I really appreciate you.
I am in USA EST timezone.

Thanks,
Sai


On Wed, Aug 31, 2011 at 7:27 PM, Eric Charles<eric.char...@u-mangate.com>wrote:

Hi Sai,

If you change JPAMessage to JPAEncryptedMessage in the JPAMessageManager,
you must update persistence.xml accordingly.

However, even if OpenJPAMailboxManager handles the encryption feature to
initialize the EncryptionDecryptHelper if needed, the JPAMailboxManager
should also verify the feature, and return a JPAEncryptedMessage if needed.

I hope this makes sense, and if yes, a patch is needed.

wdyt?


On 31/08/11 15:19, Saibabu Vallurupalli wrote:

Hi Eric/Norman:

I am able to reproduce this error in a simple way. In my checked-out
version
-
C:\work\workspace\james\**mailbox\trunk\jpa\src\main\**
java\org\apache\james\mailbox\**jpa\JPAMessageManager.java
There is reference to JPAMessage.java class and I changed it to
JPAEncryptedMessage.java ran the maven clean package and the tests failed
with the similar exception:

Thought of letting you. Thank you very much in advance.

Thanks, Sai




______________________________**_______________
*From:* Valluripalli, Sai
*Sent:* Wednesday, August 31, 2011 2:42 PM
*To:* 'server-dev@james.apache.org'
*Subject:* Unable to move emails between folders with Encryption turned -
on


Hi Norman/Eric,

We were in our System Testing phase and close to our release. During our
System Testing we discovered that Move  option is not working between the
folders. When we try to move email from Inbox to Trash we encounter the
exception below. I have also got the complete log if you need. But the
root
cause I understood from the below exception is somewhere in the
mail/store
code and other places JPAMessage class is referenced and when I changed
it
to JPAEncryptedMessage it is unable to locate JPAMessage and throwing the
exception.

Is there any master configuration to modify or do I need to refer
JPAEncryptedMessage.java class to any other modules and re-compile it?
Please advise.

Caused by:<openjpa-2.1.0-r422266:**1071316 fatal user error>
org.apache.openjpa.**persistence.ArgumentException: No metadata was
found for
type "class org.apache.james.mailbox.jpa.**
mail.model.openjpa.JPAMessage"**. The
class does not appear in the list of persistent types:
[org.apache.james.mailbox.jpa.**mail.model.JPAUserFlag,
org.apache.james.mailbox.jpa.**mail.model.JPAMailbox,
org.apache.james.mailbox.jpa.**mail.model.openjpa.**JPAEncryptedMessage,
org.apache.james.domainlist.**jpa.model.JPADomain,
org.apache.james.mailbox.jpa.**mail.model.openjpa.**AbstractJPAMessage,
org.apache.james.user.jpa.**model.JPAUser,
org.apache.james.mailbox.jpa.**mail.model.JPAProperty,
org.apache.james.rrt.jpa.**model.JPARecipientRewrite,
org.apache.james.mailbox.jpa.**user.model.JPASubscription].
         at
org.apache.openjpa.meta.**MetaDataRepository.**getMetaDataInternal(**
MetaDataRepository.java:407)
         at
org.apache.openjpa.meta.**MetaDataRepository.**getMetaData(**
MetaDataRepository.java:384)
         at
org.apache.openjpa.kernel.**BrokerImpl.persistInternal(**
BrokerImpl.java:2601)
         at
org.apache.openjpa.kernel.**BrokerImpl.persist(BrokerImpl.**java:2540)
         at
org.apache.openjpa.kernel.**BrokerImpl.persist(BrokerImpl.**java:2437)
         at
org.apache.openjpa.kernel.**DelegatingBroker.persist(**
DelegatingBroker.java:1069)
         at
org.apache.openjpa.**persistence.EntityManagerImpl.**
persist(EntityManagerImpl.**java:707)
         at sun.reflect.**NativeMethodAccessorImpl.**invoke0(Native
Method)
         at
sun.reflect.**NativeMethodAccessorImpl.**invoke(**
NativeMethodAccessorImpl.java:**39)
         at
sun.reflect.**DelegatingMethodAccessorImpl.**invoke(**
DelegatingMethodAccessorImpl.**java:25)
         at java.lang.reflect.Method.**invoke(Method.java:597)
         at
org.springframework.orm.jpa.**ExtendedEntityManagerCreator$**
ExtendedEntityManagerInvocatio**nHandler.invoke(**
ExtendedEntityManagerCreator.**java:365)
         at $Proxy56.persist(Unknown Source)
         at
org.apache.james.mailbox.jpa.**mail.JPAMessageMapper.save(**
JPAMessageMapper.java:362)
         ... 100 more
DEBUG 12:55:29,285 | james.imapserver | ID=1684154803 Error while
processing imap request


We appreciate your help on this.

Thank you, Sai.




--
Eric
http://about.echarles.net

--
Eric
http://about.echarles.net

------------------------------**------------------------------**---------
To unsubscribe, e-mail: 
server-dev-unsubscribe@james.**apache.org<server-dev-unsubscr...@james.apache.org>
For additional commands, e-mail: 
server-dev-help@james.apache.**org<server-dev-h...@james.apache.org>




--
Eric
http://about.echarles.net

---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org

Reply via email to