Version 7

    Often people see DEBUG level messages at startup that include a SQLException stack trace similar to the following.

     

    • JBossMQ*

     

    2007-11-08 17:13:50,839 DEBUG [org.jboss.mq.pm.jdbc2.PersistenceManager] 
       Could not create table with SQL: CREATE CACHED TABLE JMS_MESSAGES ( MESSAGEID INTEGER NOT NULL, 
       DESTINATION VARCHAR(255) NOT NULL, TXID INTEGER, TXOP CHAR(1), MESSAGEBLOB OBJECT, 
       PRIMARY KEY (MESSAGEID, DESTINATION) )
    java.sql.SQLException: Table already exists: JMS_MESSAGES in statement [CREATE CACHED TABLE JMS_MESSAGES]
    at org.hsqldb.jdbc.Util.throwError(Unknown Source)
    at org.hsqldb.jdbc.jdbcPreparedStatement.executeUpdate(Unknown Source)
    at org.jboss.resource.adapter.jdbc.CachedPreparedStatement.executeUpdate(CachedPreparedStatement.java:95)
    at org.jboss.resource.adapter.jdbc.WrappedPreparedStatement.executeUpdate(WrappedPreparedStatement.java:251)
    at org.jboss.mq.pm.jdbc2.PersistenceManager.createSchema(PersistenceManager.java:280)
    at org.jboss.mq.pm.jdbc2.PersistenceManager.startService(PersistenceManager.java:1796)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
    at sun.reflect.GeneratedMethodAccessor3.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585)
    at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
    at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
    

     

    JBoss Messaging (JBM)

     

    2007-04-27 12:29:18,589 DEBUG [org.jboss.messaging.core.plugin.JDBCSupport] 
       Failed to execute: CREATE TABLE JBM_MSG_REF (CHANNEL_ID BIGINT, MESSAGE_ID BIGINT, 
       TRANSACTION_ID BIGINT, STATE CHAR(1), ORD BIGINT, PAGE_ORD BIGINT, DELIVERY_COUNT INTEGER, 
       SCHED_DELIVERY BIGINT, PRIMARY KEY(CHANNEL_ID, MESSAGE_ID))
    java.sql.SQLException: Table already exists: JBM_MSG_REF in statement [CREATE TABLE JBM_MSG_REF]
    at org.hsqldb.jdbc.Util.sqlException(Unknown Source)
    at org.hsqldb.jdbc.jdbcStatement.fetchResult(Unknown Source)
    at org.hsqldb.jdbc.jdbcStatement.executeUpdate(Unknown Source)
    at org.jboss.resource.adapter.jdbc.WrappedStatement.executeUpdate(WrappedStatement.java:186)
    at org.jboss.messaging.core.plugin.JDBCSupport.createSchema(JDBCSupport.java:230)
    at org.jboss.messaging.core.plugin.JDBCSupport.start(JDBCSupport.java:156)
    at org.jboss.messaging.core.plugin.JDBCPersistenceManager.start(JDBCPersistenceManager.java:123)
    at org.jboss.messaging.core.plugin.JDBCPersistenceManagerService.startService(JDBCPersistenceManagerService.java:88)
    at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
    at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:585) 
    

     

    These messages sometimes causes concern for users.  However, most of the time, this message is normal and expected (hence, the DEBUG logging level instead of, say, ERROR or WARN.)

     

    By default, the server attempts to create the tables that support message persistence.  If the tables already exist, a java.sql.SQLException will be thrown.  This normally indicates that the tables already exist and do not need to be created.  Of course, if the tables do not already exist they will be created, and administrators are not required to create the tables required by JMS as a separate task.

     

    While the stack trace is usually the feature of the log message that causes concern, it is needed in the DEBUG message.  There is no standard SQL exception or message thrown for a "table already exists" type of failure.  This means that there is not a general way to report the exception only when the failure is caused by some other problem.  Thus, the stack trace is included to facilitate debugging when there is some other failure when creating the tables.

     

    The automatic creation of the tables can be disabled. Of course, with the feature disabled, the tables must have been created before the Application Server starts for the JMS system to work properly. 

     

    • JBossMQ*

     

    For JBossMQ, the feature is disabled in the $SERVER_CONFIG_DIR/deploy/jms/-jdbc2-service.xml file (e.g., default/deploy/jms/hsqldb-jdbc2-service.xml.)  The line "CREATE_TABLES_ON_STARTUP = TRUE enables the automatic creation of tables.  Setting the value to FALSE will disable the creation of tables. 

     

    JBoss Messaging

     

    For JBoss Messaging, the feature is disabled with the CreateTablesOnStartup attribute in the $SERVER_CONFIG_DIR/deploy/jboss-messaging.sar/-persistence-service.xml configuration file (e.g., messaging/deploy/jboss-messaging.sar/hsqldb-persistence-service.xml.)  By default, this attribute is set to true.  To disable the creation of tables at startup, set the value to false.