Uploaded image for project: 'Axis2'
  1. Axis2
  2. AXIS2-5824

[Transport][JMS] Change thrown exception

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Trivial
    • Resolution: Fixed
    • 1.7.4
    • 1.7.5
    • JMS transport
    • None
    • Patch

    Description

      When we tries to lookup some destination for example "my.loc.dest" and it doesn't exist than we handle exception with message:
      While trying to lookup 'dynamicQueues.local.rmk.access.SMKtoRMK.dq' didn't find subcontext 'dynamicQueues'. Resolved '' (for Weblogic)

      I'd offer to change JMSUtils.lookupDestination from:

          public static Destination lookupDestination(Context context, String destinationName,
                                                      String destinationType) throws NamingException {
      
              if (destinationName == null) {
                  return null;
              }
      
              try {
                  return JMSUtils.lookup(context, Destination.class, destinationName);
              } catch (NameNotFoundException e) {
                  try {
                      return JMSUtils.lookup(context, Destination.class,
                          (JMSConstants.DESTINATION_TYPE_TOPIC.equalsIgnoreCase(destinationType) ?
                              "dynamicTopics/" : "dynamicQueues/") + destinationName);
                  } catch (NamingException x) {
                      log.warn("Cannot locate destination : " + destinationName);
                      throw x;
                  }
              } catch (NamingException e) {
                  log.warn("Cannot locate destination : " + destinationName, e);
                  throw e;
              }
          }
      

      to:

          public static Destination lookupDestination(Context context, String destinationName,
                                                      String destinationType) throws NamingException {
      
              if (destinationName == null) {
                  return null;
              }
      
              try {
                  return JMSUtils.lookup(context, Destination.class, destinationName);
              } catch (NameNotFoundException e) {
                  try {
                      return JMSUtils.lookup(context, Destination.class,
                          (JMSConstants.DESTINATION_TYPE_TOPIC.equalsIgnoreCase(destinationType) ?
                              "dynamicTopics/" : "dynamicQueues/") + destinationName);
                  } catch (NamingException x) {
                      log.warn("Cannot locate destination : " + destinationName);
                      throw e;
                  }
              } catch (NamingException e) {
                  log.warn("Cannot locate destination : " + destinationName, e);
                  throw e;
              }
          }
      

      Attachments

        Activity

          People

            veithen Andreas Veithen
            WinZib Ziborov Egor
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: