Hello,
i have a weird problem. Im Using JBOSS7.1 and Hibernate doesn't create the tables for the entities any more without an error. I haven't changed anything and the others in our team are working with the same code and there it works. I haven't changed the persistence.xml i'll paste it here. The Console output follows, too. As you can see, it tries to execute the import statement but this fails because the tables don't exist. What could be the problem? Can you please help me with that, i have no idea..
persistence.xml:
<?xml version="1.0" encoding="UTF-8"?>
<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence
http://java.sun.com/xml/ns/persistence/ ... ce_2_0.xsd"
version="2.0">
<persistence-unit name="loginDatabase">
<properties>
<property name="hibernate.hbm2ddl.auto" value="create" />
<property name="hibernate.show_sql" value="true"/>
<property name="javax.persistence.jdbc.url" value="jdbc:mysql://localhost:3306/JBOSS1" />
<property name="javax.persistence.jdbc.user" value="root" />
<property name="javax.persistence.jdbc.password" value="Passwort" /> -->
</properties>
</persistence-unit>
</persistence>
console output:
WARNING: -logmodule is deprecated. Please use the system property 'java.util.logging.manager' or the 'java.util.logging.LogManager' service loader.
22:55:08,776 Information [org.jboss.modules] JBoss Modules version 1.1.1.GA
22:55:08,969 INFO [org.jboss.msc] JBoss MSC version 1.0.2.GA
22:55:09,026 INFO [org.jboss.as] JBAS015899: JBoss AS 7.1.0.Final "Thunder" starting
22:55:09,801 INFO [org.xnio] XNIO Version 3.0.3.GA
22:55:09,801 INFO [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)
22:55:09,812 INFO [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA
22:55:09,823 INFO [org.jboss.remoting] JBoss Remoting version 3.2.2.GA
22:55:09,832 INFO [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers
22:55:09,837 INFO [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem
22:55:09,842 INFO [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.
22:55:09,879 INFO [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem
22:55:09,883 INFO [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem
22:55:09,892 INFO [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem
22:55:09,903 INFO [org.jboss.as.connector] (MSC service thread 1-5) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.7.Final)
22:55:09,913 INFO [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension
22:55:09,938 INFO [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.6.final
22:55:09,987 INFO [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service
22:55:10,001 INFO [org.jboss.as.mail.extension] (MSC service thread 1-8) JBAS015400: Bound mail session [java:jboss/mail/Default]
22:55:10,043 INFO [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.1.GA
22:55:10,046 INFO [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)
22:55:10,179 INFO [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-5) Starting Coyote HTTP/1.1 on http--127.0.0.1-8080
22:55:10,494 INFO [org.jboss.as.remoting] (MSC service thread 1-6) JBAS017100: Listening on /127.0.0.1:9999
22:55:10,495 INFO [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:4447
22:55:10,500 INFO [org.jboss.as.server.deployment.scanner] (MSC service thread 1-5) JBAS015012: Started FileSystemDeploymentService for directory /home/daniel/Desktop/jboss-as-7.1.0.Final/standalone/deployments
22:55:10,515 INFO [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found firstRichFaces.war in deployment directory. To trigger deployment create a file called firstRichFaces.war.dodeploy
22:55:10,532 INFO [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/MySQL]
22:55:10,577 INFO [org.jboss.as] (Controller Boot Thread) JBAS015874: JBoss AS 7.1.0.Final "Thunder" started in 2093ms - Started 134 of 205 services (70 services are passive or on-demand)
22:55:10,587 INFO [org.jboss.as.server.deployment] (MSC service thread 1-8) JBAS015876: Starting deployment of "firstRichFaces.war"
22:55:11,725 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'
22:55:11,725 WARN [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'
22:55:11,897 INFO [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for loginDatabase
22:55:12,308 INFO [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016002: Processing weld deployment firstRichFaces.war
22:55:12,607 INFO [org.jboss.weld.deployer] (MSC service thread 1-6) JBAS016005: Starting Services for CDI deployment: firstRichFaces.war
22:55:12,636 INFO [org.jboss.weld.Version] (MSC service thread 1-6) WELD-000900 1.1.5 (AS71)
22:55:12,676 INFO [org.jboss.as.jpa] (MSC service thread 1-8) JBAS011402: Starting Persistence Unit Service 'firstRichFaces.war#loginDatabase'
22:55:12,781 INFO [org.hibernate.annotations.common.Version] (MSC service thread 1-8) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}
22:55:12,786 INFO [org.hibernate.Version] (MSC service thread 1-8) HHH000412: Hibernate Core {4.0.1.Final}
22:55:12,787 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-8) HHH000206: hibernate.properties not found
22:55:12,789 INFO [org.hibernate.cfg.Environment] (MSC service thread 1-8) HHH000021: Bytecode provider name : javassist
22:55:12,805 INFO [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-8) HHH000204: Processing PersistenceUnitInfo [
name: loginDatabase
...]
22:55:12,869 INFO [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-8) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider
22:55:13,066 INFO [org.hibernate.dialect.Dialect] (MSC service thread 1-8) HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect
22:55:13,083 INFO [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-8) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory
22:55:13,087 INFO [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-8) HHH000397: Using ASTQueryTranslatorFactory
22:55:13,207 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-8) HHH000227: Running hbm2ddl schema export
22:55:13,266 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-8) HHH000231: Schema export unsuccessful: org.hibernate.tool.hbm2ddl.ImportScriptException: Error during statement execution (file: '/import.sql'): insert into User (id, email, firstname, lastname, password, isFulltime, isIntern, isParttime,isRegular, isWorkingStudent, abiturGrade, hasAbitur, hasStudium, studiumGrade, characteristic1, characteristic2,characteristic3, characteristic4, characteristic5, creationDate, gender) values (1,
'demo@user.de', 'Demo', 'Peter', 'demo', true, true, true, true, true, 1.3, true, true, 1.9, 5.0, 5.0, 5.0, 5.0, 5.0, '2012-04-26', 0)
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:452) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:379) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:305) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:294) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:452) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1737) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:84) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:904) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:889) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [hibernate-entitymanager-4.0.1.Final.jar:4.0.1.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.createContainerEntityManagerFactory(PersistenceUnitServiceImpl.java:162) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]
at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.0.Final.jar:7.1.0.Final]
at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1811)
at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1746)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [rt.jar:1.7.0_03]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_03]
at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_03]
Caused by: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Table 'JBOSS1.User' doesn't exist
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.7.0_03]
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.7.0_03]
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.7.0_03]
at java.lang.reflect.Constructor.newInstance(Constructor.java:525) [rt.jar:1.7.0_03]
at com.mysql.jdbc.Util.handleNewInstance(Util.java:411)
at com.mysql.jdbc.Util.getInstance(Util.java:386)
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1052)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3609)
at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:3541)
at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2002)
at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2163)
at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2618)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1749)
at com.mysql.jdbc.StatementImpl.executeUpdate(StatementImpl.java:1666)
at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:349)
at org.hibernate.tool.hbm2ddl.DatabaseExporter.export(DatabaseExporter.java:64) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:447) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]
... 16 more
22:55:13,278 INFO [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-8) HHH000230: Schema export complete
22:55:13,299 INFO [org.jboss.weld.deployer] (MSC service thread 1-8) JBAS016008: Starting weld service for deployment firstRichFaces.war
22:55:13,660 INFO [org.apache.catalina.core.StandardContext] (MSC service thread 1-7) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.
22:55:13,711 Information [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-7) Mojarra 2.1.5 (SNAPSHOT 20111202) für Kontext '/firstRichFaces' wird initialisiert.
22:55:15,299 INFO [org.hibernate.validator.util.Version] (MSC service thread 1-7) Hibernate Validator 4.2.0.Final
22:55:15,940 Information [org.richfaces.log.Cache] (MSC service thread 1-7) Selected fallback cache factory
22:55:15,942 Information [org.richfaces.log.Cache] (MSC service thread 1-7) Creating LRUMap cache instance using parameters: {org.richfaces.resourceMapping.enabled=false, org.richfaces.skin=tibuga, javax.faces.PROJECT_STAGE=Production, org.richfaces.enableControlSkinning=false, javax.faces.SKIP_COMMENTS=true}
22:55:15,950 Information [org.richfaces.log.Cache] (MSC service thread 1-7) Creating LRUMap cache instance of 512 items capacity
22:55:15,958 Information [org.richfaces.log.Application] (MSC service thread 1-7) RichFaces Core Implementation by JBoss by Red Hat, version v.4.2.0.Final
22:55:16,043 Warnung [org.richfaces.log.Application] (MSC service thread 1-7) JMS API was found on the classpath; if you want to enable RichFaces Push JMS integration, set context-param 'org.richfaces.push.jms.enabled' in web.xml
22:55:16,077 INFO [org.jboss.web] (MSC service thread 1-7) JBAS018210: Registering web context: /firstRichFaces
22:55:16,121 INFO [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "firstRichFaces.war"
It would be nice if you can help me. If you need more information, don't hesitate to ask.
Kind regards
Daniel