james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Merve Temizer <mervet2...@gmail.com>
Subject Custom entities, external database, openjpa enhancer
Date Fri, 28 Sep 2012 09:36:46 GMT
 I need to add some new entities into James root app because i must access
an external database.
But i am getting error:

This configuration disallows runtime optimization, but the following listed
types were not enhanced at build time or at class load time with a
javaagent: "{myclass names}"

I think i do not need openjpa enhancer because i save mails into maildir
and users into somewhere else than db.

Should i disable openjpa enhancer, thus how?
If not, how can i do right connection for enhancer.

Below is persistence.xml

<persistence-unit name="James" transaction-type="RESOURCE_LOCAL">
        <!-- Mailbox stuff-->
        <class>org.apache.james.mailbox.jpa.mail.model.JPAMailbox</class>
        <class>org.apache.james.mailbox.jpa.mail.model.JPAUserFlag</class>

<class>org.apache.james.mailbox.jpa.mail.model.openjpa.AbstractJPAMessage</class>

<class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage</class>

<class>org.apache.james.mailbox.jpa.mail.model.openjpa.JPAMessage</class>
        <class>org.apache.james.mailbox.jpa.mail.model.JPAProperty</class>

<class>org.apache.james.mailbox.jpa.user.model.JPASubscription</class>
        <class>org.apache.james.domainlist.jpa.model.JPADomain</class>
        <class>org.apache.james.user.jpa.model.JPAUser</class>
        <class>org.apache.james.rrt.jpa.model.JPARecipientRewrite</class>

        <properties>
            <property name="openjpa.jdbc.SynchronizeMappings"
value="buildSchema(ForeignKeys=true)"/>
            <property name="openjpa.jdbc.MappingDefaults"
value="ForeignKeyDeleteAction=cascade, JoinForeignKeyDeleteAction=cascade"/>
            <property name="openjpa.jdbc.SchemaFactory"
value="native(ForeignKeys=true)"/>
            <property name="openjpa.jdbc.QuerySQLCache" value="false"/>
        </properties>

    </persistence-unit>


    <persistence-unit name="kepsPU" transaction-type="JTA">
    <provider>org.hibernate.ejb.HibernatePersistence</provider>
    <class>package.EmailAddress</class>
    <class>package.Message</class>
       <properties>
        <property name="javax.persistence.jdbc.user" value="root" />
        <property name="javax.persistence.jdbc.password" value="root" />
        <property name="javax.persistence.jdbc.url"
value="jdbc:mysql://localhost:3306/kepsDb" />
        <property name="javax.persistence.jdbc.driver"
value="com.mysql.jdbc.Driver" />
  <property name="hibernate.hbm2ddl.auto" value="none" />
  <property name="hibernate.show_sql" value="false" />
<property name="hibernate.dialect" value="
org.hibernate.dialect.MySQLDialect" />

<property name="hibernate.max_fetch_depth" value="0"  />
<property name="hibernate.cache.use_second_level_cache" value="true" />
<property name="hibernate.cache.use_query_cache" value="false" />
<property name="hibernate.cache.region.factory_class"
value="org.hibernate.cache.ehcache.EhCacheRegionFactory" />

  <property name="hibernate.ejb.naming_strategy"
value="com.gobito.web.app.persistence.util.AppImprovedNamingStrategy"/>
 </properties>

    </persistence-unit>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message