6 Replies Latest reply: Feb 27, 2012 3:04 PM by Jay Balunas RSS

    Error deploying when project name contains "-"

    Alejandro Montenegro Novice

      Hi I created a project with command line named html5-test by executing

       

       

      mvn archetype:generate -DarchetypeArtifactId=jboss-html5-mobile-archetype -DarchetypeGroupId=org.jboss.aerogear.archetypes -DarchetypeVersion=1.0.0.M1

       

      When trying to deploy to as7 (both 7.1.cr1 and 7.0.2FINAL) it seems like there is an issue with the table name, this is the error:

       

      01:37:42,830 INFO  (MSC service thread 1-2) Starting deployment of "html5-test.war"

      01:37:42,898 INFO  (MSC service thread 1-2) read persistence.xml for primary

      01:37:42,900 INFO  (MSC service thread 1-2) added javax.persistence.api, javaee.api, org.jboss.as.jpa, org.javassist dependencies to html5-test.war

      01:37:42,900 INFO  (MSC service thread 1-2) added (default provider) org.hibernate dependency to application deployment (since 1 PU(s) didn't specify jboss.as.jpa.providerModule)

      01:37:42,901 INFO  (MSC service thread 1-2) added org.hibernate dependency to application deployment

      01:37:42,916 INFO  (MSC service thread 1-2) Processing CDI deployment: html5-test.war

      01:37:42,917 INFO  (MSC service thread 1-2) JNDI bindings for session bean named MemberService in deployment unit deployment "html5-test.war" are as follows:

       

          java:global/html5-test/MemberService!com.hp.aerogear.rest.MemberService

          java:app/html5-test/MemberService!com.hp.aerogear.rest.MemberService

          java:module/MemberService!com.hp.aerogear.rest.MemberService

          java:global/html5-test/MemberService

          java:app/html5-test/MemberService

          java:module/MemberService

       

      01:37:42,947 INFO  (MSC service thread 1-5) Starting Services for CDI deployment: html5-test.war

      01:37:42,956 INFO  (MSC service thread 1-4) starting Persistence Unit Service 'html5-test.war#primary'

      01:37:42,957 INFO  (MSC service thread 1-4) HHH00204:Processing PersistenceUnitInfo [

          name: primary

          ...]

      01:37:42,979 INFO  (MSC service thread 1-4) HHH00130:Instantiating explicit connection provider: org.hibernate.ejb.connection.InjectedDataSourceConnectionProvider

      01:37:42,984 INFO  (MSC service thread 1-4) HHH00400:Using dialect: org.hibernate.dialect.H2Dialect

      01:37:42,984 WARN  (MSC service thread 1-4) HHH00431:Unable to determine H2 database version, certain features may not work

      01:37:42,984 INFO  (MSC service thread 1-4) HHH00423:Disabling contextual LOB creation as JDBC driver reported JDBC version less than 4

      01:37:42,985 INFO  (MSC service thread 1-4) HHH00268:Transaction strategy: org.hibernate.engine.transaction.internal.jta.CMTTransactionFactory

      01:37:42,985 INFO  (MSC service thread 1-4) HHH00397:Using ASTQueryTranslatorFactory

      01:37:43,003 INFO  (MSC service thread 1-4) HHH00227:Running hbm2ddl schema export

      01:37:43,005 ERROR (MSC service thread 1-4) HHH00389:Unsuccessful: drop table Memberhtml5-test if exists

      01:37:43,006 ERROR (MSC service thread 1-4) Error de Sintaxis en sentencia SQL "DROP TABLE MEMBERHTML5-[*]TEST IF EXISTS "

      Syntax error in SQL statement "DROP TABLE MEMBERHTML5-[*]TEST IF EXISTS "; SQL statement:

      drop table Memberhtml5-test if exists

      01:37:43,006 ERROR (MSC service thread 1-4) HHH00389:Unsuccessful: drop sequence hibernate_sequence

      01:37:43,007 ERROR (MSC service thread 1-4) Sequence "HIBERNATE_SEQUENCE" no encontrado

      Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:

      drop sequence hibernate_sequence

      01:37:43,007 ERROR (MSC service thread 1-4) HHH00389:Unsuccessful: create table Memberhtml5-test (id bigint not null, email varchar(255) not null, name varchar(25) not null, phone_number varchar(12) not null, primary key (id), unique (email))

      01:37:43,007 ERROR (MSC service thread 1-4) Error de Sintaxis en sentencia SQL "CREATE TABLE MEMBERHTML5-[*]TEST (ID BIGINT NOT NULL, EMAIL VARCHAR(255) NOT NULL, NAME VARCHAR(25) NOT NULL, PHONE_NUMBER VARCHAR(12) NOT NULL, PRIMARY KEY (ID), UNIQUE (EMAIL)) "; se esperaba "("

      Syntax error in SQL statement "CREATE TABLE MEMBERHTML5-[*]TEST (ID BIGINT NOT NULL, EMAIL VARCHAR(255) NOT NULL, NAME VARCHAR(25) NOT NULL, PHONE_NUMBER VARCHAR(12) NOT NULL, PRIMARY KEY (ID), UNIQUE (EMAIL)) "; expected "("; SQL statement:

      create table Memberhtml5-test (id bigint not null, email varchar(255) not null, name varchar(25) not null, phone_number varchar(12) not null, primary key (id), unique (email))

      01:37:43,010 ERROR (MSC service thread 1-4) HHH00231:Schema export unsuccessful: org.hibernate.tool.hbm2ddl.ImportScriptException: Error during import script execution at line 2

          at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:443)

          at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:365)

          at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:291)

          at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:280)

          at org.hibernate.internal.SessionFactoryImpl.(SessionFactoryImpl.java:440)

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1722)

          at org.hibernate.ejb.EntityManagerFactoryImpl.(EntityManagerFactoryImpl.java:76)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899)

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:884)

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73)

          at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:143)

          at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:77)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:1824)

          at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1759)

          at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)

          at java.lang.Thread.run(Thread.java:662)

      Caused by: org.h2.jdbc.JdbcSQLException: Tabla "MEMBERHTML5" no encontrada

      Table "MEMBERHTML5" not found; SQL statement:

      insert into Memberhtml5-test (id, name, email, phone_number) values (0, 'John Smith', 'john.smith@mailinator.com', '2125551212')

          at org.h2.message.DbException.getJdbcSQLException(DbException.java:327)

          at org.h2.message.DbException.get(DbException.java:167)

          at org.h2.message.DbException.get(DbException.java:144)

          at org.h2.command.Parser.readTableOrView(Parser.java:4514)

          at org.h2.command.Parser.readTableOrView(Parser.java:4492)

          at org.h2.command.Parser.parseInsert(Parser.java:913)

          at org.h2.command.Parser.parsePrepared(Parser.java:361)

          at org.h2.command.Parser.parse(Parser.java:274)

          at org.h2.command.Parser.parse(Parser.java:246)

          at org.h2.command.Parser.prepare(Parser.java:200)

          at org.h2.command.Parser.prepareCommand(Parser.java:213)

          at org.h2.engine.Session.prepareLocal(Session.java:423)

          at org.h2.engine.Session.prepareCommand(Session.java:373)

          at org.h2.jdbc.JdbcConnection.prepareCommand(JdbcConnection.java:1056)

          at org.h2.jdbc.JdbcStatement.executeUpdateInternal(JdbcStatement.java:122)

          at org.h2.jdbc.JdbcStatement.executeUpdate(JdbcStatement.java:111)

          at org.jboss.jca.adapters.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:349)

          at org.hibernate.tool.hbm2ddl.DatabaseExporter.export(DatabaseExporter.java:64)

          at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:438)

          ... 16 more

       

      01:37:43,014 INFO  (MSC service thread 1-4) HHH00230:Schema export complete

      01:37:43,016 INFO  (MSC service thread 1-2) Starting weld service

      01:37:43,088 INFO  (MSC service thread 1-3) registering web context: /html5-test

      01:37:43,105 INFO  (DeploymentScanner-threads - 1) Deployed "html5-test.war"

       

       

      Not sure if this is directly related to aerogear so I decided not to open an issue on jira yet.

       

      thanks

      Alejandro