8 Replies Latest reply on Aug 22, 2012 2:14 AM by Ryan Li

    Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

    Ryan Li Newbie

      I m trying the new appserver, jboss. However, the app pops an Error 404 page

      I didn't specify the database name, Oracle, like I did with glassfish eclipselink.

      is it the key that cause the error? if so, how to do it with hibernate and jboss?

       

       

       

       

       

      23:06:09,881 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

      23:06:10,145 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

      23:06:10,233 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

      23:06:11,591 INFO  [org.xnio] XNIO Version 3.0.3.GA

      23:06:11,598 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

      23:06:11,605 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

      23:06:11,618 INFO  [org.jboss.remoting] JBoss Remoting version 3.2.3.GA

      23:06:11,662 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

      23:06:11,709 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 31) JBAS010280: Activating Infinispan subsystem.

      23:06:11,735 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 38) JBAS011800: Activating Naming Subsystem

      23:06:11,737 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 39) JBAS011940: Activating OSGi Subsystem

      23:06:11,793 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 44) JBAS013101: Activating Security Subsystem

      23:06:11,814 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 48) JBAS015537: Activating WebServices Extension

      23:06:12,046 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

      23:06:12,084 INFO  [org.jboss.as.naming] (MSC service thread 1-4) JBAS011802: Starting Naming Service

      23:06:12,091 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 27) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

      23:06:12,116 INFO  [org.jboss.as.security] (MSC service thread 1-3) JBAS013100: Current PicketBox version=4.0.7.Final

      23:06:12,145 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

      23:06:12,161 INFO  [org.jboss.as.mail.extension] (MSC service thread 1-4) JBAS015400: Bound mail session [java:jboss/mail/Default]

      23:06:12,305 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.2.GA

      23:06:12,845 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-2) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments

      23:06:12,861 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on localhost/127.0.0.1:4447

      23:06:12,873 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on /127.0.0.1:9999

      23:06:12,926 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-2) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080

      23:06:12,932 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found jbBookWeb.war in deployment directory. To trigger deployment create a file called jbBookWeb.war.dodeploy

      23:06:13,106 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-1) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

      23:06:13,107 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-3) JBAS010400: Bound data source [java:/OraclePool]

      23:06:13,150 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "jbBookWeb.war"

      23:06:13,448 INFO  [org.jboss.as.jpa] (MSC service thread 1-3) JBAS011401: Read persistence.xml for chapter10PU

      23:06:13,599 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016002: Processing weld deployment jbBookWeb.war

      23:06:13,660 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-2) JNDI bindings for session bean named BookEJB in deployment unit deployment "jbBookWeb.war" are as follows:

       

          java:global/jbBookWeb/BookEJB!com.apress.javaee6.chapter10.BookEJB

          java:app/jbBookWeb/BookEJB!com.apress.javaee6.chapter10.BookEJB

          java:module/BookEJB!com.apress.javaee6.chapter10.BookEJB

          java:global/jbBookWeb/BookEJB

          java:app/jbBookWeb/BookEJB

          java:module/BookEJB

       

      23:06:13,870 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016005: Starting Services for CDI deployment: jbBookWeb.war

      23:06:14,514 INFO  [org.jboss.weld.Version] (MSC service thread 1-2) WELD-000900 1.1.5 (AS71)

      23:06:14,601 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011402: Starting Persistence Unit Service 'jbBookWeb.war#chapter10PU'

      23:06:14,764 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-2) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

      23:06:14,770 INFO  [org.hibernate.Version] (MSC service thread 1-2) HHH000412: Hibernate Core {4.0.1.Final}

      23:06:14,772 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000206: hibernate.properties not found

      23:06:14,774 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000021: Bytecode provider name : javassist

      23:06:14,796 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-2) HHH000204: Processing PersistenceUnitInfo [

          name: chapter10PU

          ...]

      23:06:14,976 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-2) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      23:06:16,066 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-2) HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect

      23:06:16,089 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-2) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

      23:06:16,094 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-2) HHH000397: Using ASTQueryTranslatorFactory

      23:06:16,139 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final

      23:06:16,553 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-2) HHH000228: Running hbm2ddl schema update

      23:06:16,554 INFO  [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-2) HHH000102: Fetching database metadata

      23:06:16,601 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-2) HHH000319: Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

       

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)

          at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)

          at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)

          at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)

          at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)

          at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)

          at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:853)

          at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)

          at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)

          at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1469)

          at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:389)

          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:1110) [rt.jar:1.7.0_04]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

       

      23:06:16,627 ERROR [org.hibernate.tool.hbm2ddl.SchemaUpdate] (MSC service thread 1-2) HHH000299: Could not complete schema update: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist

       

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:439)

          at oracle.jdbc.driver.T4CTTIoer.processError(T4CTTIoer.java:395)

          at oracle.jdbc.driver.T4C8Oall.processError(T4C8Oall.java:802)

          at oracle.jdbc.driver.T4CTTIfun.receive(T4CTTIfun.java:436)

          at oracle.jdbc.driver.T4CTTIfun.doRPC(T4CTTIfun.java:186)

          at oracle.jdbc.driver.T4C8Oall.doOALL(T4C8Oall.java:521)

          at oracle.jdbc.driver.T4CStatement.doOall8(T4CStatement.java:194)

          at oracle.jdbc.driver.T4CStatement.executeForDescribe(T4CStatement.java:853)

          at oracle.jdbc.driver.OracleStatement.executeMaybeDescribe(OracleStatement.java:1145)

          at oracle.jdbc.driver.OracleStatement.doExecuteWithTimeout(OracleStatement.java:1267)

          at oracle.jdbc.driver.OracleStatement.executeQuery(OracleStatement.java:1469)

          at oracle.jdbc.driver.OracleStatementWrapper.executeQuery(OracleStatementWrapper.java:389)

          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:1110) [rt.jar:1.7.0_04]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [rt.jar:1.7.0_04]

          at java.lang.Thread.run(Thread.java:722) [rt.jar:1.7.0_04]

       

      23:06:16,804 INFO  [org.jboss.weld.deployer] (MSC service thread 1-2) JBAS016008: Starting weld service for deployment jbBookWeb.war

      23:06:17,625 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-2) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/jbBookWeb'

      23:06:19,560 INFO  [org.jboss.web] (MSC service thread 1-2) JBAS018210: Registering web context: /jbBookWeb

      23:06:19,568 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015951: Admin console listening on http://127.0.0.1:9990

      23:06:19,568 INFO  [org.jboss.as] (MSC service thread 1-1) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 10245ms - Started 210 of 288 services (76 services are passive or on-demand)

      23:06:19,698 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "jbBookWeb.war"

        • 1. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
          Ryan Li Newbie

          here is the 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/xmls/ns/persistence/persistence_2_0.xsd"

                       version="2.0">

                          

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

                  <provider>org.hibernate.ejb.HibernatePersistence</provider>

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

                  <class>com.apress.javaee6.chapter10.Book</class>

                  <properties>

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

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

                  </properties>

              </persistence-unit>

          </persistence>

          • 2. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
            Frank Langelage Master

            Add property "hibernate.show_sql" with value true to your persistence.xml and see the query which fails.

             

            And your datasource configuration might be helpful to see.

            • 4. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
              Ryan Li Newbie

              here is the stack trace after adding the property mentioned

              I looked into the stack trace, it said the war was deployed. how come it show error 404?

               

              13:26:25,879 INFO  [org.jboss.modules] JBoss Modules version 1.1.1.GA

              13:26:30,336 INFO  [org.jboss.msc] JBoss MSC version 1.0.2.GA

              13:26:30,610 INFO  [org.jboss.as] JBAS015899: JBoss AS 7.1.1.Final "Brontes" starting

              13:26:43,334 INFO  [org.jboss.as.server] JBAS015888: Creating http management service using socket-binding (management-http)

              13:26:43,355 INFO  [org.xnio] XNIO Version 3.0.3.GA

              13:26:43,677 INFO  [org.xnio.nio] XNIO NIO Implementation Version 3.0.3.GA

              13:26:43,946 INFO  [org.jboss.as.logging] JBAS011502: Removing bootstrap log handlers

              13:26:44,010 INFO  [org.jboss.as.security] (ServerService Thread Pool -- 52) JBAS013101: Activating Security Subsystem

              13:26:44,144 INFO  [org.jboss.as.clustering.infinispan] (ServerService Thread Pool -- 39) JBAS010280: Activating Infinispan subsystem.

              13:26:44,145 INFO  [org.jboss.as.osgi] (ServerService Thread Pool -- 47) JBAS011940: Activating OSGi Subsystem

              13:26:44,149 INFO  [org.jboss.remoting] (MSC service thread 1-4) JBoss Remoting version 3.2.3.GA

              13:26:44,226 INFO  [org.jboss.as.naming] (ServerService Thread Pool -- 46) JBAS011800: Activating Naming Subsystem

              13:26:44,301 INFO  [org.jboss.as.webservices] (ServerService Thread Pool -- 56) JBAS015537: Activating WebServices Extension

              13:26:47,663 INFO  [org.jboss.as.security] (MSC service thread 1-2) JBAS013100: Current PicketBox version=4.0.7.Final

              13:26:47,858 INFO  [org.jboss.as.connector] (MSC service thread 1-3) JBAS010408: Starting JCA Subsystem (JBoss IronJacamar 1.0.9.Final)

              13:26:54,660 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 35) JBAS010403: Deploying JDBC-compliant driver class oracle.jdbc.OracleDriver (version 11.2)

              13:26:55,015 INFO  [org.jboss.as.connector.subsystems.datasources] (ServerService Thread Pool -- 35) JBAS010403: Deploying JDBC-compliant driver class org.h2.Driver (version 1.3)

              13:26:55,052 INFO  [org.jboss.as.naming] (MSC service thread 1-2) JBAS011802: Starting Naming Service

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

              13:26:58,411 INFO  [org.apache.coyote.http11.Http11Protocol] (MSC service thread 1-4) Starting Coyote HTTP/1.1 on http-localhost-127.0.0.1-8080

              13:26:59,564 INFO  [org.jboss.ws.common.management.AbstractServerConfig] (MSC service thread 1-3) JBoss Web Services - Stack CXF Server 4.0.2.GA

              13:27:03,687 INFO  [org.jboss.as.server.deployment.scanner] (MSC service thread 1-3) JBAS015012: Started FileSystemDeploymentService for directory C:\jboss-as-7.1.1.Final\standalone\deployments

              13:27:03,847 INFO  [org.jboss.as.remoting] (MSC service thread 1-3) JBAS017100: Listening on /127.0.0.1:9999

              13:27:03,847 INFO  [org.jboss.as.remoting] (MSC service thread 1-2) JBAS017100: Listening on localhost/127.0.0.1:4447

              13:27:04,027 INFO  [org.jboss.as.server.deployment.scanner] (DeploymentScanner-threads - 1) JBAS015003: Found jbBookWeb.war in deployment directory. To trigger deployment create a file called jbBookWeb.war.dodeploy

              13:27:04,745 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:jboss/datasources/ExampleDS]

              13:27:04,746 INFO  [org.jboss.as.connector.subsystems.datasources] (MSC service thread 1-2) JBAS010400: Bound data source [java:/OraclePool]

              13:27:06,072 INFO  [org.jboss.as.server.deployment] (MSC service thread 1-1) JBAS015876: Starting deployment of "jbBookWeb.war"

              13:27:08,786 INFO  [org.jboss.as.jpa] (MSC service thread 1-4) JBAS011401: Read persistence.xml for chapter10PU

              13:27:10,753 INFO  [org.jboss.weld.deployer] (MSC service thread 1-4) JBAS016002: Processing weld deployment jbBookWeb.war

              13:27:10,883 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (MSC service thread 1-4) JNDI bindings for session bean named BookEJB in deployment unit deployment "jbBookWeb.war" are as follows:

               

                  java:global/jbBookWeb/BookEJB!com.apress.javaee6.chapter10.BookEJB

                  java:app/jbBookWeb/BookEJB!com.apress.javaee6.chapter10.BookEJB

                  java:module/BookEJB!com.apress.javaee6.chapter10.BookEJB

                  java:global/jbBookWeb/BookEJB

                  java:app/jbBookWeb/BookEJB

                  java:module/BookEJB

               

              13:27:13,255 INFO  [org.jboss.weld.deployer] (MSC service thread 1-1) JBAS016005: Starting Services for CDI deployment: jbBookWeb.war

              13:27:13,355 ERROR [org.jboss.remoting.remote.connection] (Remoting "frank-pc:MANAGEMENT" read-1) JBREM000200: Remote connection failed: java.io.IOException: An established connection was aborted by the software in your host machine

              13:27:14,948 INFO  [org.jboss.weld.Version] (MSC service thread 1-1) WELD-000900 1.1.5 (AS71)

              13:27:15,447 INFO  [org.jboss.as.jpa] (MSC service thread 1-2) JBAS011402: Starting Persistence Unit Service 'jbBookWeb.war#chapter10PU'

              13:27:18,961 INFO  [org.hibernate.annotations.common.Version] (MSC service thread 1-2) HCANN000001: Hibernate Commons Annotations {4.0.1.Final}

              13:27:19,049 INFO  [org.hibernate.Version] (MSC service thread 1-2) HHH000412: Hibernate Core {4.0.1.Final}

              13:27:19,076 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000206: hibernate.properties not found

              13:27:19,079 INFO  [org.hibernate.cfg.Environment] (MSC service thread 1-2) HHH000021: Bytecode provider name : javassist

              13:27:19,218 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-2) HHH000204: Processing PersistenceUnitInfo [

                  name: chapter10PU

                  ...]

              13:27:20,746 INFO  [org.hibernate.service.jdbc.connections.internal.ConnectionProviderInitiator] (MSC service thread 1-2) HHH000130: Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

              13:27:25,970 INFO  [org.hibernate.dialect.Dialect] (MSC service thread 1-2) HHH000400: Using dialect: org.hibernate.dialect.HSQLDialect

              13:27:26,500 INFO  [org.hibernate.engine.transaction.internal.TransactionFactoryInitiator] (MSC service thread 1-2) HHH000268: Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

              13:27:26,638 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-2) HHH000397: Using ASTQueryTranslatorFactory

              13:27:27,477 INFO  [org.hibernate.validator.util.Version] (MSC service thread 1-2) Hibernate Validator 4.2.0.Final

              13:27:30,205 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) HHH000227: Running hbm2ddl schema export

              13:27:30,250 INFO  [stdout] (MSC service thread 1-2) Hibernate: drop table Book if exists

               

              13:27:30,470 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) HHH000389: Unsuccessful: drop table Book if exists

              13:27:30,471 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) ORA-00933: SQL command not properly ended

               

              13:27:30,472 INFO  [stdout] (MSC service thread 1-2) Hibernate: drop sequence hibernate_sequence

               

              13:27:33,000 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) HHH000389: Unsuccessful: drop sequence hibernate_sequence

              13:27:33,001 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) ORA-02289: sequence does not exist

               

              13:27:33,002 INFO  [stdout] (MSC service thread 1-2) Hibernate: create table Book (id bigint not null, description varchar(2000), illustrations boolean, isbn varchar(255), nbOfPage integer, price float, title varchar(255) not null, primary key (id))

               

              13:27:33,027 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) HHH000389: Unsuccessful: create table Book (id bigint not null, description varchar(2000), illustrations boolean, isbn varchar(255), nbOfPage integer, price float, title varchar(255) not null, primary key (id))

              13:27:33,028 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) ORA-00902: invalid datatype

               

              13:27:33,029 INFO  [stdout] (MSC service thread 1-2) Hibernate: create sequence hibernate_sequence start with 1 increment by 1

               

              13:27:33,636 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-2) HHH000230: Schema export complete

              13:27:34,681 INFO  [org.jboss.weld.deployer] (MSC service thread 1-3) JBAS016008: Starting weld service for deployment jbBookWeb.war

              13:27:45,704 INFO  [javax.enterprise.resource.webcontainer.jsf.config] (MSC service thread 1-4) Initializing Mojarra 2.1.7-jbossorg-1 (20120227-1401) for context '/jbBookWeb'

              13:27:54,575 INFO  [org.jboss.web] (MSC service thread 1-4) JBAS018210: Registering web context: /jbBookWeb

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

              13:27:54,597 INFO  [org.jboss.as] (MSC service thread 1-4) JBAS015874: JBoss AS 7.1.1.Final "Brontes" started in 93142ms - Started 210 of 288 services (76 services are passive or on-demand)

              13:27:54,842 INFO  [org.jboss.as.server] (DeploymentScanner-threads - 2) JBAS018559: Deployed "jbBookWeb.war"

              • 5. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
                Nicklas Karlsson Master

                You have the HSQLDialect defined in your persistence.xml. Is the java:/OraclePool also of the same type? Otherwise you are bound to get SQL errors.

                 

                But yes, the app appears deployed anyway so you would have to check the context root or web.xml to see if the accessed URL is correct. Is this the JBoss 404 you are  getting?

                • 6. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
                  Ryan Li Newbie

                  java:/OraclePool is defined in web console

                  where do I define context root in web.xml? I thought it's done in vendor specific xml, sun-web.xml, in glassfish.

                  but i don't see an equivalent in jboss

                  I managed to load the webapp with the listBook.faces specified in the address.

                  if not, only the context root (localhost:8080/jbBookWeb/), it won't load the file. Could you help me find out the problem?

                  is it the syntax in web.xml is vendor specific?

                   

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

                  <web-app version="2.5"

                           xmlns="http://java.sun.com/xml/ns/javaee"

                           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

                           xsi:schemaLocation="http://java.sun.com/xml/ns/javaee

                           http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">

                   

                      <servlet>

                          <servlet-name>Faces Servlet</servlet-name>

                          <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>

                          <load-on-startup>1</load-on-startup>

                      </servlet>

                      <servlet-mapping>

                          <servlet-name>Faces Servlet</servlet-name>

                          <url-pattern>*.faces</url-pattern>

                      </servlet-mapping>

                      <welcome-file-list>

                          <welcome-file>listBook.faces</welcome-file>

                      </welcome-file-list>

                     

                  </web-app>

                  • 7. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
                    Nicklas Karlsson Master

                    Is the OraclePool working against an Oracle DB (just guessing here)? In that case you need the Oracle dialect in persistence.xml

                     

                    Context roots are vendor extensions and the WAR name is used as default

                     

                    Does http://localhost:8080 bring up the AS7 page

                     

                    Where does http://localhost:8080/jBookWeb/listBook.faces bring you (OK, it's what the context root should give you according to the welcome file). It might be the dialect error that halts the application even if appears deployed.

                    • 8. Re: Error 404 / Could not get database metadata: java.sql.SQLSyntaxErrorException: ORA-00942: table or view does not exist
                      Ryan Li Newbie

                      OraclePool is running. the app is running.

                      I clicked add in Eclipse's server tab to deploy, so I don't know the default context root

                      localhost:8080 does open as7 page.

                      my last problem is to fix the welcome file.

                      I forgot to thank you YOU. thanks everyone help

                      Capture.JPG