-->
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.  [ 1 post ] 
Author Message
 Post subject: Read mapping jar="dbsetup.jar" from othe project
PostPosted: Thu Oct 01, 2009 5:42 am 
Newbie

Joined: Tue Jun 10, 2008 4:40 am
Posts: 13
I have a project dbsetup, this project only contain class entity, and i made with annotation

this file file hibernate.cfg.xml for project dbsetup
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hbm2ddl.auto">update</property>

<mapping class="model.annotation.GroupUser"/>
<mapping class="model.annotation.User"/>

</session-factory>
</hibernate-configuration>


then that project i build to be dbsetup.jar

so, i make new project with name MyApp

this file hibernate.cfg.xml
Code:
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>

<mapping jar="dbsetup.jar"/>

</session-factory>
</hibernate-configuration>

while i develop MyApp project i added library form my project early its dbsetup.jar

then while i run MyApp project in Netbeans is running ok, but while i run MyApp.jar without Netbeans got error like this
Code:
org.hibernate.InvalidMappingException: Could not read mapping documents from jar : dbsetup.jar



i have tried like this
Code:
double click file MyApp.jar in folder dist or with command  but got same error

c:\>java -jar dist/MyAapp.jar


thanks, for your help


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

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.