-->
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.  [ 2 posts ] 
Author Message
 Post subject: How to specify the location of a jar file to be scanned
PostPosted: Wed May 23, 2012 4:03 pm 
Newbie

Joined: Thu Aug 28, 2008 11:06 am
Posts: 3
Hibernate cannot seem to find the jar file that contains my entity classes. I get a "not mapped" error when I use the jar file. If the class files are in the project 'classes' directory Hibernate does find them.

I thought the solution would be to add a <mapping element to my hibernate.cfg.xml.

Code:
<hibernate-configuration>
  <session-factory>
    <property name="hibernate.dialect">org.hibernate.dialect.PostgreSQLDialect</property>
    <mapping jar="entityClasses.jar"/>
  </session-factory>
</hibernate-configuration>


However, no matter what path I use I am getting:

Code:
org.hibernate.InvalidMappingException: Could not read mapping documents from jar: entityClasses.jar


First of all I would like to ask if this <mapping element is the right way to tell Hibernate where the jar file is.
Secondly, what sort of path to the jar file does the mapping element expect?

Thanks in advance for any help or advice,
-=beeky


Top
 Profile  
 
 Post subject: Re: How to specify the location of a jar file to be scanned
PostPosted: Fri May 25, 2012 12:34 pm 
Regular
Regular

Joined: Sat Apr 23, 2005 7:28 am
Posts: 52
Try...
Code:
<property name="mappingJarLocations">classpath:entityClasses.jar</property>


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 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:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.