[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: NPEs are not acceptable error messages

adrian@jboss.org do-not-reply at jboss.com
Tue Dec 4 12:17:48 EST 2007


"adrian at jboss.org" wrote : Then when you shutdown the server you get all sorts of NPEs.
  | 

Although it looks like I just fixed this problem by fixing the test to undeploy
the test queues/topics. Try reverting my fix to see the issue,
since there is obviously some problem here:

  | [ejort at warjort testsuite]$ svn diff
  | Index: src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java
  | ===================================================================
  | --- src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java       (revision 67850)
  | +++ src/main/org/jboss/test/mdb/test/MDBUnitTestCase.java       (working copy)
  | @@ -291,27 +291,53 @@
  |                             "jboss.messaging.destination:service=Queue,name=DLQ"),
  |                       "removeAllMessages", new Object[0], new String[0]);
  |              }
  | -            catch (Exception e)
  | +            catch (Exception ignored)
  |              {
  | -               e.printStackTrace();
  | +               getLog().warn("unable to clear dlq", ignored);
  |              }
  |  
  |              ClassLoader loader = Thread.currentThread().getContextClassLoader();
  | -            undeploy("mdb.jar");
  | +            try
  | +            {
  | +               undeploy("mdb.jar");
  | +            }
  | +            catch (Exception ignored)
  | +            {
  | +               getLog().warn("Unable to undeploy mdb.jar", ignored);
  | +            }
  |  
  | -            // Remove the durable subscription
  | -            TopicConnectionFactory topicFactory = (TopicConnectionFactory) getInitialContext()
  | -                  .lookup(TOPIC_FACTORY);
  | -            TopicConnection topicConnection = topicFactory
  | -                  .createTopicConnection("john", "needle");
  | -            TopicSession session = topicConnection.createTopicSession(false,
  | -                  Session.AUTO_ACKNOWLEDGE);
  | -            session.unsubscribe("DurableSubscriberExample");
  | -            topicConnection.close();
  | +            try
  | +            {
  | +               // Remove the durable subscription
  | +               TopicConnectionFactory topicFactory = (TopicConnectionFactory) getInitialContext()
  | +                     .lookup(TOPIC_FACTORY);
  | +               TopicConnection topicConnection = topicFactory
  | +                     .createTopicConnection("john", "needle");
  | +               try
  | +               {
  | +                  TopicSession session = topicConnection.createTopicSession(false,
  | +                     Session.AUTO_ACKNOWLEDGE);
  | +                  session.unsubscribe("DurableSubscriberExample");
  | +               }
  | +               finally
  | +               {
  | +                  topicConnection.close();
  | +               }
  | +            }
  | +            catch (Exception ignored)
  | +            {
  | +               getLog().warn("Unable to unsubscribe", ignored);
  | +            }
  |  
  | -            undeploy(loader.getResource(
  | +            try
  | +            {
  | +               undeploy(loader.getResource(
  |                    "messaging/test-destinations-full-service.xml").toString());
  | -
  | +            }
  | +            catch (Exception ignored)
  | +            {
  | +               getLog().warn("Unable to remove destinations", ignored);
  | +            }
  |           }
  |        };
  | 

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4110270#4110270

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4110270



More information about the jboss-dev-forums mailing list