2 Replies Latest reply on Sep 7, 2006 1:44 PM by suzie sirena

    Deployment Exception Error while creating table  : Unexpecte

    suzie sirena Newbie

      Hi everybody,

      I'm absolutely newbie on JBoss and I'm searching hard in all forums, mailling archives, newsletter, etc..... to understand what is wrong with my deployement.

      I'm now tired of searching and I ask for your help :

      I try to install Tambur Message Gateway (http://www.tambur.org/)

      I put a "Tambur" directory in /usr/local/jboss4/server/default/deploy with the following structure :

      tambur-ds.xml
      tambur.ear
      lib/commons-httpclient-2.0.jar
      lib/tambur-mmslib.jar
      lib/tambur-wbxml.jar
      lib/jakarta-regexp-1.2.jar
      lib/jdom.jar
      lib/tl-netty2-1.6.1.jar

      I put a "rowset.jar" file into server/default/lib directory
      and a "tambur.properties" file into the server/default/conf

      I tell you about this because I followed Tambur installation notes but I d'ont know the purpose of all this files.

      So !

      When I launch Jboss, I have these errors :


      2006-09-07 13:33:11,434 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Service] Executing SQL: CREATE TABLE BILLINGSERVICE (id INTEGER NOT NULL, account INTEGER NOT NULL, weight INTEGER NOT NULL, type INTEGER NOT NULL, enabled TINYINT, validFrom BIGINT NOT NULL, validTo BIGINT NOT NULL, ident VARCHAR(250) BINARY, descr VARCHAR(64), shortnumber VARCHAR(16), operator VARCHAR(16), transCost DOUBLE NOT NULL, transRevenue DOUBLE NOT NULL, monthlyCost DOUBLE NOT NULL, CONSTRAINT PK_BILLINGSERVICE PRIMARY KEY (id))
      2006-09-07 13:33:11,434 DEBUG [org.jboss.ejb.plugins.cmp.jdbc.JDBCStartCommand.Service] Could not create table BILLINGSERVICE
      2006-09-07 13:33:11,434 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.parentTraceEnabled=true
      2006-09-07 13:33:11,434 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.nestedTraceEnabled=false
      2006-09-07 13:33:11,434 DEBUG [org.jboss.util.NestedThrowable] org.jboss.util.NestedThrowable.detectDuplicateNesting=true
      2006-09-07 13:33:11,444 DEBUG [org.jboss.ejb.EjbModule] Starting failed jboss.j2ee:service=EjbModule,module=tambur-billing.jar
      org.jboss.deployment.DeploymentException: Error while creating table BILLINGSERVICE; - nested throwable: (java.sql.SQLException: Unexpected token: BINARY in statement [CREATE TABLE BILLINGSERVICE (id INTEGER NOT NULL, account INTEGER NOT NULL, weight INTEGER NOT NULL, type INTEGER NOT NULL, enabled TINYINT, validFrom BIGINT NOT NULL, validTo BIGINT NOT NULL, ident VARCHAR(250) BINARY])


      A lot of peopple have this error : Unexpected token: BINARY in statement but I don't find how to fix it.

      My tambur-ds.xml is :

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
      <!-- Use MySQL database on localhost
      <local-tx-datasource>
      <jndi-name>TamburDS</jndi-name>
      <connection-url>jdbc:mysql://localhost:3306/tambur</connection-url>
      <driver-class>org.gjt.mm.mysql.Driver</driver-class>
      <user-name>tambur</user-name>
      <password></password>
      <min-pool-size>5</min-pool-size>
      </local-tx-datasource>
      -->

      <!-- HQSLDB -->
      <local-tx-datasource>
      <jndi-name>TamburDS</jndi-name>
      <connection-url>jdbc:hsqldb:${jboss.server.data.dir}${/}hypersonic${/}TamburDB</connection-url>
      <driver-class>org.hsqldb.jdbcDriver</driver-class>
      <user-name>sa</user-name>
      <password></password>
      <min-pool-size>5</min-pool-size>
      <max-pool-size>20</max-pool-size>
      <idle-timeout-minutes>0</idle-timeout-minutes>
      <track-statements/>
      <metadata>
      <type-mapping>Hypersonic SQL</type-mapping>
      </metadata>
      <depends>jboss:service=Hypersonic,database=localDB</depends>
      </local-tx-datasource>

      <mbean code="org.jboss.jdbc.HypersonicDatabase"
      name="jboss:service=Hypersonic,database=TamburDB">
      <attribute name="Database">TamburDB</attribute>
      <attribute name="InProcessMode">true</attribute>
      </mbean>

      </datasources>

      and I found a file "build/billing/META-INF/jbosscmp-jdbc.xml" in source like as follow but nothing about binary Type :

      <?xml version="1.0" encoding="UTF-8"?>
      <!DOCTYPE jbosscmp-jdbc PUBLIC "-//JBoss//DTD JBOSSCMP-JDBC 3.2//EN" "http://www.jboss.org/j2ee/dtd/jbosscmp-jdbc_3_2.dtd">

      <jbosscmp-jdbc>
      <defaults>
      <datasource>java:/TamburDS</datasource>
      <datasource-mapping>mySQL</datasource-mapping>
      <create-table>true</create-table>
      <alter-table>false</alter-table>
      </defaults>

      <enterprise-beans>

      <!--
      To add beans that you have deployment descriptor info for, add
      a file to your XDoclet merge directory called jbosscmp-jdbc-beans.xml
      that contains the <entity></entity> markup for those beans.
      -->

      <entity>
      <ejb-name>Summary</ejb-name>

      <table-name>billingsummary</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>dateTime</field-name>
      <column-name>datetime</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>sid</field-name>
      <column-name>sid</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>account</field-name>
      <column-name>account</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>count</field-name>
      <column-name>count</column-name>

      </cmp-field>

      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->
      </entity>

      <entity>
      <ejb-name>Service</ejb-name>

      <table-name>billingservice</table-name>

      <cmp-field>
      <field-name>id</field-name>
      <column-name>id</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>account</field-name>
      <column-name>account</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>weight</field-name>
      <column-name>weight</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>type</field-name>
      <column-name>type</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>enabled</field-name>
      <column-name>enabled</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>validFrom</field-name>
      <column-name>validFrom</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>validTo</field-name>
      <column-name>validTo</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>ident</field-name>
      <column-name>ident</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>descr</field-name>
      <column-name>descr</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(64)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>shortNumber</field-name>
      <column-name>shortnumber</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(16)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>operator</field-name>
      <column-name>operator</column-name>

      <jdbc-type>VARCHAR</jdbc-type>
      <sql-type>VARCHAR(16)</sql-type>

      </cmp-field>
      <cmp-field>
      <field-name>transCost</field-name>
      <column-name>transCost</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>transRevenue</field-name>
      <column-name>transRevenue</column-name>

      </cmp-field>
      <cmp-field>
      <field-name>monthlyCost</field-name>
      <column-name>monthlyCost</column-name>

      </cmp-field>

      <query>
      <query-method>
      <method-name>findAllOrderWeight</method-name>
      <method-params>
      </method-params>
      </query-method>
      <jboss-ql>[CDATA[SELECT OBJECT(s) FROM Service s ORDER BY s.weight DESC]]</jboss-ql>

      </query>
      <query>
      <query-method>
      <method-name>findByAccount</method-name>
      <method-params>
      <method-param>java.lang.Integer</method-param>
      </method-params>
      </query-method>
      <jboss-ql>[CDATA[SELECT OBJECT(s) FROM Service s WHERE s.account = ?1 ORDER BY s.weight DESC]]</jboss-ql>

      </query>

      <!-- jboss 3.2 features -->
      <!-- optimistic locking does not express the exclusions needed -->
      </entity>

      </enterprise-beans>

      </jbosscmp-jdbc>


      I hope I put all in this file so you can fix my problem...
      Big thanks to the one who can help me !

        • 1. Re: Deployment Exception Error while creating table  : Unexp
          Alex Pinkin Newbie

          Your datasource is configured to run against hsqldb that ships with jboss. However, jboss CMP descriptor file refers to mysql, so CREATE TABLE statement is generated using mysql dialect (VARCHAR(250) BINARY)

          Try removing <datasource-mapping> from the jbosscmp-jdbc.xml. Your other option is to switch to mysql.

          • 2. Re: Deployment Exception Error while creating table  : Unexp
            suzie sirena Newbie

            Thanks Alex,

            This fix one error in the log file but an other one appear :


            13:22:57,728 WARN [ServiceController] Problem starting service jboss.j2ee:service=EjbModule,module=tambur-billing.jar
            org.jboss.deployment.DeploymentException: Error while creating table BILLINGSUMMARY; - nested throwable: (java.sql.SQLException: Unexpected token: COUNT in statement [CREATE TABLE BILLINGSUMMARY (id INTEGER NOT NULL, datetime BIGINT NOT NULL, sid INTEGER NOT NULL, account INTEGER NOT NULL, count])


            I think you will see the problem in less than a second....

            P.S. : instead of removing <datasource-mapping>Mysql</datasource-mapping>
            I put : <datasource-mapping>Hypersonic SQL</datasource-mapping>
            I hopre it doesn't matter with the "Unexpected token: COUNT" error