Hi there,
this is my first posting here, so please be lenient toward me. If something misses in my posting, please give me a hint.
I'm trying to use the EntityManager without a J2EE / JBoss environment. I registered all my EntityBeans in the persistence.xml and made the proper settings for the DB connection.
Within my JBoss environment all beans and the DB settings function properly, so I don't think it has to do with my beans.
Any hints?
Regards,
Hauke
Hibernate version:
Hibernate-Version: 3.2.0.cr2
Hibernate EntityManager: 3.1.0.Beta8
Name and version of the database you are using:
PostgreSQL 8.0
persistence.xml:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<persistence>
<persistence-unit name="plyd" transaction-type="RESOURCE_LOCAL">
<class>plyd.model.ListOfAlternativeServices</class>
<class>plyd.model.ServiceSelection</class>
<class>plyd.model.Brand</class>
<class>plyd.model.business.Bill</class>
<class>plyd.model.business.Contract</class>
<class>plyd.model.business.CustomerOrder</class>
<class>plyd.model.business.Product</class>
<class>plyd.model.customer.Address</class>
<class>plyd.model.customer.BankAccount</class>
<class>plyd.model.customer.CustomerAccount</class>
<class>plyd.model.customer.CustomerEMail</class>
<class>plyd.model.customer.PhoneNumber</class>
<class>plyd.model.customer.Sex</class>
<class>plyd.model.customer.UserConfig</class>
<class>plyd.model.farm.Deploy</class>
<class>plyd.model.farm.Farm</class>
<class>plyd.model.farm.Node</class>
<class>plyd.model.ressource.Architecture</class>
<class>plyd.model.ressource.Archive</class>
<class>plyd.model.ressource.ArchiveId</class>
<class>plyd.model.ressource.Dependency</class>
<class>plyd.model.ressource.FileBlob</class>
<class>plyd.model.ressource.OperatingSystem</class>
<class>plyd.model.ressource.PlydService</class>
<class>plyd.model.ressource.Resource</class>
<class>plyd.model.ressource.Type</class>
<class>plyd.model.ressource.validation.ConfigOption</class>
<class>plyd.model.ressource.validation.ConfigValidationPattern</class>
<class>plyd.model.ressource.validation.DataType</class>
<class>plyd.model.ressource.validation.DomainRestriction</class>
<class>plyd.model.ressource.validation.ValidationDescription</class>
<properties>
<property name="jboss.entity.manager.jndi.name" value="java:/EntityManager/plyd"/>
<property name="hibernate.hbm2ddl.auto" value="create-drop"/>
<property name="hibernate.connection.driver_class" value="org.postgresql.Driver" />
<property name="hibernate.connection.username" value="xxxx" />
<property name="hibernate.connection.password" value="xxxx" />
<property name="hibernate.connection.url" value="jdbc:postgresql://localhost:5432/plyd" />
<provider>org.hibernate.ejb.HibernatePersistence</provider>
</properties>
</persistence-unit>
</persistence>
Full stack trace of any exception that occurs:Code:
12.05.2006 18:45:05 org.hibernate.ejb.Version <clinit>
INFO: Hibernate EntityManager 3.1.0.Beta8b
12.05.2006 18:45:05 org.hibernate.cfg.annotations.Version <clinit>
INFO: Hibernate Annotations 3.1.0.Beta10b
12.05.2006 18:45:05 org.hibernate.cfg.Environment <clinit>
INFO: Hibernate 3.2 cr2
12.05.2006 18:45:05 org.hibernate.cfg.Environment <clinit>
INFO: hibernate.properties not found
12.05.2006 18:45:05 org.hibernate.cfg.Environment buildBytecodeProvider
INFO: Bytecode provider name : cglib
12.05.2006 18:45:05 org.hibernate.cfg.Environment <clinit>
INFO: using JDK 1.4 java.sql.Timestamp handling
12.05.2006 18:45:06 org.hibernate.ejb.packaging.FileZippedJarVisitor doProcessElements
WARNUNG: Unable to find file (ignored): file:/C:/Dokumente%20und%20Einstellungen/MojoPojo/Eigene%20Dateien/Development/workspace/plyd.core%5bBRANCH%5d/bin/java-test
java.util.zip.ZipException: Zugriff verweigert
at java.util.zip.ZipFile.open(Native Method)
at java.util.zip.ZipFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at java.util.jar.JarFile.<init>(Unknown Source)
at org.hibernate.ejb.packaging.FileZippedJarVisitor.doProcessElements(FileZippedJarVisitor.java:34)
at org.hibernate.ejb.packaging.JarVisitor.getMatchingEntries(JarVisitor.java:208)
at org.hibernate.ejb.Ejb3Configuration.addMetadataFromVisitor(Ejb3Configuration.java:201)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:183)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at plyd.test.EntitiyManagerTest.main(EntitiyManagerTest.java:26)
12.05.2006 18:45:06 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ListOfAlternativeServices
12.05.2006 18:45:06 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ListOfAlternativeServices on table ListOfAlternativeServices
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ServiceSelection
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ServiceSelection on table ServiceSelection
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.Brand
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.Brand on table Brand
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.business.Bill
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.business.Bill on table Bill
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.business.Contract
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.business.Contract on table Contract
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.business.CustomerOrder
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.business.CustomerOrder on table CustomerOrder
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.business.Product
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.business.Product on table Product
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.Address
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.Address on table Address
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.BankAccount
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.BankAccount on table BankAccount
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.CustomerAccount
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.CustomerAccount on table CustomerAccount
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.CustomerEMail
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.CustomerEMail on table CustomerEMail
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.PhoneNumber
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.PhoneNumber on table PhoneNumber
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.customer.UserConfig
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.customer.UserConfig on table UserConfig
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.farm.Deploy
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.farm.Deploy on table Deploy
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.farm.Farm
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.farm.Farm on table Farm
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.farm.Node
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.farm.Node on table Node
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.Architecture
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.Architecture on table Architecture
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.Archive
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.Archive on table Archive
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.Dependency
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.Dependency on table Dependency
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.OperatingSystem
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.OperatingSystem on table OperatingSystem
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.PlydService
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.PlydService on table PlydService
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.Resource
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.Resource on table Resource
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.Type
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.Type on table Type
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.validation.ConfigOption
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.validation.ConfigOption on table ConfigOption
12.05.2006 18:45:07 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.validation.ValidationDescription
12.05.2006 18:45:07 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.validation.ValidationDescription on table ValidationDescription
12.05.2006 18:45:08 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.validation.ConfigValidationPattern
12.05.2006 18:45:08 org.hibernate.cfg.AnnotationBinder bindClass
INFO: Binding entity from annotated class: plyd.model.ressource.validation.DomainRestriction
12.05.2006 18:45:08 org.hibernate.cfg.annotations.EntityBinder bindTable
INFO: Bind entity plyd.model.ressource.validation.DomainRestriction on table DomainRestriction
Exception in thread "main" java.lang.NoSuchMethodError: org.hibernate.cfg.NamingStrategy.foreignKeyColumnName(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Ljava/lang/String;
at org.hibernate.cfg.Ejb3JoinColumn.linkValueUsingDefaultColumnNaming(Ejb3JoinColumn.java:266)
at org.hibernate.cfg.annotations.TableBinder.bindFk(TableBinder.java:198)
at org.hibernate.cfg.FkSecondPass.doSecondPass(FkSecondPass.java:45)
at org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:261)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1034)
at org.hibernate.ejb.Ejb3Configuration.buildMappings(Ejb3Configuration.java:868)
at org.hibernate.ejb.EventListenerConfigurator.configure(EventListenerConfigurator.java:163)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:641)
at org.hibernate.ejb.Ejb3Configuration.createFactory(Ejb3Configuration.java:134)
at org.hibernate.ejb.Ejb3Configuration.createEntityManagerFactory(Ejb3Configuration.java:188)
at org.hibernate.ejb.HibernatePersistence.createEntityManagerFactory(HibernatePersistence.java:114)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:37)
at javax.persistence.Persistence.createEntityManagerFactory(Persistence.java:27)
at plyd.test.EntitiyManagerTest.main(EntitiyManagerTest.java:26)