1 Reply Latest reply on Apr 21, 2006 4:54 PM by timfox

    Problems with JMS table creation: SQLExceptions

    anshah1

      Hi,

      I had things working till about last night. where I was trying to send a simple text message to a queue. I see something of the sort

      13:02:16,648 INFO [Queue] Queue[/queue/NCBIQueue] started, fullSize=75000, pageSize=2000, downCacheSize=1000


      in my server output and I am sure that the queue is available. Also I find that my message driven bean has been deployed correctly. But I never found a line that says that the server has started in so many seconds..

      When I looked deep into my server.log file I figured that there are innumerable SQL exceptions being caused of the form

      2006-04-21 13:02:15,539 DEBUG [org.jboss.jms.server.plugin.JDBCChannelMapper] Failed to create users table: CREATE TABLE JMS_USER (USERID VARCHAR(32) NOT NULL, PASSWD VARCHAR(32) NOT NULL, CLIENTID VARCHAR(128), PRIMARY KEY(USERID))
      java.sql.SQLException: Table already exists: JMS_USER in statement [CREATE TABLE JMS_USER]
      
      java.sql.SQLException: Table already exists: JMS_ROLE in statement [CREATE TABLE JMS_ROLE]
      



      and so on. None of my configuration files have changed from before. here's my messaging service.xml file that defines the queue.

      <?xml version="1.0" encoding="UTF-8"?>
       <server>
       <loader-repository>jboss.messaging:loader=ScopedLoaderRepository
       <loader-repository-config>java2ParentDelagation=false</loader-repository-config>
       </loader-repository>
       <mbean code="org.jboss.jms.server.destination.Queue"
       name="jboss.messaging.destination:service=Queue,name=NCBIQueue"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends
       optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       </mbean>
       <mbean code="org.jboss.jms.server.destination.Queue"
       name="jboss.messaging.destination:service=Queue,name=myQueue"
       xmbean-dd="xmdesc/Queue-xmbean.xml">
       <depends
       optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
       </mbean>
       </server>
      


      i can post my application jboss file but it's huge and since I get a line saying

      Deployed: file:/C:/jboss-4.0.3SP1/server/messaging/tmp/deploy/tmp58411brm.ear-contents/brm-server.jar


      I assume that should have deployed just fine and also my application works just fine except the messaging part.

      My MDB does not receive the message at all. Of course there's a problem with this since the message tables are not created correctly.

      Any clue as to how to solve this problem?

      Thanks,
      Anuj


        • 1. Re: Problems with JMS table creation: SQLExceptions
          timfox

          Anuj-

          This is to be expected.

          If you have createTablesOnStartup (see getting started guide) set to true then the server will always attempt to create the tables on startup.

          If the tables already exist you will then get a SQLException which will logged at log level of debug and it will continue.

          Actually, exactly the same behaviour is exhibited by JBossMQ. If you don't want to create the tables on startup, set createTablesOnStartup to false, or set the log level of log4j to info or above and you won't see the stack traces ion the logs. They are harmless anyway.