Service Virtualization

 View Only
Expand all | Collapse all

JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password

Jump to Best Answer
  • 1.  JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password

    Posted Jan 06, 2016 06:09 PM

    Im using DevTest 8.5.0 and I created a set of assets to connect to JMS server, specifically ActiveMQ, everething worked fine when connecting to ActiveMQ server that didnt require authentication. Now that im trying to connect to one with authentication im getting the error:

         "Error starting connection ConnectionFactory@JNDI: User name [null] or password is invalid."

    Even when im proving the user and password in the JNDI context

    issue JMS.png

     

     

    Im missing something? or does anyone faced similar issue?



  • 2.  Re: JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password

    Posted Jan 06, 2016 09:24 PM

    So, there are two places you can provide a username/password:  The JNDI Factory asset is one, but there is also a username/password field on the JMS Generic Connection Factory asset.  Depending on the JMS provider, and just because of how the JMS API works, you may have to provider login information in one, the other, or both places. 

     

    If you haven't defined a JMS Connection Factory asset then when you execute the JMS Send Receive step it's actually searching through the JNDI tree for a usable JMS Connection Factory on the fly.  When it does this it assumes the JMS Connection Factory doesn't need a username/passworrd.  If you want to tell it a username/password to use then you will have to define a JMS Connection Factory explicitly.

     

    With ActiveMQ the JNDI name of the JMS Connection Factory is usually just 'ConnectionFactory'.  Try defining a JMS Generic Connection Factory Asset with the JNDI name 'ConnectionFactory', your JNDI Context asset, and the username/password you need.  The JMS Send Receive step (or the JMS VSE protocol) should pick it up automatically rather than searching/generating its own.



  • 3.  Re: JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password

    Posted Jan 07, 2016 10:01 AM

    Thank you for your response. I created a JMS Generic Connection Factory from the start, and as you stated i used the name 'ConnectionFactory', i tried to set the user and password on the Connection Factory because thats how it works programatically but there is no place to put them in the Assets UI in the WorkStation, even when the "PRO" view is active:

     

     

    ConnectionFactoryAssetView.png

     

    So how do i assign user and password to a connection factory?



  • 4.  Re: JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password
    Best Answer

    Posted Jan 07, 2016 10:13 AM

    My bad, the username and password is on the JMS Connection asset, not the JMS Connection Factory.  In your project config, add a new asset, JMS -> JMS Connection -> JMS Generic Connection.  In this new asset select your JMS Connection Factory and enter your login info.



  • 5.  Re: JMS Assets: Getting Error "User name [null] or password is invalid" even when providing user and password

    Posted Jan 07, 2016 10:27 AM

    That worked, thank you.