This discussion is archived
5 Replies Latest reply: May 3, 2013 6:00 PM by ak RSS

Broker Throws NPE and Dies on Startup

878909 Newbie
Currently Being Moderated
Hi there,

First of all thank you for your attention.

Environment:
- Operating System > RHEL 5.3
- Message Queue > Sun Glassfish Message Queue 4.4
- Database engine > Microsoft SQL server 2008 R2
- JDBC Driver > SQL JDBC 3.0 (sqljdbc4.jar)

Goal:
Setup enhanced broker cluster with persistent storage

Problems:
First of all, I would like to mention that I was able to run this set up properly with MySQL (obviously the settings in the config.properties have been changed accordingly)

Now my problem with Microsoft SQL is that I can't start my broker, it just doesn't run...

Message Queue set up description:
1. Created database called mqdb and checked that my user has enough privilege to create tables...
2. I have followed the official documentation for setting up an enhanced broker cluster and I have edited the config.properties file as shown below:



-------------

imq.hostname=192.168.xx.xx
imq.portmapper.port=7676
imq.brokerid=broker1
#
imq.cluster.ha=true
imq.cluster.clusterid=mqCluster
#
imq.persist.store=jdbc
imq.persist.jdbc.dbVendor=mssql
imq.persist.jdbc.mssql.user=databaseUser
imq.persist.jdbc.mssql.password=userPassword
imq.persist.jdbc.mssql.property.url=jdbc\:sqlserver\://devvm1\:1433;databaseName=mqdb
imq.persist.jdbc.mssql.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
imq.persist.jdbc.opendburl=jdbc\:sqlserver\://devvm1\:1433;databaseName=mqdb
#
imq.cluster.heartbeat.interval=2
imq.cluster.heartbeat.threshold=2
imq.cluster.monitor.interval=5
imq.cluster.monitor.threshold=1

# Properties to define the tables used by the broker. Do not modify the schema.

# Version Table
imq.persist.jdbc.mssql.table.MQVER41=\
CREATE TABLE ${name} (\
STORE_VERSION INTEGER NOT NULL,\
LOCK_ID VARCHAR(100),\
PRIMARY KEY(STORE_VERSION))

# Configuration change record table
imq.persist.jdbc.mssql.table.MQCREC41=\
CREATE TABLE ${name} (\
RECORD VARBINARY(1024) NOT NULL,\
CREATED_TS BIGINT NOT NULL)

# Broker table
imq.persist.jdbc.mssql.table.MQBKR41=\
CREATE TABLE ${name} (\
ID VARCHAR(100) NOT NULL,\
URL VARCHAR(100) NOT NULL,\
VERSION INT NOT NULL,\
STATE INT NOT NULL,\
TAKEOVER_BROKER VARCHAR(100),\
HEARTBEAT_TS BIGINT,\
PRIMARY KEY(ID))

# Store session table
imq.persist.jdbc.mssql.table.MQSES41=\
CREATE TABLE ${name} (\
ID BIGINT NOT NULL,\
BROKER_ID VARCHAR(100) NOT NULL,\
IS_CURRENT INT NOT NULL,\
CREATED_BY VARCHAR(100) NOT NULL,\
CREATED_TS BIGINT NOT NULL,\
PRIMARY KEY(ID))

imq.persist.jdbc.mssql.table.MQSES41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (\
BROKER_ID)

# Destination table
imq.persist.jdbc.mssql.table.MQDST41=\
CREATE TABLE ${name} (\
ID VARCHAR(100) NOT NULL,\
DESTINATION VARBINARY(1024) NOT NULL,\
IS_LOCAL INT NOT NULL,\
CONNECTION_ID BIGINT,\
CONNECTED_TS BIGINT,\
STORE_SESSION_ID BIGINT,\
CREATED_TS BIGINT NOT NULL,\
PRIMARY KEY(ID))

imq.persist.jdbc.mssql.table.MQDST41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (\
STORE_SESSION_ID)

# Interest (consumer) table
imq.persist.jdbc.mssql.table.MQCON41=\
CREATE TABLE ${name} (\
ID BIGINT NOT NULL,\
CLIENT_ID VARCHAR(1024),\
DURABLE_NAME VARCHAR(1024),\
CONSUMER VARBINARY(1024) NOT NULL,\
CREATED_TS BIGINT NOT NULL,\
PRIMARY KEY(ID))

# Interest list (consumer state) table
imq.persist.jdbc.mssql.table.MQCONSTATE41=\
CREATE TABLE ${name} (\
MESSAGE_ID VARCHAR(100) NOT NULL,\
CONSUMER_ID BIGINT NOT NULL,\
STATE INT,\
TRANSACTION_ID BIGINT,\
CREATED_TS BIGINT NOT NULL,\
PRIMARY KEY(MESSAGE_ID, CONSUMER_ID))

imq.persist.jdbc.mssql.table.MQCONSTATE41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (\
TRANSACTION_ID)

imq.persist.jdbc.mssql.table.MQCONSTATE41.index.IDX2=\
CREATE INDEX ${index} ON ${name} (\
MESSAGE_ID)

# Message table
imq.persist.jdbc.mssql.table.MQMSG41=\
CREATE TABLE ${name} (\
ID VARCHAR(100) NOT NULL,\
MESSAGE VARBINARY(2048) NOT NULL,\
MESSAGE_SIZE INT,\
STORE_SESSION_ID BIGINT NOT NULL,\
DESTINATION_ID VARCHAR(100),\
TRANSACTION_ID BIGINT,\
CREATED_TS BIGINT NOT NULL,\
PRIMARY KEY(ID))

imq.persist.jdbc.mssql.table.MQMSG41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (\
STORE_SESSION_ID, DESTINATION_ID)

# Property table
imq.persist.jdbc.mssql.table.MQPROP41=\
CREATE TABLE ${name} (\
PROPNAME VARCHAR(100) NOT NULL,\
PROPVALUE VARBINARY(1024),\
PRIMARY KEY(PROPNAME))

# Transaction table
imq.persist.jdbc.mssql.table.MQTXN41=\
CREATE TABLE ${name} (\
ID BIGINT NOT NULL,\
TYPE INT NOT NULL,\
STATE INT,\
AUTO_ROLLBACK INT NOT NULL,\
XID VARCHAR(256),\
TXN_STATE VARBINARY(1024) NOT NULL,\
TXN_HOME_BROKER VARBINARY(1024),\
TXN_BROKERS VARBINARY(1024),\
STORE_SESSION_ID BIGINT NOT NULL,\
EXPIRED_TS BIGINT NOT NULL,\
ACCESSED_TS BIGINT NOT NULL,\
PRIMARY KEY(ID))

imq.persist.jdbc.mssql.table.MQTXN41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (\
STORE_SESSION_ID)

# JMS Bridge TM LogRecord table
imq.persist.jdbc.mssql.table.MQTMLRJMSBG41=\
CREATE TABLE ${name} (\
XID VARCHAR(256) NOT NULL,\
LOG_RECORD VARBINARY(1024) NOT NULL,\
NAME VARCHAR(100) NOT NULL,\
BROKER_ID VARCHAR(100) NOT NULL,\
CREATED_TS BIGINT NOT NULL,\
UPDATED_TS BIGINT NOT NULL,\
PRIMARY KEY(XID))

imq.persist.jdbc.mssql.table.MQTMLRJMSBG41.index.IDX1=\
CREATE INDEX ${index} ON ${name} (BROKER_ID)

imq.persist.jdbc.mssql.table.MQTMLRJMSBG41.index.IDX2=\
CREATE INDEX ${index} ON ${name} (NAME)

# JMS Bridges table
imq.persist.jdbc.mssql.table.MQJMSBG41=\
CREATE TABLE ${name} (\
NAME VARCHAR(100) NOT NULL,\
BROKER_ID VARCHAR(100) NOT NULL,\
CREATED_TS BIGINT NOT NULL,\
UPDATED_TS BIGINT NOT NULL,\
PRIMARY KEY(NAME))
------------





Here is the log (log level set to DEBUG) when I am initializing a broker:




----------------------

[root@extvm8 ~]# /opt/MessageQueue/mq/bin/imqbrokerd -name broker1 -loglevel DEBUG -tty


[29/Jul/2011:12:06:38 NZST]
================================================================================
Sun GlassFish(tm) Message Queue 4.4
Sun Microsystems, Inc.
Version: 4.4 Update 1 (Build 7-b)
Compile: Wed Nov 18 23:21:05 PST 2009

Copyright (c) 2009 Sun Microsystems, Inc. All rights reserved. Use is
subject to license terms.
================================================================================

Java Runtime: 1.6.0_26 Sun Microsystems Inc. /opt/sun/jdk-1.6.0_26-x86/jre
[29/Jul/2011:12:06:38 NZST] Syncing message store: false
[29/Jul/2011:12:06:38 NZST] IMQ_HOME=/opt/MessageQueue/mq
[29/Jul/2011:12:06:38 NZST] IMQ_VARHOME=/opt/MessageQueue/var/mq
[29/Jul/2011:12:06:38 NZST] Linux 2.6.18-128.el5 i386 192.168.xx.xx (2 cpu) root
[29/Jul/2011:12:06:38 NZST] Java Heap Size: max=188416k, current=188416k
[29/Jul/2011:12:06:38 NZST] Arguments: -name broker1 -loglevel DEBUG -tty
[29/Jul/2011:12:06:38 NZST] [B1202]: Broker broker1 is running in HA mode as part of the mqCluster cluster
[29/Jul/2011:12:06:38 NZST] Initializing ClusterDiscoveryService
[29/Jul/2011:12:06:38 NZST] [B1004]: Starting the portmapper service using tcp [ 7676, 50, 192.168.xx.xx ] with min threads 1 and max threads of 1
[29/Jul/2011:12:06:38 NZST] initializingCluster at mq://192.168.xx.xx:7676/
[29/Jul/2011:12:06:38 NZST] [B1060]: Loading persistent data...
[29/Jul/2011:12:06:38 NZST] imq.persist.jdbc.mssql.driver=com.microsoft.sqlserver.jdbc.SQLServerDriver
[29/Jul/2011:12:06:38 NZST] imq.persist.jdbc.opendburl=jdbc:sqlserver://devvm1:1433;databaseName=mqdb
[29/Jul/2011:12:06:38 NZST] Instantiating generic DAO factory
[29/Jul/2011:12:06:39 NZST] Microsoft SQL Server, 10.50.1600, 3.0.1301.101
[29/Jul/2011:12:06:39 NZST] DBManager: database product name=Microsoft SQL Server, database version number=10.50.1600, driver version number=3.0.1301.101, supports batch updates=true
[29/Jul/2011:12:06:39 NZST] Using plugged-in persistent store:
version=410
brokerid=broker1
database connection url=jdbc:sqlserver://devvm1:1433;databaseName=mqdb
database user=jcaps

[29/Jul/2011:12:06:39 NZST] [B1170]: Auto Creation of plugged-in persistent store is enabled
[29/Jul/2011:12:06:39 NZST] Assume old store does not exist because : Invalid object name 'MQVER40CmqCluster'.
[29/Jul/2011:12:06:39 NZST] Assume old store does not exist because : Invalid object name 'IMQSV37broker1'.
[29/Jul/2011:12:06:39 NZST] Assume old store does not exist because : Invalid object name 'IMQSV35broker1'.
[29/Jul/2011:12:06:39 NZST] WARNING [B4239]: Failed to load persistent store version from database table MQVER41CmqCluster:
java.sql.SQLException: [SELECT STORE_VERSION FROM MQVER41CmqCluster]: Invalid object name 'MQVER41CmqCluster'.
at com.sun.messaging.jmq.jmsserver.persist.jdbc.DBManager.wrapSQLException(DBManager.java:894)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.VersionDAOImpl.getStoreVersion(VersionDAOImpl.java:305)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.JDBCStore.checkStore(JDBCStore.java:3590)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.JDBCStore.<init>(JDBCStore.java:127)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at java.lang.Class.newInstance0(Class.java:355)
at java.lang.Class.newInstance(Class.java:308)
at com.sun.messaging.jmq.jmsserver.persist.StoreManager.getStore(StoreManager.java:157)
at com.sun.messaging.jmq.jmsserver.Globals.getStore(Globals.java:975)
at com.sun.messaging.jmq.jmsserver.cluster.ha.HAClusterManagerImpl.initialize(HAClusterManagerImpl.java:181)
at com.sun.messaging.jmq.jmsserver.Globals.initClusterManager(Globals.java:916)
at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:779)
at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:410)
at com.sun.messaging.jmq.jmsserver.Broker.main(Broker.java:1973)
[29/Jul/2011:12:06:39 NZST] [B1114]: A new persistent store will be created ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQVER41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQBKR41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQSES41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQSES41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQPROP41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQCREC41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQCON41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQCONSTATE41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQCONSTATE41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQCONSTATE41CmqClusterIDX2 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQDST41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQDST41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQMSG41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQMSG41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQTXN41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQTXN41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQTMLRJMSBG41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQTMLRJMSBG41CmqClusterIDX2 ...
[29/Jul/2011:12:06:39 NZST] Creating database table index MQTMLRJMSBG41CmqClusterIDX1 ...
[29/Jul/2011:12:06:39 NZST] Creating database table MQJMSBG41CmqCluster ...
[29/Jul/2011:12:06:39 NZST] This broker does not allow imq.cluster.masterbroker to be configured.
[29/Jul/2011:12:06:39 NZST] [B1204]: Starting HA Monitor Service
[29/Jul/2011:12:06:39 NZST] [B1206]: Monitor service initializing for brokerid broker1 at mq://192.168.xx.xx:7676/
[29/Jul/2011:12:06:39 NZST] Broker keeps old store sessionUID, state=BrokerState[INITIALIZING]
[29/Jul/2011:12:06:39 NZST] [B1193]: Broker has started using a store session of 3949429769138452480 and a broker session of 3949429769138452480
[29/Jul/2011:12:06:39 NZST] [B1205]: Starting HA Heartbeat Service
[29/Jul/2011:12:06:39 NZST] [B1187]: Heartbeat service binds to /192.168.xx.xx:7676
[29/Jul/2011:12:06:39 NZST] [B1004]: Starting the heartbeat service using udp ( /192.168.xx.xx:7676 ) with min threads 1 and max threads of 1
[29/Jul/2011:12:06:39 NZST] [B1041]: Cluster initialization successful.
[29/Jul/2011:12:06:39 NZST] [B1004]: Starting the cluster_discovery service using tcp [ 0, 100 ] with min threads 1 and max threads of 1
[29/Jul/2011:12:06:40 NZST] [B1136]: Processing stored transactions
[29/Jul/2011:12:06:40 NZST] [B1284]: 0 cluster transactions remain in PREPARED state, 0 in COMMITTED state waiting for remote broker completion
[29/Jul/2011:12:06:40 NZST] Of 0 remote transactions, 0 in PREPARED state, 0 in COMPLETE state, 0 in COMMITTED state
[29/Jul/2011:12:06:40 NZST] [B1013]: Auto Creation of Queues is enabled
[29/Jul/2011:12:06:40 NZST] Loading All Stored Destinations
[29/Jul/2011:12:06:40 NZST] Loaded 0 stored destinations
[29/Jul/2011:12:06:40 NZST] [B1144]: Creating Dead Message Queue
[29/Jul/2011:12:06:40 NZST] [B1158]: Administrator has created destination mq.sys.dmq [Queue]
[29/Jul/2011:12:06:40 NZST] Another broker has created the DMQ, reloading

*[29/Jul/2011:12:06:40 NZST] Exception running broker :*
java.lang.NullPointerException
at com.sun.messaging.jmq.jmsserver.core.Destination.createDMQ(Destination.java:442)
at com.sun.messaging.jmq.jmsserver.core.Destination.loadDestinations(Destination.java:4857)
at com.sun.messaging.jmq.jmsserver.core.Destination.init(Destination.java:5585)
at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:1053)
at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:410)
at com.sun.messaging.jmq.jmsserver.Broker.main(Broker.java:1973)

----------------------

I tried almost everything and have triple checked the following points for SQL server:
User has SELECT, UPDATE, INSERT, DELETE, EXEC permissions on the object;
I am using the right credentials for my user;
I am creating my tables with the "DBO" prefix (ie. dbo.MQVER41CmqCluster);
This SQL Query (SELECT STORE_VERSION FROM MQVER41CmqCluster) runs perfectly from SQL Server Management Studio.

Now I am wondering what could be the problem and why I can't run my brokers with MS SQL :(, I've seen a few people on the internet running SJSMQ or openMQ with MS SQL but somehow I can't...
Any suggestions are most welcome as I am running out of idea at this point... It would be much appreciated if someone could point me in the right direction.

Thank you so much!

Edited by: 875906 on Jul 31, 2011 7:49 PM

Edited by: 875906 on Aug 1, 2011 1:48 AM

Edited by: 875906 on Aug 1, 2011 1:49 AM
  • 1. Re: Failed to load persistent store version from database
    ak Explorer
    Currently Being Moderated
    Unfortunately the broker didn't log the exception before the NPE (filed http://java.net/jira/browse/MQ-113). The likely possibility is the INSERT to the MQDST41CmqCluster table failed. Have you checked database server side logging to find anything that might be related to the failure ? The broker warning log message [B4239] is expected if the version table didn't exist as expected first time starting the first broker in the cluster. By the way, the latest release is 4.5.1 and latest 4.4 patch release is 4.4u2p3, and you are using 4.4u1, so please upgrade.
  • 2. Re: Failed to load persistent store version from database
    878909 Newbie
    Currently Being Moderated
    Hi ak, thank you very much for your reply.

    As suggested I've checked the SQL server log but I could not find anything related to this issue.

    Please find below a list of all events logged by sql server. As far as I can see there is nothing related to this issue...
    -----------------
    Date,Source,Severity,Message
    08/01/2011 13:44:19,spid64,Unknown,Setting database option PAGE_VERIFY to CHECKSUM for database mqdb.
    08/01/2011 13:44:19,spid64,Unknown,Setting database option MULTI_USER to ON for database mqdb.
    08/01/2011 13:44:19,spid64,Unknown,Setting database option RECOVERY to FULL for database mqdb.
    08/01/2011 13:44:19,spid64,Unknown,Setting database option READ_WRITE to ON for database mqdb.
    08/01/2011 13:44:19,spid64,Unknown,Setting database option PARAMETERIZATION to SIMPLE for database mqdb.
    08/01/2011 13:44:19,spid64,Unknown,Setting database option DATE_CORRELATION_OPTIMIZATION to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option AUTO_UPDATE_STATISTICS_ASYNC to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option DISABLE_BROKER to ON for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option RECURSIVE_TRIGGERS to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option QUOTED_IDENTIFIER to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option NUMERIC_ROUNDABORT to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option CONCAT_NULL_YIELDS_NULL to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option CURSOR_DEFAULT to GLOBAL for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option CURSOR_CLOSE_ON_COMMIT to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option AUTO_UPDATE_STATISTICS to ON for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option AUTO_SHRINK to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option AUTO_CREATE_STATISTICS to ON for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option AUTO_CLOSE to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option ARITHABORT to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option ANSI_WARNINGS to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option ANSI_PADDING to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option ANSI_NULLS to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option ANSI_NULL_DEFAULT to OFF for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Setting database option COMPATIBILITY_LEVEL to 100 for database mqdb.
    08/01/2011 13:44:18,spid64,Unknown,Starting up database 'mqdb'.
    ------------------

    I will follow your advise and will update to the latest patch first, if this doesn't work I will upgrade to the latest version of MQ... I will keep you posted.
    If it still doesn't work then I guess I will have to explain to my manager that the current releases of MQ does not fully support MS SQL.

    Would you know if MS SQL is officially supported by any version OpenMQ and/or SJSMQ? The online documentation doesn't say much about this.

    Your help is very much appreciated! Thanks again!

    Regards,
    Raimana
  • 3. Re: Failed to load persistent store version from database
    878909 Newbie
    Currently Being Moderated
    Unfortunately update and upgrade did not solve the issue :(. Same problem occurs, it is still throwing a Null Pointer Exception at the end of the broker initialization (as shown in my first post) and then the broker dies.

    I guess SJSMQ does not support MS SQL? Is that right or is it just me?

    Is there any other log file that might point to the cause of this issue?

    Otherwise, although I don't think it's going to work I will try to use the JDBC-ODBC bridge instead of the type 4 JDBC driver for MS SQL and see if I've got more luck with that one...

    If it was just me I would just use MySQL!

    Cheers.
  • 4. Re: Failed to load persistent store version from database
    ak Explorer
    Currently Being Moderated
    The purpose of the upgrade is to use the latest MQ release. The NPE MQ-113 issue has been fixed in MQ current developement branch.
    The NPE issue has been reproduced with Microsoft SQL server using your table definitions, and with additional broker debug logging it shows that it's caused by following SQLException (see below) on insertion to the destination table. This SQLException is caused by the small size of DESTINATION column in your table definition,

    DESTINATION VARBINARY(1024) NOT NULL

    Increasing the size to 2048 (which is the default size of the column for MySQL in default.properties) solved the problem. Please try this and increase other column sizes such as following in your table definitions as well (Please use other database vendor table definitions in default.properties as reference)

    TXN_STATE VARBINARY(1024) NOT NULL
    TXN_HOME_BROKER VARBINARY(1024)
    TXN_BROKERS VARBINARY(1024)

    Please note that when using enhanced cluster, you are strongly urged to use a highly available database. The only QA tested such databases with MQ enhanced cluster are MySQL NDB cluster and Oracle RAC.

    ---------------
    Caused by: java.sql.SQLException: [INSERT INTO MQDST41CmqCluster ( ID, DESTINATION, IS_LOCAL, CONNECTION_ID, C
    ONNECTED_TS, STORE_SESSION_ID, CREATED_TS) VALUES ( ?, ?, ?, ?, ?, ?, ? )]: String or binary data would be truncated.[22001, 8152]
    at com.sun.messaging.jmq.jmsserver.persist.jdbc.comm.CommDBManager.wrapSQLException(CommDBManager.java:949)
    at com.sun.messaging.jmq.jmsserver.persist.jdbc.DestinationDAOImpl.insert(DestinationDAOImpl.java:292)
  • 5. Re: Broker Throws NPE and Dies on Startup
    ak Explorer
    Currently Being Moderated
    The NPE has been fixed in 5.0.1. The NPE is triggered by following SQLException when storing the DMQ to your defined MQDST41 table

    SQLException: [INSERT INTO MQDST41Ca5 ( ID, DESTINATION, IS_LOCAL, CONNECTION_ID, CONNECTED_TS, STORE_SESSION_ID, CREATED_TS) VALUES ( ?, ?, ?, ?, ?, ?, ? )]: String or binary data would be truncated.[22001, 8152]

    This SQLException is caused by too small size of DESTINATION column - 1024. Debugging shows that the Destination object to be stored, after serialization, has size=1153 (pos=2 mq.sys.dmq [Queue]). Please increase this column defined size.

    imq.persist.jdbc.mssql.table.MQDST41=\
    .....
    DESTINATION VARBINARY(1024) NOT NULL,\

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points