Commons Logging
  1. Commons Logging
  2. LOGGING-102

[logging] Provide better error message than "No suitable Log implementation"

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.0
    • Labels:
      None
    • Environment:

      Operating System: other
      Platform: Other

      Description

      when trying to do a totally different ant task, I got with debug the following
      exception

      ...\build.xml:3125: java.lang.ExceptionInInitial
      izerError
      at
      org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:114)
      at org.apache.tools.ant.Task.perform(Task.java:365)
      at org.apache.tools.ant.Target.execute(Target.java:356)
      at org.apache.tools.ant.Target.performTasks(Target.java:384)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1236)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1205)
      at
      org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1088)
      at org.apache.tools.ant.Main.runBuild(Main.java:676)
      at org.apache.tools.ant.Main.startAnt(Main.java:195)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:265)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:87)
      Caused by: java.lang.ExceptionInInitializerError
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:551)
      at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:221)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:104)
      ... 11 more
      Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log
      implementation
      at
      org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:748)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:556)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:281)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:560)
      at org.apache.jasper.JspC.<clinit>(JspC.java:90)
      ... 20 more
      — Nested Exception —
      java.lang.ExceptionInInitializerError
      at java.lang.Class.forName0(Native Method)
      at java.lang.Class.forName(Class.java:242)
      at org.apache.tools.ant.taskdefs.Definer.addDefinition(Definer.java:551)
      at org.apache.tools.ant.taskdefs.Definer.execute(Definer.java:221)
      at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:275)
      at sun.reflect.GeneratedMethodAccessor1.invoke(Unknown Source)
      at
      sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
      at java.lang.reflect.Method.invoke(Method.java:585)
      at
      org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:104)
      at org.apache.tools.ant.Task.perform(Task.java:365)
      at org.apache.tools.ant.Target.execute(Target.java:356)
      at org.apache.tools.ant.Target.performTasks(Target.java:384)
      at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1236)
      at org.apache.tools.ant.Project.executeTarget(Project.java:1205)
      at
      org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:40)
      at org.apache.tools.ant.Project.executeTargets(Project.java:1088)
      at org.apache.tools.ant.Main.runBuild(Main.java:676)
      at org.apache.tools.ant.Main.startAnt(Main.java:195)
      at org.apache.tools.ant.launch.Launcher.run(Launcher.java:265)
      at org.apache.tools.ant.launch.Launcher.main(Launcher.java:87)
      Caused by: org.apache.commons.logging.LogConfigurationException: No suitable Log
      implementation
      at
      org.apache.commons.logging.impl.LogFactoryImpl.discoverLogImplementation(LogFactoryImpl.java:748)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.newInstance(LogFactoryImpl.java:556)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:307)
      at
      org.apache.commons.logging.impl.LogFactoryImpl.getInstance(LogFactoryImpl.java:281)
      at org.apache.commons.logging.LogFactory.getLog(LogFactory.java:560)
      at org.apache.jasper.JspC.<clinit>(JspC.java:90)
      ... 20 more

      Total time: 13 secondsClass org.apache.commons.logging.impl.LogFactoryImpl
      loaded from ant loader (parentFirst)
      Class java.lang.ExceptionInInitializerError loaded from parent loader (parentFirst)

      looking at the CVS head, there might be some relief:

      "User-specified log class " + specifiedLogClassName
      + " cannot be found or is not useable."

      but still, it would be really helpful to know what was missing from an admin
      point of view, so on top of the particular class name, it would be very useful,
      to get a hint at
      1) which jar (log4j.jar) that "specifiedLogClassName" most likely is included in?
      2) Or whether the config file was missing (log4j.properties?) and in
      3) which directories/jar files it was searched for...
      4) and what "logCategory" was being aimed for...

        Activity

        No work has yet been logged on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ralf Hauser
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development