-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 
Author Message
 Post subject: Hibernate persistence.xml configuration - Searching mapped
PostPosted: Mon Mar 14, 2011 1:23 pm 
Newbie

Joined: Mon Mar 14, 2011 1:17 pm
Posts: 2
Hello everybody,

I've a small problem and I hope someone can help me. The problem is in a small demo application JEE which will be deployed on a weblogic 10.3.4 application server.
My problem is that everytime I deploy the demo application, the

Code:
[org.hibernate.ejb.packaging.AbstractJarVisitor] - Searching mapped entities in jar/par: file:/D:/Workspaceses/HibernateDeploymentIssue/Hibernate1/build/classes/


will be processed and all classes will be filtered
So how can I change the hibernate configuration that only the classes mentiont in the persistence.xml file will be mapped and all other classes will be ignored by hibernate.

I've alredy tried

Code:
<exclude-unlisted-classes>true</exclude-unlisted-classes>


and

Code:
         <properties> 
             <property name="hibernate.archive.autodetection" value="hbm" /> 
             <property name="hibernate.dialect" value="org.hibernate.dialect.Oracle10gDialect" /> 
             <property name="hibernate.transaction.manager_lookup_class" 
                 value="org.hibernate.transaction.WeblogicTransactionManagerLookup" /> 
             <property name="hibernate.show_sql" value="false" /> 
         </properties>


but I still get the entries in the log file.

Thanks for your help or some tipps.
Regards Daniel


Top
 Profile  
 
 Post subject: Re: Hibernate persistence.xml configuration - Searching mapped
PostPosted: Wed Mar 16, 2011 4:12 am 
Expert
Expert

Joined: Tue Jun 16, 2009 3:36 am
Posts: 990
I do pack all my persistent entity classes into a separate jar file and then specify this jar-file in the persistence.xml configuration file like following:
Code:
<persistence xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"   xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"  version="2.0">
<persistence-unit name="myunit">
   <jar-file>./mypersistency.jar</jar-file>
   <properties>
     <property name="hibernate.archive.autodetection" value="class"/>
     ...


In this way hibernate don't scans the whole classpath for class files.
I think that the same approach could also work for hbm-files.


Top
 Profile  
 
 Post subject: Re: Hibernate persistence.xml configuration - Searching mapped
PostPosted: Thu Mar 17, 2011 9:47 am 
Newbie

Joined: Mon Mar 14, 2011 1:17 pm
Posts: 2
Thanks for your advice, I will test it.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
cron
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.