1

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

Shubham Khatri
  • 270,417
  • 55
  • 406
  • 400
  • That is very little context you are giving in your question. Be as detailed as possible: at what point are you getting the error, what is the stack trace, configuration settings, version of JBoss, code sample of what you were running when you got the exception.... Anything you can think of that can shed some light on the situation. You can add that information to your question by editing the question (`edit` link underneath your question). – TT. Jan 28 '16 at 09:00

1 Answers1

1

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.