Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

classic Classic list List threaded Threaded
9 messages Options
WMR
Reply | Threaded
Open this post in threaded view
|

Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

WMR
This post was updated on .
I setup a swiftmq HA router with two server nodes and try running the ./samples/router_network/P2PSender and P2PReceiver to check the HA router functionality.( using SwiftMQ 9.7.1 Evaluation ).

The sample test cases are running in the Server1

Use Case 1:
   Server1: Active SwiftMQ instance
    Server2: Stand by swiftmq instance

Observation:  No JMS Exception observerd


Use Case 2:
    Server1: Stand by swiftmq instance
    Server2: Active swiftmq instance

Observation:  Intermittent JSMExceptions observed. 
Exception1: 
javax.naming.CommunicationException: javax.jms.JMSSecurityException: invalid password
        at com.swiftmq.jndi.ReconnectContext.reconnect(Unknown Source)
        at com.swiftmq.jndi.ReconnectContext.runWrapped(Unknown Source)
        at com.swiftmq.jndi.ReconnectContext.lookup(Unknown Source)
        at javax.naming.InitialContext.lookup(InitialContext.java:411)
        at P2PReceiver.main(P2PReceiver.java:87)

Exception2:
javax.jms.JMSSecurityException: javax.jms.JMSSecurityException: invalid password
        at com.swiftmq.jms.v750.ConnectionImpl.setAuthenticateResponseReply(Unknown Source)
        at com.swiftmq.jms.v750.Connector.setReply(Unknown Source)
        at com.swiftmq.jms.v750.Connector.visit(Unknown Source)
        at com.swiftmq.jms.v750.po.PODataAvailable.accept(Unknown Source)
        at com.swiftmq.tools.pipeline.PipelineQueue.process(Unknown Source)
        at com.swiftmq.tools.queue.SingleProcessorQueue.dequeue(Unknown Source)
        at com.swiftmq.tools.pipeline.PipelineQueue$QueueProcessor.run(Unknown Source)
        at com.swiftmq.client.thread.PoolExecutor.run(Unknown Source)


And I checked the P2PReceiver.java:87 line where the exception is thrown sometimes and it is where the conenctionFactory is lookedup.

                        QueueConnectionFactory connectionFactory = (QueueConnectionFactory)ctx.lookup(qcfName);


the qcfName and URL configuration:

                String smqpURL = "smqp://server1-in:4001/host2=server2-in;port2=4001;timeout=10000;reconnect=true;retrydelay=1000;maxretries=50";
                String qcfName = "QueueConnectionFactory";
                String queueName = "testqueue";


I disabled the authenitation swiftlet , but still getting the intermittent errors.

  <swiftlet name="sys$authentication" authentication-enabled="false">



Corresponding logs to the Exception1 in info.log:

2015-07-21 21:03:04.624/[BlockingTCPListener, swiftlet=sys$jms, port=4001]/Listener/INFORMATION/connection accepted: server1-in
2015-07-21 21:03:04.697/server1-in:44057/BlockingHandler/INFORMATION/Exception, EXITING: java.io.IOException: End-of-Stream reached
2015-07-21 21:03:04.697/sys$jms/INFORMATION/JMSConnection v750/server1-in:44057/connection closed


Corresponding logs to the Exception2 in the info.log:

2015-07-21 21:04:03.827/[BlockingTCPListener, swiftlet=sys$jms, port=4001]/Listener/INFORMATION/connection accepted: server1-in
2015-07-21 21:04:03.979/sys$jms/INFORMATION/JMSConnection v750/server1-in:44068/receiving disconnect request, scheduling connection close
2015-07-21 21:04:03.979/server1-in:44068/BlockingHandler/INFORMATION/Exception, EXITING: java.io.IOException: End-of-Stream reached
2015-07-21 21:04:03.981/[BlockingTCPListener, swiftlet=sys$jms, port=4001]/Listener/INFORMATION/connection accepted: server1-in
2015-07-21 21:04:03.984/sys$jms/INFORMATION/JMSConnection v750/server1-in:44068/connection closed
2015-07-21 21:04:03.990/server1-in:44069/BlockingHandler/INFORMATION/Exception, EXITING: java.io.IOException: End-of-Stream reached
2015-07-21 21:04:03.990/sys$jms/INFORMATION/JMSConnection v750/server1-in:44069/connection closed


Corresponding logs to a successful test execution.

2015-07-21 21:03:24.503/[BlockingTCPListener, swiftlet=sys$jms, port=4001]/Listener/INFORMATION/connection accepted: server1-in
2015-07-21 21:03:24.640/sys$jms/INFORMATION/JMSConnection v750/server1-in:44059/receiving disconnect request, scheduling connection close
2015-07-21 21:03:24.641/server1-in:44059/BlockingHandler/INFORMATION/Exception, EXITING: java.io.IOException: End-of-Stream reached
2015-07-21 21:03:24.641/sys$jms/INFORMATION/JMSConnection v750/server1-in:44059/connection closed
2015-07-21 21:03:24.643/[BlockingTCPListener, swiftlet=sys$jms, port=4001]/Listener/INFORMATION/connection accepted: server1-in
2015-07-21 21:03:24.668/sys$jms/INFORMATION/JMSConnection v750/server1-in:44060/receiving disconnect request, scheduling connection close
2015-07-21 21:03:24.668/server1-in:44060/BlockingHandler/INFORMATION/Exception, EXITING: java.io.IOException: End-of-Stream reached
2015-07-21 21:03:24.668/sys$jms/INFORMATION/JMSConnection v750/server1-in:44060/connection closed

Any Idea why this is happening ?

Thanks in Advance. . .
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

IIT Software
Administrator
Did you change anything in P2PSender/Receiver? Did you use HA Wizard to create the configuration? I'd need both of your routerconfig.xml.
WMR
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

WMR
No , I didnt use the HA Wizard to create the configuration. Basically  I am working with remote servers hence cannot use the HA UI wizard to create the configuration, Instead I edited the config files to have the required configuration.

Uploading the modified P2PSender.java and the two config files that I have used.

ip addresses of the two servers are 192.168.18.135 and 192.168.18.136
The ip address 192.168.17.135 is for the intra lan.



routerconfig_instance1.xml
routerconfig_instance2.xml
P2PSender.java
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

IIT Software
Administrator
I've tested it here, did failovers many time, but was not able to reproduce it. Your config files and P2PSender.java are ok. This is all basic stuff which works since years.

Concerning the config file of the standby instance: You must not change it because it will be overwritten with the config file from the active during sync (look here). So setting authentication-enabled="false" has no effect. In neither case should you get a JMSSecurityException during lookup because the user anonymous is per default member of group public which has a grant on the lookup topic.

What you could do is to add ";debug=true" to the smqp-URL and send me the output after that happens. Also add "-Dswiftmq.reconnect.debug=true" to the command line of the "starter" shell script.
WMR
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

WMR
Logs Related to the Exception1:
Exception1.txt

Logs Related to the Exception2 :
Exception2.txt


Logs Related to a Successful Attempt :
SuccessfulAttempt.txt


Thanks . . .  
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

IIT Software
Administrator
It fails during challenge/response and this factory is 15 years old and works.

Just to verify: You do not have changed the password of user anonymous through SwiftMQ Explorer or CLI and did not save the configuration? That's the only reason when I would not see it in the config files.

If not, please let me know your OS and Java version & vendor of client and instance1/2 host. We'd need to check whether the MessageDigest MD5 delivers the same result on all of these platforms.

And please post the error and warning log files of both instances.
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

IIT Software
Administrator
In reply to this post by WMR
What you should also verify is whether it works if you deploy both HA instances on your local host. Just unpack the distribution and go.
WMR
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

WMR
Hi , Thanks to your reply I think I figured out the issue .

The Instance1 had java 1.7 installed while the Instance2 had Java 1.5 Installed.

[root@instance1 router_network]# java -version
java version "1.7.0_45"
OpenJDK Runtime Environment (rhel-2.4.3.3.el6-x86_64 u45-b15)
OpenJDK 64-Bit Server VM (build 24.45-b08, mixed mode)


[root@instance2 unix]# java -version
java version "1.5.0"
gij (GNU libgcj) version 4.4.6 20120305 (Red Hat 4.4.6-4)

Copyright (C) 2007 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
[root@dc1-uscc-test-smq2 unix]#


I upgraded the java version of the instance2 and I dont see the issue any more.

Many thanks for your replies and guidance, I never thought it has to do anything with the java versions.


Thanks and Best Regards. . .
Reply | Threaded
Open this post in threaded view
|

Re: Intermittent "javax.jms.JMSSecurityException: invalid password" With SwiftMQ HARouter

IIT Software
Administrator
I can ensure you, it's never the Java version. Java is rocksolid and compatible over releases. But it seems you're using some GNU stuff (1.5.0) which delivers different MessageDigest output (sometimes).

Glad it works. Feel free to ask for further help here if needed.