9 Replies Latest reply on May 14, 2013 6:11 PM by Karim Baïna

    Cannot create timer table

    praveen Newbie

      During start up of JBoss application server with JBoss messaging, I do see the following exception. I would like to understand what is this error and how to fix it. Please help.

      main 2007-04-30 17:23:29,591 ERROR [org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.createTableIfNotExists:155] Cannot create timer table
      java.lang.IllegalStateException: Cannot obtain type mapping from: jboss.jdbc:datasource=DefaultDS,service=metadata
      at org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.createTableIfNotExists(GeneralPurposeDatabasePersistencePlugin.java:117)
      at org.jboss.ejb.txtimer.DatabasePersistencePolicy.startService(DatabasePersistencePolicy.java:106)
      at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
      at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
      ......................................

        • 1. Re: Cannot create timer table
          mskonda Apprentice

          The ejb is accessing the timerservice for which it requires (if you turn it on) to persit the timers in database.

          Did you have DefaultDS configured properly so it can create the table-if-not-exists?

          I would first check the DefaultDS datasoruce config, then check the user if he has permission to create a table.

          Madhu

          • 2. Re: Cannot create timer table
            praveen Newbie

            Thanks for the information...
            DefaultDS datasource is configured correctly, in fact, it created rest of the Messaging tables during start up, except this one. Since we are not using any EJBs I think I can turn off this table creation.

            • 3. Re: Cannot create timer table
              mskonda Apprentice

              u know how to turn it off, dont' u?

              • 4. Re: Cannot create timer table
                praveen Newbie

                I tried but I couldn't figure out how to turn it off, can you please provide some guidance?

                -APK

                • 5. Re: Cannot create timer table
                  mskonda Apprentice

                  Check the deploy/ejb-deployer.xml.
                  You may have to comment
                  org.jboss.ejb.txtimer.DatabasePersistencePolicy mbean block and enable org.jboss.ejb.txtimer.NoopPersistencePolicy block (which is curretnly closed).

                  Thant should do the trick

                  • 6. Re: Cannot create timer table
                    Peter Johnson Master

                    Check the *-ds.xml file for DefaultDS and make sure that you have a metadata entry, such as:

                    <metadata>
                     <type-mapping>Type of database</type-mapping>
                    </metadata>


                    where "Type of database" is the name of one of the type mappings in server/xxx/conf/standardjbosscmp-jdbc.xml.

                    When you do that, the metadata MBean gets created.

                    • 7. Re: Cannot create timer table
                      praveen Newbie

                      It worked in both cases:

                      1. As Madhu wrote, commenting out the org.jboss.ejb.txtimer.DatabasePersistencePolicy did work.

                      2. As Peter wrote, I gave the Oracle9i database type it worked. However, in my case our database is Oracle10g and there is no entry for Oracle10g in server/xxx/conf/standardjbosscmp-jdbc.xml. I tested with giving Oracle9i in my oracle-ds.xml. But I am bit scared of giving incorrect mapping. I am not sure if JBoss released with Oracle10g mapping yet.

                      -APK.

                      • 8. Re: Cannot create timer table
                        Tim Fox Master

                        You should post this on the JCA forum.

                        Datasource configuration is handled by the JCA layer, not by JBoss Messaging.

                        • 9. Re: Cannot create timer table
                          Karim Baïna Newbie

                          I am using JBOSS 5.1 with Postgres 9.1

                           

                          In my -ds.xml I put "normally"

                          JBOSS <type-mapping>PostgreSQL 9.1</type-mapping>

                           

                          this caused :

                          ERROR [org.jboss.ejb.txtimer.GeneralPurposeDatabasePersistencePlugin.createTableIfNotExists:155] Cannot create timer table

                          java.lang.IllegalStateException: Cannot obtain type mapping from: jboss.jdbc:datasource=DefaultDS,service=metadata

                           

                          I changed to JBOSS <type-mapping>PostgreSQL 8.0</type-mapping>

                           

                          and the reoor diappeared.

                           

                          So Peter Johnson was right.

                           

                          Best