[GLASSFISH-18052] broker id on broker instance is not set when messagestore=jdbc Created: 20/Dec/11  Updated: 04/Jan/12  Resolved: 04/Jan/12

Status: Closed
Project: glassfish
Component/s: jms
Affects Version/s: 3.1.2_b14
Fix Version/s: None

Type: Bug Priority: Major
Reporter: saradak Assignee: Satish Kumar
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Tags: 3_1_2_review

 Description   

Steps to reproduce the problem
-------------------------------

1. Create cluster cluster1.
2. Configure jms cluster.

./asadmin configure-jms-cluster --clustertype=conventional --configstoretype=shareddb --messagestoretype=jdbc --dbvendor=mysql --dbuser=root --dburl="jdbc:mysql://hostname:portno/dbname?password=xxxx" --property imq.persist.jdbc.dbVendor=mysql cluster1

3. Create two instances.
4. Start the cluster cluster1.
5. Following exceptions were thrown in broker log file.

Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
================================================================================
Java Runtime: 1.7.0 Oracle Corporation /usr/jdk/jdk1.7.0/jre
[19/Dec/2011:13:38:09 PST] IMQ_HOME=/opt/SUNWappserver/glassfish3/mq
[19/Dec/2011:13:38:09 PST] IMQ_VARHOME=/opt/SUNWappserver/glassfish3/glassfish/nodes/localhost-domain1/inst1/imq
[19/Dec/2011:13:38:09 PST] SunOS 5.10 sparc hostname (2 cpu) root
[19/Dec/2011:13:38:09 PST] Max file descriptors: 65536 (65536)
[19/Dec/2011:13:38:09 PST] Java Heap Size: max=465600k, current=136768k
[19/Dec/2011:13:38:09 PST] Arguments: -port 27676 -name cluster1inst1 -nobind -imqhome /opt/SUNWappserver/glassfish3/mq -varhome /opt/SUNWappserver/glassfish3/glassfish/nodes/localhost-domain1/inst1/imq -libhome /opt/SUNWappserver/glassfish3/mq/lib -useRmiRegistry -rmiRegistryPort 28686 -save -silent
[19/Dec/2011:13:38:09 PST] JMSRA BrokerProps: imq.service.activate=jmsdirect, imq.cluster.sharecc.persist.jdbc.mysql.user=root, imq.cluster.nowaitForMasterBroker=true, imq.persist.jdbc.dbVendor=mysql, imq.cluster.sharecc.persist.jdbc.dbVendor=mysql, imq.cluster.brokerlist=mq://localhost:27676/,mq://localhost:27677/, imq.jmsra.managed=true, imq.cluster.clusterid=cluster1_MQ, imq.cluster.nomasterbroker=true, imq.imqcmd.password=*****, imq.persist.store=jdbc, imq.cluster.dynamicChangeMasterBrokerEnabled=true, imq.cluster.sharecc.persist.jdbc.mysql.property.url=jdbc:mysql://hostname:portno/imq?password=xxxxx
[19/Dec/2011:13:38:09 PST] Broker Properties: imq.persist.jdbc.dbVendor=mysql, imq.jmx.rmiregistry.use=true, imq.cluster.sharecc.persist.jdbc.mysql.property.url=jdbc:mysql://hostname:portno/imq?password=imqroot, imq.cluster.nomasterbroker=true, imq.cluster.sharecc.persist.jdbc.dbVendor=mysql, imq.cluster.brokerlist=mq://localhost:27676/,mq://localhost:27677/, imq.cluster.sharecc.persist.jdbc.mysql.user=root, imq.service.runtimeAdd=mqdirect2, imq.persist.store=jdbc, imq.portmapper.bind=false, imq.instancename=cluster1inst1, imq.cluster.clusterid=cluster1_MQ, imq.cluster.nowaitForMasterBroker=true, imq.log.console.output=NONE, imq.service.activate=jmsdirect, imq.jmx.rmiregistry.port=28686, imq.imqcmd.password=*****, imq.jmsra.managed=true, imq.cluster.dynamicChangeMasterBrokerEnabled=true, imq.portmapper.port=27676
[19/Dec/2011:13:38:09 PST] Embedded Broker
[19/Dec/2011:13:38:10 PST] [B1359]: Use a shared store for cluster configuration change records
[19/Dec/2011:13:38:10 PST] [B1060]: Loading persistent data...
[19/Dec/2011:13:38:11 PST] imq.persist.jdbc.mysql.driver=com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource
[19/Dec/2011:13:38:11 PST] ERROR [B3000]: Could not open persistent message store:
com.sun.messaging.jmq.jmsserver.util.BrokerException: [B3093]: Invalid broker identifier specified (null), broker identifier should be an alphanumeric string
at com.sun.messaging.jmq.jmsserver.persist.jdbc.DBManager.initTableSuffix(DBManager.java:266)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.comm.CommDBManager.initDBManagerProps(CommDBManager.java:334)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.DBManager.<init>(DBManager.java:254)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.DBManager.getDBManager(DBManager.java:182)
at com.sun.messaging.jmq.jmsserver.persist.jdbc.JDBCStore.<init>(JDBCStore.java:112)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:525)
at java.lang.Class.newInstance0(Class.java:372)
at java.lang.Class.newInstance(Class.java:325)
at com.sun.messaging.jmq.jmsserver.persist.StoreManager.getStore(StoreManager.java:169)
at com.sun.messaging.jmq.jmsserver.Globals.getStore(Globals.java:995)
at com.sun.messaging.jmq.jmsserver.Broker._start(Broker.java:955)
at com.sun.messaging.jmq.jmsserver.Broker.start(Broker.java:456)
at com.sun.messaging.jmq.jmsserver.BrokerProcess.start(BrokerProcess.java:164)
at com.sun.messaging.jmq.jmsserver.DirectBrokerProcess.start(DirectBrokerProcess.java:92)
at com.sun.messaging.jmq.jmsclient.runtime.impl.BrokerInstanceImpl.start(BrokerInstanceImpl.java:206)
at com.sun.messaging.jms.blc.EmbeddedBrokerRunner.start(EmbeddedBrokerRunner.java:331)
at com.sun.messaging.jms.blc.LifecycleManagedBroker.start(LifecycleManagedBroker.java:454)
at com.sun.messaging.jms.ra.ResourceAdapter.start(ResourceAdapter.java:383)
at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter$1.run(ActiveJmsResourceAdapter.java:360)
at java.security.AccessController.doPrivileged(Native Method)
at com.sun.enterprise.connectors.jms.system.ActiveJmsResourceAdapter.startResourceAdapter(ActiveJmsResourceAdapter.java:353)
at com.sun.enterprise.connectors.ActiveOutboundResourceAdapter.init(ActiveOutboundResourceAdapter.java:129)
at com.sun.enterprise.connectors.inbound.ActiveInboundResourceAdapterImpl.init(ActiveInboundResourceAdapterImpl.java:90)
at com.sun.enterprise.connectors.ActiveRAFactory.instantiateActiveResourceAdapter(ActiveRAFactory.java:135)
at com.sun.enterprise.connectors.ActiveRAFactory.createActiveResourceAdapter(ActiveRAFactory.java:106)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:212)
at com.sun.enterprise.connectors.service.ResourceAdapterAdminServiceImpl.createActiveResourceAdapter(ResourceAdapterAdminServiceImpl.java:348)
at com.sun.enterprise.connectors.ConnectorRuntime.createActiveResourceAdapter(ConnectorRuntime.java:357)

If you observe the log file, there is no imq.brokerid property being set on the imq instance. When using JDBC store, imq.brokerid must set.

-Sarada.



 Comments   
Comment by Nazrul [ 21/Dec/11 ]

This is blocking UI testing. Requesting Amy for help. Please try the console when you verify this fix.

Comment by amyk [ 21/Dec/11 ]

This is a bug in GlassFish JMS module. imq.brokerid must set and be passed to broker(s) when --messagestoretype=jdbc

Comment by Satish Kumar [ 30/Dec/11 ]

This issue will only occur when running conventional peer broker clusters with message store type configured to JDBC. Currently, the broker id is only being passed only for enhanced clusters. Changes are required to ActiveJmsResourceAdapter to pass in the broker id when messagestore type is JDBC. svn diff of changes is below:

Index: src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java
===================================================================
— src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java (revision 51810)
+++ src/main/java/com/sun/enterprise/connectors/jms/system/ActiveJmsResourceAdapter.java (working copy)

@@ -634,8 +638,8 @@
dbProps.setProperty("imq.persist.store", jmsAvailability.getMessageStoreType());
if(Boolean.valueOf(jmsAvailability.getAvailabilityEnabled()) == false)
dbProps.setProperty("imq.cluster.nomasterbroker", "true");

  • else{
  • dbProps.setProperty("imq.brokerid", getBrokerInstanceName(getJmsService()));
    + if (Boolean.valueOf(jmsAvailability.getAvailabilityEnabled()) || "jdbc".equals(jmsAvailability.getMessageStoreType())) { + dbProps.setProperty("imq.brokerid", getBrokerInstanceName(getJmsService()) ); }

    String dbVendor = jmsAvailability.getDbVendor();
    String dbuser = jmsAvailability.getDbUsername();

Comment by Satish Kumar [ 30/Dec/11 ]

GF 3.1.2 change control review questionnaire. This bug is very similar to 18050 in impact.

  • What is the impact on the customer of the bug?

Due to this bug, conventional MQ broker clusters of peer brokers with messagestore type set as JDBC will not work in EMBEDDED and LOCAL modes of integration.

Is it a regression? Does it meet other bug fix criteria (security, performance, etc.)?
No, this is not a regression and does not meet any other criteria.

  • What is the cost/risk of fixing the bug?
    The changes are fairly simple (see svn diffs in my previous comment). Hence the risk is quite low.
  • Is there an impact on documentation or message strings?
    No
  • Which tests should QA (re)run to verify the fix did not destabilize GlassFish?
    Standard JMS SQE tests but with MQ configured for conventional clusters of peer brokers with message store type configured to JDBC
  • Which is the targeted build of 3.1.2 for this fix?
    build 17
Comment by Satish Kumar [ 04/Jan/12 ]

checked-in a fix

Generated at Tue Jun 02 02:46:43 UTC 2015 using JIRA 6.2.3#6260-sha1:63ef1d6dac3f4f4d7db4c1effd405ba38ccdc558.