Skip to main content

create JMS host/can not create/start JMS brokers

7 replies [Last post]
gavintranter
Offline
Joined: 2010-08-09
Points: 0

Hi all,

me again. Ok, so I am trying to set up a new domain on my glassfish cluster, it is the second domain, it has a cluster of two instances.

My issue is that when the cluster starts it seems incapable of talking to the JMS brokers.

I wish to have glassfish manage my brokers in an enhanced cluster, I am using:

<code>set --port 30048 configs.config.server-config.jms-service.type=LOCAL</code>

to set the clusters properties correctly then after I create the cluster (create-cluster --port 30048 APP) I am setting the cluster to local:

<code>set --port 30048 configs.config.APP-config.jms-service.type=LOCAL</code>

I then attempt to configure the jms cluster, this seems to work fine (although I would prefer it created the database if it didnt exist as the one I am using is from a different experiment).

When I start the cluster I get the following errors:

[#|2011-08-16T17:56:36.350+0100|WARNING|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.util|_ThreadID=1;_ThreadName=Thread-1;|RAR8000 : The method setHARequired is not present in the class : com.sun.messaging.jms.ra.ResourceAdapter|#]

[#|2011-08-16T17:56:36.353+0100|WARNING|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.util|_ThreadID=1;_ThreadName=Thread-1;|RAR7097: No setter method present for the property HARequired in the class com.sun.messaging.jms.ra.ResourceAdapter|#]

[#|2011-08-16T17:56:37.718+0100|WARNING|glassfish3.1|javax.jms|_ThreadID=10;_ThreadName=Thread-1;|[C4003]: Error occurred on connection creation [localhost:27676]. - cause: java.net.SocketException: Connection reset|#]

[#|2011-08-16T17:56:37.719+0100|WARNING|glassfish3.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=17;_ThreadName=Thread-1;|Local broker: [16/Aug/2011:17:56:37 BST] ERROR [B3168]: Invalid broker address for this broker to run in cluster: Loopback IP address is not allowed in broker address mq://127.0.0.1:27676/?instName=APPAPPDEV1&brokerID=APPAPPDEV1&brokerSessionUID=7786215590325641728&ha=true&storeSessionUID=3694976803348201984 for cluster|#]

The first two I have no clue about but think they maybe linked to the second two. However I think the second two are to do with the JMS host, looking at my domain.xml the default host is set have a host of host=localhost, this seems to be incorrect for clustered setups.

I am wondering:

a) why this is the case when the type is set to local and I set the clustertype to enhanced with the configure-jms-cluster? Should it not of created me the correct default host?

b) will creating a new jms host with a host of 0.0.0.0 using create-jms-host be of any use?

thanks for any help in advance

Gavin.

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
nigeldeakin
Offline
Joined: 2007-10-12
Points: 0

Gavin,

When I start the cluster I get the following errors:

[#|2011-08-16T17:56:36.350+0100|WARNING|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.util|_ThreadID=1;_ThreadName=Thread-1;|RAR8000 : The method setHARequired is not present in the class : com.sun.messaging.jms.ra.ResourceAdapter|#]

[#|2011-08-16T17:56:36.353+0100|WARNING|glassfish3.1|javax.enterprise.resource.resourceadapter.com.sun.enterprise.connectors.util|_ThreadID=1;_ThreadName=Thread-1;|RAR7097: No setter method present for the property HARequired in the class com.sun.messaging.jms.ra.ResourceAdapter|#]

Hmm. I get that too. I've logged it as a bug
java.net/jira/browse/GLASSFISH-17199
I think this is harmless (the property in question was removed a long time ago and is no longer needed)

[#|2011-08-16T17:56:37.718+0100|WARNING|glassfish3.1|javax.jms|_ThreadID=10;_ThreadName=Thread-1;|[C4003]: Error occurred on connection creation [localhost:27676]. - cause: java.net.SocketException: Connection reset|#]

The resource adapter (in GlassFish) is trying to connect to a MQ broker which it thinks is running on localhost:27676. Obviously there is no such broker. This is explained by the next message:

[#|2011-08-16T17:56:37.719+0100|WARNING|glassfish3.1|javax.resourceadapter.mqjmsra.lifecycle|_ThreadID=17;_ThreadName=Thread-1;|Local broker: [16/Aug/2011:17:56:37 BST] ERROR [B3168]: Invalid broker address for this broker to run in cluster: Loopback IP address is not allowed in broker address <a href="mq://127.0.0.1:27676/?instName=APPAPPDEV1&amp;brokerID=APPAPPDEV1&amp;brokerSessionUID=7786215590325641728&amp;ha=true&amp;storeSessionUID=3694976803348201984">mq://127.0.0.1:27676/?instName=APPAPPDEV1&amp;brokerID=APPAPPDEV1&amp;brokerSessionUID=7786215590325641728&amp;ha=true&amp;storeSessionUID=3694976803348201984</a> for cluster|#]

That's a message from the broker itself, telling us that it can't start because it is incorrectly configured with an address of 127:0.0.1. So, as you already know, there's a problem with the way your cluster has been configured.

I think it gets this host name from the GlassFish "node". When you created the node, what hostname did you give?

a) why this is the case when the type is set to local and I set the clustertype to enhanced with the configure-jms-cluster? Should it not of created me the correct default host?

As I said, i think it gets this from the "node".

b) will creating a new jms host with a host of 0.0.0.0 using create-jms-host be of any use?

Probably no. You ought to be able to resolve this without resorting to that. Can I suggest you supply the complete set of commands you ran, starting with "create-cluster"?

Nigel

gavintranter
Offline
Joined: 2010-08-09
Points: 0

When I create a new domain/cluster it creates a default node with the name: localhost-DomainName. This appears to be done using a create-node-config command as it is a config node.

My choices apperar to be that I create a new node using create-node-config using the name of the host/ip address or I find away to change the host name the domain is using so it is no longer using localhost, as it appears to be using some default property.
The reason I need to do this is the broker is taking its host address from this property and I currently have to create a new node making use of the host name (which I actual prefer as it keeps the naming of my nodes consistant, it also makes it much clearer to my mind which node I am dealing with), but does mean I have to delete the default node.

If it is using a deafult property, which is set to localhost rather than to host name then I think this might be a bug, as I have defined the cluster as an enhanced cluster, and making use of localhost as a name causes issues with openMq (as we have seen), but it could also be a little confusing, imagine adminstering the nodes from a server other than the DAS, in that context what does localhost mean, or perhaps I am just easierly confused :)

Just a thought

Gavin

amyk
Offline
Joined: 2007-09-10
Points: 0

>If it is using a deafult property, which is set to localhost rather than to host name then I think this might be a bug,

Please see http://java.net/jira/browse/MQ-118

nigeldeakin
Offline
Joined: 2007-10-12
Points: 0

Cluster configuration (rather than JMS configuration) isn't my speciality. I've asked a colleague whether they can help.

Nigel

P.S. It's a bit confusing when you make multiple postings on the same day as we don't know whether your later posts supersede your earlier ones. Bear in mind that your posts are being answered by people all over the globe (California, Britain, India...) so your posts may not be seen for many hours. (Friendly hint)

gavintranter
Offline
Joined: 2010-08-09
Points: 0

Ah, sorry about that I was trying to be helpful and post additional to the correct post as I found it. I will bear this in mind in future.

I think I have the Glassfish instances and the mq brokers talking to each other now,

thank you for all you help, I think I may owe you a pint or two.

Thanks

G

gavintranter
Offline
Joined: 2010-08-09
Points: 0

-- intentially blank :) --

Gavin

gavintranter
Offline
Joined: 2010-08-09
Points: 0

Hi,
Its usual me creating the bugs not finding them :)

Ah, that might make some sense as I thought I already thought I had a node for the localhost (the one the DAS is running on) but thinking about it, that is for the default domain.
Would I create the node with create-node-config?

In the mean time here are my commands:
<code>
-- Not sure if I need to set this one
set --port 30048 configs.config.server-config.jms-service.type=LOCAL

create-cluster --port 30048 APP
-- APP is the name of the cluster
set --port 30048 configs.config.APP-config.jms-service.type=LOCAL
create-jms-host --port 30048 --mqhost 0.0.0.0 --mqport 30076 --mquser admin --mqpassword admin blue_JMS_host
create-node-config --port 30048 --nodehost pbapp1 pbapp1-DEV
create-node-ssh --port 30048 --nodehost pbapp2 pbapp2-DEV
configure-jms-cluster --port 30048 --clustertype=enhanced --dbvendor mysql --dbuser openmq --dburl jdbc:mysql://pbdb1:3306/pb_tm_mq_dev_1 APP
create-instance --port 30048 --cluster APP --node localhost-DEV APP-DEV-1
create-instance --port 30048 --cluster APP --node pbapp2-DEV APP-DEV-2
create-jdbc-connection-pool --port 30048 --restype=javax.sql.DataSource --datasourceclassname com.mysql.jdbc.jdbc2.optional.MysqlDataSource --property user=pb_tm_user:serverName=pbdb1:password=pb_tm_user:databaseName=pb_tm_dev_1:url=jdbc\\:mysql\\://pbdb1\\:3306/pb_tm_dev_1 BlueTMPool
create-jdbc-resource --port 30048 --connectionpoolid BlueTMPool --target APP jdbc/net.blue.APP
create-jms-resource --port 30048 --restype javax.jms.QueueConnectionFactory --target APP jms/net.blue.connectionFactory.TM-DWH-APP
create-jms-resource --port 30048 --restype javax.jms.Queue --target APP jms/net.blue.queue.TM-DWH-APP

</code>

Thanks
Gavin

PS sorry if this is a duplicate post, my previous reply doesnt seem to have made it to the board