Uploaded image for project: 'logback'
  1. logback
  2. LOGBACK-438

JNDIUtil.lookup always cast the JNDI lookup result to a String

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.1.0
    • 0.9.27
    • logback-classic
    • None

    Description

      JNDIUtil.lookup always cast the JNDI lookup result to a String.
      This method should support other object types like: java.net.URL, ...

      Description:
      1. In our environment, we have declared a variable in Websphere that holds a URL.
      2. We use an <insertFromJNDI /> tag.
      3. Then the following exception is thrown:
      ERROR in ch.qos.logback.core.joran.spi.Interpreter@4:71 - RuntimeException in Action for tag [insertFromJNDI] java.lang.ClassCastException: java.net.URL incompatible with java.lang.String
      at java.lang.ClassCastException: java.net.URL incompatible with java.lang.String
      at at ch.qos.logback.classic.util.JNDIUtil.lookup(JNDIUtil.java:38)
      at at ch.qos.logback.classic.joran.action.InsertFromJNDIAction.begin(InsertFromJNDIAction.java:62)
      at at ch.qos.logback.core.joran.spi.Interpreter.callBeginAction(Interpreter.java:273)
      at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:145)
      at at ch.qos.logback.core.joran.spi.Interpreter.startElement(Interpreter.java:127)
      at at ch.qos.logback.core.joran.spi.EventPlayer.play(EventPlayer.java:40)
      at at ch.qos.logback.core.joran.spi.Interpreter.play(Interpreter.java:332)
      at at ch.qos.logback.core.joran.GenericConfigurator.doConfigure(GenericConfigurator.java:126)

      Attachments

        Activity

          People

            tony19 Tony Trinh
            maxence.dewil Maxence Dewil
            Votes:
            1 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: