5 Replies Latest reply on Feb 12, 2010 2:17 PM by guillaumebourgois

    Problem at restart or redeploy with Postgresql

    guillaumebourgois

      Hello,

       

      I use some queues in jboss ESB (with Jboss AS 4.23GA), declared inside the project in a file jbm-queue-service.xml :

       

       

      <mbean code="org.jboss.jms.server.destination.QueueService"
           name="jboss.esb.quickstart.destination:service=Queue,name=my_queue"
           xmbean-dd="xmdesc/Queue-xmbean.xml">
           <depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
           <depends>jboss.messaging:service=PostOffice</depends>
      </mbean>

       

       

      (I also tried in the jboss-messaging.sar/destinations-service.xml file)

       

      It usually work fine but somes times I keep getting the following exception when I redeploy the project or restart JbossAS :

       

      14:24:57,320 ERROR [ExceptionUtil] Queue[null, name=my_queue] startService
      org.postgresql.util.PSQLException: L'indice de la colonne est hors limiteá: 4, nombre de colonnesá: 3.
              at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkColumnIndex(AbstractJdbc2ResultSet.java:2680)
              at org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkResultSet(AbstractJdbc2ResultSet.java:2697)
              at org.postgresql.jdbc2.AbstractJdbc2ResultSet.getObject(AbstractJdbc2ResultSet.java:2528)
              at org.jboss.resource.adapter.jdbc.WrappedResultSet.getObject(WrappedResultSet.java:750)
              at org.jboss.messaging.core.impl.JDBCPersistenceManager.loadFromStart(JDBCPersistenceManager.java:999)
              at org.jboss.messaging.core.impl.PagingChannelSupport.load(PagingChannelSupport.java:211)
              at org.jboss.jms.server.destination.QueueService.startService(QueueService.java:105)
              at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
              at org.jboss.system.ServiceMBeanSupport.start(ServiceMBeanSupport.java:196)
              at sun.reflect.GeneratedMethodAccessor77.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:995)
              at $Proxy0.start(Unknown Source)
              at org.jboss.system.ServiceController.start(ServiceController.java:417)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at org.jboss.system.ServiceController.start(ServiceController.java:435)
              at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              at $Proxy4.start(Unknown Source)
              at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
              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:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              at $Proxy45.start(Unknown Source)
              at org.jboss.deployment.XSLSubDeployer.start(XSLSubDeployer.java:197)
              at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
              at sun.reflect.GeneratedMethodAccessor24.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              at $Proxy9.deploy(Unknown Source)
              at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
              at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
              at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
              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:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
              at $Proxy0.start(Unknown Source)
              at org.jboss.system.ServiceController.start(ServiceController.java:417)
              at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
              at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
              at java.lang.reflect.Method.invoke(Method.java:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              at $Proxy4.start(Unknown Source)
              at org.jboss.deployment.SARDeployer.start(SARDeployer.java:304)
              at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
              at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
              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:592)
              at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
              at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
              at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
              at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
              at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
              at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
              at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
              at $Proxy5.deploy(Unknown Source)
              at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
              at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
              at org.jboss.Main.boot(Main.java:200)
              at org.jboss.Main$1.run(Main.java:508)
              at java.lang.Thread.run(Thread.java:595)

       

       

      The only workaround I can find is to delete the concerned row in the "jbm_postoffice" database table.

       

      I also find a similar problem on this forum : https://community.jboss.org/thread/146487 but the workaround can't be used with PostgreSQL.

       

      Any idea where does that come from ?

       

      Regards,

      Guillaume

        • 1. Re: Problem at restart or redeploy with Postgresql
          gaohoward

          org.postgresql.util.PSQLException: L'indice de la colonne est hors limiteá: 4, nombre de colonnesá: 3.

           

          I can't understand the above message. Judging from the line number of JDBCPersistenceManager, the table concerned is JBM_MSG_REF. It doesn't seem to have anything to do with jbm_postoffice.

           

          Howard

          1 of 1 people found this helpful
          • 2. Re: Problem at restart or redeploy with Postgresql
            guillaumebourgois

            Sorry, I forgot to translate that...

             

            org.postgresql.util.PSQLException: The column index is out of range: 4, number of columns: 3

             

            My JBM_MSG_REF table have 8 columns and all the rows looks like

             

            message_idchannel_idtransaction_idstate
            ordpage_ord
            delivery_count
            sched_delivery
            5184808962719747400"C"5184808962818051
            00

             

             

            But in JDBCPersistenceManager.java (jboss messaging 1.4.5.GA) we can find thoses instructions :

             

            ps = conn.prepareStatement(getSQLStatement("LOAD_UNPAGED_REFS"));
            ps.setFetchSize(number);

            ps.setLong(1, channelID);

            rs = ps.executeQuery();

            List<ReferenceInfo> refs = new ArrayList<ReferenceInfo>();

            List<ReferenceInfo> refsToUpdate = new ArrayList<ReferenceInfo>();

            int count = 0;

            boolean inMemSwitch = false;

            boolean nonPageFlag = true;

             

            while (rs.next())
            {
            rs.getObject(4); //Line 999 -> Raise exception

             

            [...]

             

            map.put("LOAD_UNPAGED_REFS","SELECT MESSAGE_ID, DELIVERY_COUNT, SCHED_DELIVERY, PAGE_ORD FROM JBM_MSG_REF WHERE STATE = 'C' " + "AND CHANNEL_ID = ? ORDER BY ORD");

             

             

            So that request is called, return 4 columns (indexes 0,1,2,3), then a useless instruction "rs.getObject(4);" try to get an object in an inexistant fourth column.

             

            Am I right ?

             

             

             

             

             


            • 3. Re: Problem at restart or redeploy with Postgresql
              gaohoward

              Thanks for the translation.

               

              The column index in the rs.getObject() starts at 1. So this should not be a problem.

               

              Howard

              1 of 1 people found this helpful
              • 4. Re: Problem at restart or redeploy with Postgresql
                guillaumebourgois

                Ok, my mistake,  thanks for you response.

                 

                As the fourth column contains no value in my database, I try to put somes in there and, after fews redeployement and exceptions, discover that I have to increment the value from 1 for each different channel, like

                 

                 

                message_idchannel_idpage_ord
                51847852604129304001
                51848089627197474002
                51848090404782124003
                51850653554770014701
                51850667707924584702

                 

                 

                So what's wrong ? Should I have those increments, or is the getObject() method doesn't like the empty PostgreSQL value ?

                 

                In any case, the call "rs.getObject(4);" is useless, isn't it ?

                • 5. Re: Problem at restart or redeploy with Postgresql
                  guillaumebourgois

                  org.postgresql.jdbc2.AbstractJdbc2ResultSet.checkColumnIndex :

                   

                  protected void checkColumnIndex(int column) throws SQLException
                  {
                       if ( column < 1 || column > fields.length )
                            throw new PSQLException(GT.tr("The column index is out of range: {0}, number of columns: {1}.", new Object[]{new Integer(column), new                Integer(fields.length)}), PSQLState.INVALID_PARAMETER_VALUE );
                  }

                   

                  So for the PostgreSQL resultset there is only 3 columns if I page_ord have no values, but seems ok if I put values in it, I'm kind of lost here...

                   

                  Just to see if that was type depent I tried to change page_ord to integer, then to character varying but I got the same exception with null values.

                   

                  I also set null values in the delivery_count column but I still have the same exception with a resultset length of 3 instead of 4...

                   

                  Any ideas ?