Reputation: 45
I was getting a error
SQLException: Table already exists:
While running my jboss integrated with sterling 9.4.
I wonder where did I go wrong
Upvotes: 1
Views: 148
Reputation: 45
Actually
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.
Upvotes: 1