java - Project runs normal in Eclipse but doesn't when exported to a runnable jar -


i'm having problems when try export stand-alone application.

it runs ok when execute using eclise, when try export runnable jar gives me errors.

my persistence.xml looks like

<persistence-unit transaction-type="resource_local" name="alctel_server_monitor">      <provider>org.hibernate.ejb.hibernatepersistenceprovider</provider>      <class>br.com.monitor.database.vo.servidor</class>     <class>br.com.monitor.database.vo.banco</class>     <class>br.com.monitor.database.vo.servico</class>     <class>br.com.monitor.database.vo.alerta.alerta</class>     <class>br.com.monitor.database.vo.alerta.alertaativo</class>     <class>br.com.monitor.database.vo.email.email</class>      <exclude-unlisted-classes>true</exclude-unlisted-classes>     <properties>         <property name="hibernate.connection.driver_class" value="com.microsoft.sqlserver.jdbc.sqlserverdriver" />         <property name="hibernate.connection.url" value="jdbc:sqlserver://192.168.99.222;databasename=monitor;" />         <property name="hibernate.connection.username" value="" />         <property name="hibernate.connection.password" value="" />         <property name="hibernate.format_sql" value="true" />         <property name="hibernate.show_sql" value="false" />         <property name="hibernate.dialect" value="org.hibernate.dialect.sqlserverdialect" />         <property name="hibernate.hbm2ddl.auto" value="none" />          <property name="hibernate.hbm2ddl.import_files_sql_extractor"             value="org.hibernate.tool.hbm2ddl.multiplelinessqlcommandextractor" />         <property name="hibernate.connection.useunicode" value="true" />         <property name="hibernate.connection.characterencoding"             value="utf-8" />     </properties> </persistence-unit> 

and it's located @ src/meta-inf/persistence.xml

the stack trace got when run terminal is:

at java.lang.reflect.method.invoke(unknown source) @ org.eclipse.jdt.internal.jarinjarloader.jarrsrcloader.main(jarrsrcloader.java:58) caused by: javax.persistence.persistenceexception: unable locate persistence units @ org.hibernate.jpa.hibernatepersistenceprovider.getentitymanagerfactorybuilderornull(hibernatepersistenceprovider.java:99) @ org.hibernate.ejb.hibernatepersistence.getentitymanagerfactorybuilderornull(hibernatepersistence.java:93) @ org.hibernate.jpa.hibernatepersistenceprovider.getentitymanagerfactorybuilderornull(hibernatepersistenceprovider.java:86) @ org.hibernate.ejb.hibernatepersistence.getentitymanagerfactorybuilderornull(hibernatepersistence.java:101) @ org.hibernate.jpa.hibernatepersistenceprovider.createentitymanagerfactory(hibernatepersistenceprovider.java:67) @ org.hibernate.ejb.hibernatepersistence.createentitymanagerfactory(hibernatepersistence.java:54) @ javax.persistence.persistence.createentitymanagerfactory(persistence.java:55)

i have no idea happening, me?

thank you!

i having same problem, , solved following way:

right click on project > properties > java build path > order , export, , select libraries

right click on project > export... > runnable jar file > copy required libraries sub-folder next generated jar


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -