-->
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: runnable jar: failed to read schema document
PostPosted: Mon Mar 03, 2014 6:12 am 
Newbie

Joined: Mon Mar 03, 2014 5:54 am
Posts: 1
Dear Community,

I'm actually developing an swing application that should run on a PCs without any internet or network connection
the application entites are retrieved from a postgres database with hibernate/JPA.
Everything is fine when the App is started inside eclipse/STS. Then I generate a runnable jar with all dependend libs
with export -> runnable jar for tha isolated target pc

when I start the App on the target pc > java -jar -<jarname> the App crashed:


13374 [main] WARN org.hibernate.ejb.packaging.PersistenceXmlLoader - Warning par
sing XML: XML InputStream(14) schema_reference.4: Failed to read schema document
'http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd', because 1) could
not find the document; 2) the document could not be read; 3) the root element o
f the document is not <xsd:schema>.
Initial EntityManagerFactory creation failed.javax.persistence.PersistenceExcept
ion: No Persistence provider for EntityManager named AppDemo: Provider named org
.hibernate.ejb.HibernatePersistence threw unexpected exception at create EntityM
anagerFactory:
javax.persistence.PersistenceException
javax.persistence.PersistenceException: Unable to configure EntityManagerFactory

at org.hibernate.ejb.Ejb3Configuration.configure(Ejb3Configuration.java:
265)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(Hib
ernatePersistence.java:125)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:110)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.
java:83)
at util.JPAUtil.<clinit>(JPAUtil.java:19)
at main.program.createAndWriteEntities(program.java:93)
at main.program.main(program.java:55)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:39)


that how my persistence.xml looks like:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.1"
xmlns="http://xmlns.jcp.org/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://xmlns.jcp.org/xml/ns/persistence http://xmlns.jcp.org/xml/ns/persistence/persistence_2_1.xsd">
<persistence-unit name="AppDemo">
<provider>org.hibernate.ejb.HibernatePersistence</provider>
<mapping-file>model/patient.hbm.xml</mapping-file>
<properties>
<property name="hibernate.dialect" value="org.hibernate.dialect.PostgreSQLDialect"/>
<property name="hibernate.hbm2ddl.auto" value="none"/>
<property name="hibernate.show_sql" value="true" />
<property name="hibernate.default_schema" value="patienten"/>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver"/>
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/postgres"/>
<property name="hibernate.connection.user" value="postgres"/>
<property name="hibernate.connection.password" value="ligeti"/>
</properties>
</persistence-unit>
</persistence>


Any idea? Thank for any hint.

Kagel


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.