Bug 56198

Summary: JMSSampler : NullPointerException is thrown when JNDI underlying implementation of JMS provider does not comply with Context.getEnvironment contract
Product: JMeter Reporter: Jayesh Guru <jayeshguru81>
Component: MainAssignee: JMeter issues mailing list <issues>
Status: RESOLVED FIXED    
Severity: minor CC: p.mouawad
Priority: P2    
Version: 2.6   
Target Milestone: ---   
Hardware: All   
OS: All   

Description Jayesh Guru 2014-02-27 22:55:58 UTC
Enabled Debug Log Level 
log_level.jmeter=DEBUG
log_level.jmeter.protocol.jms.sampler.JMSSampler=DEBUG

2014/02/24 09:56:27 DEBUG - jmeter.protocol.jms.sampler.JMSSampler: Empty JNDI properties 
2014/02/24 09:56:27 DEBUG - jmeter.protocol.jms.sampler.JMSSampler: Initial Context Properties 
2014/02/24 09:56:27 ERROR - jmeter.protocol.jms.sampler.JMSSampler:  java.lang.NullPointerException
	at org.apache.jmeter.protocol.jms.sampler.JMSSampler.printEnvironment(JMSSampler.java:435)
	at org.apache.jmeter.protocol.jms.sampler.JMSSampler.getInitialContext(JMSSampler.java:426)
	at org.apache.jmeter.protocol.jms.sampler.JMSSampler.threadStarted(JMSSampler.java:319)
	at org.apache.jmeter.threads.JMeterThread$ThreadListenerTraverser.addNode(JMeterThread.java:597)
	at org.apache.jorphan.collections.HashTree.traverseInto(HashTree.java:961)
	at org.apache.jorphan.collections.HashTree.traverse(HashTree.java:946)
	at org.apache.jmeter.threads.JMeterThread.threadStarted(JMeterThread.java:566)
	at org.apache.jmeter.threads.JMeterThread.initRun(JMeterThread.java:554)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:253)
	at java.lang.Thread.run(Thread.java:744)

2014/02/24 09:56:27 WARN  - jmeter.protocol.jms.sampler.JMSSampler: Session may not be null while creating message java.lang.IllegalStateException: Session may not be null while creating message
	at org.apache.jmeter.protocol.jms.sampler.JMSSampler.createMessage(JMSSampler.java:179)
	at org.apache.jmeter.protocol.jms.sampler.JMSSampler.sample(JMSSampler.java:140)
	at org.apache.jmeter.threads.JMeterThread.process_sampler(JMeterThread.java:429)
	at org.apache.jmeter.threads.JMeterThread.run(JMeterThread.java:257)
	at java.lang.Thread.run(Thread.java:744)
Comment 1 Jayesh Guru 2014-02-28 16:05:02 UTC
Getting NullPointerException while trying to run JMS Point to Point for my application. I have put all MQ jars in lib directory and also required Discovery Jars for application.
Comment 2 Philippe Mouawad 2014-02-28 23:07:53 UTC
Date: Fri Feb 28 22:53:29 2014
New Revision: 1573105

URL: http://svn.apache.org/r1573105
Log:
Bug 56198 - JMSSampler : NullPointerException is thrown when log level is DEBUG and JNDI underlying implementation of JMS provider does not comply with Context.getEnvironment contract
Bugzilla Id: 56198

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
    jmeter/trunk/xdocs/changes.xml

Date: Fri Feb 28 23:06:52 2014
New Revision: 1573108

URL: http://svn.apache.org/r1573108
Log:
Bug 56198 - JMSSampler : NullPointerException is thrown when JNDI underlying implementation of JMS provider does not comply with Context.getEnvironment contract
Apply check on every call of Context.getEnvironment
Bugzilla Id: 56198

Modified:
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/Utils.java
    jmeter/trunk/src/protocol/jms/org/apache/jmeter/protocol/jms/sampler/JMSSampler.java
    jmeter/trunk/xdocs/changes.xml