I've already reported the issue long time ago. Now I don't see that issue in the list :( The problem is that when I'm using Authentication feature with JMS Publisher sample (ON "Use Authorization?" checkbox, with correct user/password) - the sample will fail with the error = "User name or password is invalid". Below is BeanShell sample that work fine with Authentication for the same JMS server. So, this is my proving that it is JMeter issue (means JMS Publisher sample). I believe that the issue is valid for JMS Subscriber as well. Workaround - disabling Authentication on JMS server. ============ import javax.jms.ConnectionFactory; import javax.jms.Connection; import javax.jms.Session; import javax.jms.MessageProducer; import javax.jms.MessageConsumer; import javax.jms.Queue; import javax.jms.Session; import javax.jms.Message; import javax.jms.TextMessage; //Import the classes to use JNDI. import javax.naming.*; import java.util.*; import org.apache.activemq.ActiveMQConnectionFactory; import org.apache.activemq.command.ActiveMQQueue; System.out.println("TEST"); String myhostname = "tcp://mdmcdocr-esbqa.mcgov.org:61616"; ConnectionFactory factory = new ActiveMQConnectionFactory(myhostname); connection = factory.createConnection("user", "password"); // connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); queue = session.createQueue("Elite_To_MorphoTrak"); MessageConsumer consumer = session.createConsumer(queue,"JMSCorrelationID='e884b430-c9fb-11e0-9279-79bc5a87f8d4'"); connection.start(); System.out.println("TEST 2"); Message myMessage = consumer.receive(2000); System.out.println("TEST 3"); session.close(); connection.close(); System.out.println("TEST 4"); // TextMessage txtMsg = (TextMessage) myMessage; // System.out.println("Read Message: " + txtMsg.getText()); System.out.println("Read Message: " + myMessage); System.out.println("TEST 6");
Hello, Can you post your JMX file. Are you sure you set JNDI properties for user and password ? Regards Philippe Mouawad
Created attachment 27496 [details] JMS Subscriber screenshot
I do not use "JNDI Properties" flag. See attached screenshot.
Created attachment 27522 [details] Test JMX Scenario that shows the issue. It works with ActiveMQ: It requires setting in credentials-enc.properties: activemq.username=system activemq.password=ENC(bNDG0WY3R49MCylXtUWfGW1SAy563g6E) guest.password=ENC(bNDG0WY3R49MCylXtUWfGW1SAy563g6E) And using activemq-security.xml and changing: <authenticationUser username="system" password="${activemq.password}" groups="users,admins"/> And starting it with: export ACTIVEMQ_ENCRYPTION_PASSWORD=activemq /activemq start xbean:conf/activemq-security.xml
Created attachment 27523 [details] Fix to the issue Hello, Here is the fix, it fixes the following issues related to this: 1) Issue in JMS Subscriber and JMS Publisher with the checkbox, when "Use Authorization" is checked User name and password are disabled (which is wrong) => I fixed it 2) Issue in Utils where createConnection was not called with user/password => That's why it didn't work 3) Issue if you have a mix of Authenticated connection and not Regards Philippe Mouawad
Thanks again! Fix applied: URL: http://svn.apache.org/viewvc?rev=1172077&view=rev Log: Bug 51691 - Authorization does not work for JMS Publisher and JMS Subscriber Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/InitialContextFactory.java jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSPublisherGui.java jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/control/gui/JMSSubscriberGui.java jakarta/jmeter/trunk/xdocs/changes.xml
*** Bug 51667 has been marked as a duplicate of this bug. ***
Jmeter 2.5.1 (r1177103) Simple TP - just one "JMS Subscriber" sample (see YH1168.jpg attached). Run from GUI produces "NullPoinerException" error - see jmeter.log attached; I'm using activemq-all-5.3.1.jar (attached). The file has to be placed into "lib\ext" directory. So, the issue is reopened. Question: why activemq-all-5.3.1.jar has to be placed into "lib\ext" rather than just into "lib" directory?
Created attachment 27734 [details] jmeter log
Created attachment 27735 [details] Test Plan screenshot
Sorry cannot attach activemq-all-5.3.1.jar due to size-limiting.
Please attach: - activemq configuration files, no need for jar - test plan not just screenshot - any file you use in test plan Thank you
Also try to replace in your test variables by their real values to exclude any misloading of CVS. Test against ActiveMQ5 is OK for me with one subscriber as in your Test Plan. Regards Philippe
Hi Philippe, 1) why do you ask for activemq files if the java-code in Description works fine; NP, I will provide; 2) it does not work when I provide user/password by their values; 3) Jmeter 2.4 provides handled-error that user/paswword is not correct;
1) activemq conf files are attached (some security files are not included); 2) TP is attached; 3) TP is simplified and does not use any data files; 4) TP is updated to not use variables;
Created attachment 27739 [details] activemq conf files
Created attachment 27740 [details] jmeter test plan
Once again, the java-code provided in the description works fine with my activemq configuration (username and password need to change).
I reproduced NPE with your test case. Regarding your question, you can put libraries in lib also. Issue has been fixed in trunk by fixing 51996. But your test plan also enabled me to see a NPE that occurs when user/password is wrong, fix will be available within minutes. So thank you very much. Regards Philippe
(In reply to comment #19) > I reproduced NPE with your test case. > Regarding your question, you can put libraries in lib also. > > Issue has been fixed in trunk by fixing 51996. Start Of wrong comment > But your test plan also enabled me to see a NPE that occurs when user/password > is wrong, fix will be available within minutes. > Ignore from "Start Of wrong comment" > So thank you very much. > Regards > Philippe
Date: Sat Oct 8 19:06:06 2011 New Revision: 1180462 URL: http://svn.apache.org/viewvc?rev=1180462&view=rev Log: Bug 51691 - Authorization does not work for JMS Publisher and JMS Subscriber Adding some comments just to clarify why 51996 fix fixes this NPE issue Modified: jakarta/jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/client/InitialContextFactory.java jakarta/jmeter/trunk/xdocs/changes.xml
Hello Yaroslav, You can test if fix is OK by getting ,nightly build at: https://builds.apache.org/job/JMeter-trunk/lastSuccessfulBuild/artifact/trunk/dist/ Regards Philippe
Verified r1183374 The issue has been passed QA
Thanks for verification. Marking issue as RESOLVED to avoid it appearing in Bug Report.
This issue has been migrated to GitHub: https://github.com/apache/jmeter/issues/2515