0 Replies Latest reply on Aug 22, 2013 7:49 AM by manou manuella

    Jboss with ejb3.1 jpa and JSF2 project.IDE:eclipse MYSQL

    manou manuella Newbie

      Hi everyone,

      i work on web project with ejb3.1 jpa and JSF2

      IDE :eclipse

      MYSQL

      jboss 7.1.1

      when i want to access to my database for CRUD operation i have these errors.

      PS: i use jpa tools for my class model and i work on ubuntu


      00:06:21,713 INFO  [org.jboss.as.osgi] (MSC service thread 1-2) JBAS011942: Stopping OSGi Framework

      00:13:35,881 INFO  [org.jboss.as.configadmin] (ServerService Thread Pool -- 26) JBAS016200: Activating ConfigAdmin Subsystem

      00:13:35,955 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

      00:13:35,964 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      00:13:35,972 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

      00:13:35,894 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

      00:13:35,974 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

      00:13:36,252 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final

      00:13:36,263 INFO  [org.jboss.as.connector] (MSC service thread 1-1) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

      00:13:37,351 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service

      00:13:37,380 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-2) JBAS015400: Bound mail session [java:jboss/mail/Default]

      00:13:37,942 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      00:13:38,419 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-3) Démarrage de Coyote HTTP/1.1 sur http--127.0.0.1-8080

      00:13:39,804 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      00:13:40,642 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-2) JBoss Web Services - Stack CXF Server 4.0.2.GA

      00:13:41,529 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory /opt/jboss-as-7.1.1.Final/standalone/deployments

      00:13:41,535 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found Projet_bgi.war in deployment directory. To trigger deployment create a file called Projet_bgi.war.dodeploy

      00:13:41,569 INFO  [org.jboss.as.remoting] (MSC service thread 1-4) JBAS017100: Listening on /127.0.0.1:4447

      00:13:41,569 INFO  [org.jboss.as.remoting] (MSC service thread 1-1) JBAS017100: Listening on /127.0.0.1:9999

      00:13:42,322 INFO  [org.jboss.as.controller] (Controller Boot Thread) JBAS014774: Service status report

      JBAS014775:    New missing/unsatisfied dependencies:

            service jboss.jdbc-driver.mysql-connector-java-5_1_26-bin_jar (missing) dependents: [service jboss.data-source.java:/BGI_ds]

       

      00:13:42,406 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-4) JBAS015876: Starting deployment of "mysql-connector-java-5.1.26-bin.jar"

      00:13:42,414 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "Projet_bgi.war"

      00:13:43,495 INFO  [org.jboss.as.connector.deployers.jdbc] (MSC service thread 1-3) JBAS010404: Deploying non-JDBC-compliant driver class com.mysql.jdbc.Driver (version 5.1)

      00:13:43,539 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/BGI_ds]

      00:13:47,219 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Tomcat6InjectionProvider:org.apache.catalina.util.DefaultAnnotationProcessor' for service type 'com.sun.faces.spi.injectionprovider'

      00:13:47,236 WARN  [org.jboss.as.server.deployment] (MSC service thread 1-3) JBAS015893: Encountered invalid class name 'com.sun.faces.vendor.Jetty6InjectionProvider:org.mortbay.jetty.plus.annotation.InjectionCollection' for service type 'com.sun.faces.spi.injectionprovider'

      00:13:47,281 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for Projet_bgi

      00:13:48,169 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named PersonnelBean in deployment unit deployment "Projet_bgi.war" are as follows:

       

          java:global/Projet_bgi/PersonnelBean!ejb.PersonnelBean

          java:app/Projet_bgi/PersonnelBean!ejb.PersonnelBean

          java:module/PersonnelBean!ejb.PersonnelBean

          java:global/Projet_bgi/PersonnelBean!ejb.GestionPersonnel

          java:app/Projet_bgi/PersonnelBean!ejb.GestionPersonnel

          java:module/PersonnelBean!ejb.GestionPersonnel

       

      00:13:49,745 INFO  [org.jboss.as.jpa] (MSC service thread 1-1) JBAS011402: Starting Persistence Unit Service 'Projet_bgi.war#Projet_bgi'

      00:13:50,802 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-1) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

      00:13:50,851 INFO  [org.hibernate.Version] (MSC service thread 1-1) HHH000412: Hibernate Core {4.0.1.Final}

      00:13:50,854 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-1) HHH000206: hibernate.properties not found

      00:13:50,859 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-1) HHH000021: Bytecode provider name : javassist

      00:13:51,217 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-1) HHH000204: Processing PersistenceUnitInfo [

          name: Projet_bgi

          ...]

      00:13:51,975 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-1) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      00:13:52,499 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-1) HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect

      00:13:52,539 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-1) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

      00:13:52,618 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-1) HHH000397: Using ASTQueryTranslatorFactory

      00:13:53,131 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-1) Hibernate Validator 4.2.0.Final

      00:13:54,288 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-1) HHH000228: Running hbm2ddl schema update

      00:13:54,289 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-1) HHH000102: Fetching database metadata

      00:13:54,298 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-1) HHH000319: Could not get database metadata: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'system_sequences' in information_schema

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_27]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.6.0_27]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.6.0_27]

          at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [rt.jar:1.6.0_27]

          at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.Util.getInstance(Util.java:386) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2812)

          at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2761)

          at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1612)

          at org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:340)

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:149) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:70) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:63) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:196) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:457) [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.1.Final.jar:7.1.1.Final]

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.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:1146) [rt.jar:1.6.0_27]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.6.0_27]

          at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_27]

       

      00:13:54,317 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-1) HHH000299: Could not complete schema update: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown table 'system_sequences' in information_schema

          at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) [rt.jar:1.6.0_27]

          at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57) [rt.jar:1.6.0_27]

          at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) [rt.jar:1.6.0_27]

          at java.lang.reflect.Constructor.newInstance(Constructor.java:532) [rt.jar:1.6.0_27]

          at com.mysql.jdbc.Util.handleNewInstance(Util.java:411) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.Util.getInstance(Util.java:386) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:1054) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4190) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:4122) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:2570) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:2731) [mysql-connector-java-5.0.5.jar:]

          at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2812)

          at com.mysql.jdbc.ConnectionImpl.execSQL(ConnectionImpl.java:2761)

          at com.mysql.jdbc.StatementImpl.executeQuery(StatementImpl.java:1612)

          at org.jboss.jca.adapters.jdbc.WrappedStatement.executeQuery(WrappedStatement.java:340)

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.initSequences(DatabaseMetadata.java:149) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:70) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.DatabaseMetadata.<init>(DatabaseMetadata.java:63) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:196) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.tool.hbm2ddl.SchemaUpdate.execute(SchemaUpdate.java:178) [hibernate-core-4.0.1.Final.jar:4.0.1.Final]

          at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:457) [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.1.Final.jar:7.1.1.Final]

          at org.jboss.as.jpa.service.PersistenceUnitServiceImpl.start(PersistenceUnitServiceImpl.java:85) [jboss-as-jpa-7.1.1.Final.jar:7.1.1.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:1146) [rt.jar:1.6.0_27]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615) [rt.jar:1.6.0_27]

          at java.lang.Thread.run(Thread.java:679) [rt.jar:1.6.0_27]

       

      00:13:54,769 INFO  [org.apache.catalina.core.StandardContext] (MSC service thread 1-4) The listener "com.sun.faces.config.ConfigureListener" is already configured for this context. The duplicate definition has been ignored.

      00:13:54,944 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initialisation de Mojarra 2.1.7-jbossorg-1 (20120227-1401) pour le contexte «/Projet_bgi»

      00:13:58,052 INFO  [org.primefaces.webapp.PostConstructApplicationEventListener] (MSC service thread 1-4) Running on PrimeFaces 3.3

      00:13:58,330 INFO  [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /Projet_bgi

      00:13:58,365 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015951: Admin console listening on http://127.0.0.1:9990

      00:13:58,374 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 30848ms - Started 316 of 396 services (78 services are passive or on-demand)

      00:13:58,572 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "mysql-connector-java-5.1.26-bin.jar"

      00:13:58,573 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "Projet_bgi.war"

      00:13:58,574 INFO  [org.jboss.as.controller] (DeploymentScanner-threads - 2) JBAS014774: Service status report

      JBAS014776:    Newly corrected services:

            service jboss.jdbc-driver.mysql-connector-java-5_1_26-bin_jar (no longer required)

       

      standalone.xml

       

      <datasources>

                      <datasource jndi-name="java:jboss/datasources/ExampleDS" pool-name="ExampleDS" enabled="true" use-java-context="true">

                          <connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1</connection-url>

                          <driver>h2</driver>

                          <security>

                              <user-name>sa</user-name>

                              <password>sa</password>

                          </security>

                      </datasource>

                      <datasource jndi-name="java:/BGI_ds" pool-name="BGI_ds" enabled="true" use-java-context="true">

                          <connection-url>jdbc:mysql://localhost:3306/BGI</connection-url>

                          <driver>mysql</driver>

                          <security>

                              <user-name>root</user-name>

                              <password>root</password>

                          </security>

                      </datasource>

                      <drivers>

                          <driver name="h2" module="com.h2database.h2">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                          <driver name="mysql" module="com.mysql">

                              <xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>

                          </driver>

                      </drivers>

                  </datasources>

       

      persistence.xml


      <?xml version="1.0" encoding="UTF-8"?>

      <persistence version="2.0" 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/persistence_2_0.xsd">

          <persistence-unit name="Projet_bgi" transaction-type="JTA">

          <class>model.Personnel</class>

          <jta-data-source>java:/BGI_ds</jta-data-source>

          <properties>

      <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/>

      <property name="hibernate.hbm2ddl.auto" value="update"/>

      </properties>

          </persistence-unit>

      </persistence>

       

      module.xml

       

      <?xml version="1.0" encoding="UTF-8"?>

       

       

       

      <module xmlns="urn:jboss:module:1.1" name="com.mysql">

       

          <resources>

              <resource-root path="mysql-connector-java-5.1.26-bin.jar"/>

            

          </resources>

          <dependencies>

              <module name="javax.api"/>

              <module name="javax.transaction.api"/>

              <module name="javax.servlet.api" optional="true"/>

          </dependencies>

      </module>

       

       

      Please i need an answer thank you