Rob Godfrey created QPIDJMS-227:
-----------------------------------

             Summary: NullPointerException on closing anonymous producer
                 Key: QPIDJMS-227
                 URL: https://issues.apache.org/jira/browse/QPIDJMS-227
             Project: Qpid JMS
          Issue Type: Bug
          Components: qpid-jms-client
            Reporter: Rob Godfrey
            Priority: Minor


Creating and then closing an anonymous producer causes a NullPointerException

the following code:

{code}
public void testDummy() throws Exception
{
    Session session = _connection.createSession(false, 
Session.AUTO_ACKNOWLEDGE);
    MessageProducer producer = session.createProducer(null);
    producer.close();
}
{code}

gives rise the the following stack trace

{code}
javax.jms.JMSException: java.lang.NullPointerException

        at 
org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:66)
        at 
org.apache.qpid.jms.exceptions.JmsExceptionSupport.create(JmsExceptionSupport.java:88)
        at 
org.apache.qpid.jms.JmsConnection.destroyResource(JmsConnection.java:614)
        at 
org.apache.qpid.jms.JmsConnection.destroyResource(JmsConnection.java:598)
        at 
org.apache.qpid.jms.JmsMessageProducer.doClose(JmsMessageProducer.java:91)
        at 
org.apache.qpid.jms.JmsMessageProducer.close(JmsMessageProducer.java:79)
        at 
org.apache.qpid.test.unit.basic.InvalidDestinationTest.testDummy(InvalidDestinationTest.java:62)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at junit.framework.TestCase.runTest(TestCase.java:176)
        at 
org.apache.qpid.test.utils.QpidTestCase.runTest(QpidTestCase.java:172)
        at junit.framework.TestCase.runBare(TestCase.java:141)
        at 
org.apache.qpid.test.utils.QpidBrokerTestCase.runBare(QpidBrokerTestCase.java:116)
        at junit.framework.TestResult$1.protect(TestResult.java:122)
        at junit.framework.TestResult.runProtected(TestResult.java:142)
        at junit.framework.TestResult.run(TestResult.java:125)
        at junit.framework.TestCase.run(TestCase.java:129)
        at org.apache.qpid.test.utils.QpidTestCase.run(QpidTestCase.java:156)
        at junit.framework.TestSuite.runTest(TestSuite.java:255)
        at junit.framework.TestSuite.run(TestSuite.java:250)
        at 
org.junit.internal.runners.JUnit38ClassRunner.run(JUnit38ClassRunner.java:84)
        at org.junit.runner.JUnitCore.run(JUnitCore.java:160)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)
        at 
com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)
        at 
com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)
        at 
com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)
Caused by: java.io.IOException: java.lang.NullPointerException
        at 
org.apache.qpid.jms.util.IOExceptionSupport.create(IOExceptionSupport.java:45)
        at 
org.apache.qpid.jms.provider.ProviderFuture.failOnError(ProviderFuture.java:108)
        at 
org.apache.qpid.jms.provider.ProviderFuture.sync(ProviderFuture.java:102)
        at 
org.apache.qpid.jms.JmsConnection.destroyResource(JmsConnection.java:609)
        ... 25 more
Caused by: java.lang.NullPointerException
        at 
org.apache.qpid.jms.provider.amqp.AmqpAnonymousFallbackProducer.close(AmqpAnonymousFallbackProducer.java:112)
        at 
org.apache.qpid.jms.provider.amqp.AmqpProvider$7$1.processProducerInfo(AmqpProvider.java:425)
        at 
org.apache.qpid.jms.meta.JmsProducerInfo.visit(JmsProducerInfo.java:129)
        at 
org.apache.qpid.jms.provider.amqp.AmqpProvider$7.run(AmqpProvider.java:413)
        at 
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
        at 
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
        at 
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at 
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
{code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to