BTM
  1. BTM
  2. BTM-41

JNDI Context (BitronixContext) returns null rather than NameNotFoundException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.2
    • Fix Version/s: 1.3.3
    • Labels:
      None
    • Patch Submitted:
      Yes
    • Number of attachments :
      1

      Description

      JNDI clients expect to receive a NameNotFoundException rather than a null object when looking up an object with a name that does not exist.

      Suggest changing the implementation of lookup(String s) to the following:

      =======================================================
      public Object lookup(String s) throws NamingException

      { checkClosed(); if (log.isDebugEnabled()) log.debug("looking up '" + s + "'"); Object o = null; if (userTransactionName.equals(s)) o = TransactionManagerServices.getTransactionManager(); else o = ResourceRegistrar.get(s); if(o == null) throw new NameNotFoundException("unable to find a bound object at name '" + s + "'"); return o; }

      =======================================================

        Activity

        Hide
        Ludovic Orban added a comment -

        Fixed in trunk.

        Thanks for the report.

        Show
        Ludovic Orban added a comment - Fixed in trunk. Thanks for the report.

          People

          • Assignee:
            Ludovic Orban
            Reporter:
            James House
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: