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