6 Replies Latest reply on Feb 27, 2012 3:04 PM by jbalunas

    Error deploying when project name contains "-"

    aamonten

      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  [org.jboss.as.server.deployment] (MSC service thread 1-2) Starting deployment of "html5-test.war"

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

      01:37:42,900 INFO  [org.jboss.as.jpa] (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  [org.jboss.as.jpa] (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  [org.jboss.as.jpa] (MSC service thread 1-2) added org.hibernate dependency to application deployment

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

      01:37:42,917 INFO  [org.jboss.as.ejb3.deployment.processors.EjbJndiBindingsDeploymentUnitProcessor] (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  [org.jboss.weld] (MSC service thread 1-5) Starting Services for CDI deployment: html5-test.war

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

      01:37:42,957 INFO  [org.hibernate.ejb.Ejb3Configuration] (MSC service thread 1-4) HHH00204:Processing PersistenceUnitInfo [

          name: primary

          ...]

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

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

      01:37:42,984 WARN  [org.hibernate.dialect.H2Dialect] (MSC service thread 1-4) HHH00431:Unable to determine H2 database version, certain features may not work

      01:37:42,984 INFO  [org.hibernate.engine.jdbc.internal.LobCreatorBuilder] (MSC service thread 1-4) HHH00423:Disabling contextual LOB creation as JDBC driver reported JDBC version [3] less than 4

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

      01:37:42,985 INFO  [org.hibernate.hql.internal.ast.ASTQueryTranslatorFactory] (MSC service thread 1-4) HHH00397:Using ASTQueryTranslatorFactory

      01:37:43,003 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-4) HHH00227:Running hbm2ddl schema export

      01:37:43,005 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-4) HHH00389:Unsuccessful: drop table Memberhtml5-test if exists

      01:37:43,006 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (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 [42000-145]

      01:37:43,006 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-4) HHH00389:Unsuccessful: drop sequence hibernate_sequence

      01:37:43,007 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-4) Sequence "HIBERNATE_SEQUENCE" no encontrado

      Sequence "HIBERNATE_SEQUENCE" not found; SQL statement:

      drop sequence hibernate_sequence [90036-145]

      01:37:43,007 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (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 [org.hibernate.tool.hbm2ddl.SchemaExport] (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)) [42001-145]

      01:37:43,010 ERROR [org.hibernate.tool.hbm2ddl.SchemaExport] (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) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.tool.hbm2ddl.SchemaExport.execute(SchemaExport.java:365) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:291) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.tool.hbm2ddl.SchemaExport.create(SchemaExport.java:280) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.internal.SessionFactoryImpl.<init>(SessionFactoryImpl.java:440) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1722) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.ejb.EntityManagerFactoryImpl.<init>(EntityManagerFactoryImpl.java:76) [hibernate-entitymanager-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:899) [hibernate-entitymanager-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.ejb.Ejb3Configuration.buildEntityManagerFactory(Ejb3Configuration.java:884) [hibernate-entitymanager-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.ejb.HibernatePersistence.createContainerEntityManagerFactory(HibernatePersistence.java:73) [hibernate-entitymanager-4.0.0.CR2.jar:4.0.0.CR2]

          at org.jboss.as.jpa.service.PersistenceUnitService.createContainerEntityManagerFactory(PersistenceUnitService.java:143) [jboss-as-jpa-7.0.2.Final.jar:7.0.2.Final]

          at org.jboss.as.jpa.service.PersistenceUnitService.start(PersistenceUnitService.java:77) [jboss-as-jpa-7.0.2.Final.jar:7.0.2.Final]

          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) [:1.6.0_29]

          at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [:1.6.0_29]

          at java.lang.Thread.run(Thread.java:662) [:1.6.0_29]

      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') [42102-145]

          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) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          at org.hibernate.tool.hbm2ddl.SchemaExport.importScript(SchemaExport.java:438) [hibernate-core-4.0.0.CR2.jar:4.0.0.CR2]

          ... 16 more

       

      01:37:43,014 INFO  [org.hibernate.tool.hbm2ddl.SchemaExport] (MSC service thread 1-4) HHH00230:Schema export complete

      01:37:43,016 INFO  [org.jboss.weld] (MSC service thread 1-2) Starting weld service

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

      01:37:43,105 INFO  [org.jboss.as.server.controller] (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