Uploaded image for project: 'Felix'
  1. Felix
  2. FELIX-2108

The log4j from felix launcher is messing up felix osgi container

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Invalid
    • framework-1.4.1
    • None
    • Framework

    Description

            • This issue is not type question rather than a bug ****

      I have created a launcher programme which is responsible for laoding the config values and instantiating the felix container (1.4.1).

      Everything is working fine except for one small glitch. Please take a look for following error message thrown by the log4j bundle.

      The launcher programme is using log4j for logging. But when it starts the felix container, log4j bundle is installed since it is used by the application itself.
      I have listed deployed bundles further below.

      My view is, the log4j library loaded by launcher is visible to felix container and hence log4j bundle fails to start cleanly. This is going to be a big problem for dpeloyment.

      I am using felix 1.4.1, is that too old to be good?

      Is there any setting that I need to pass to instruct the felix to create comepletly new classloader as system-classloader? Being a OSGI container I expected it to create new class-loader as system-classloader but now I feel it does not.

      Can someome please help me understand?

      Shrini

      ===

      log4j: reset attribute= "false".
      log4j: Threshold ="null".
      log4j: Level value for root is [DEBUG].
      log4j: root level set to DEBUG
      log4j: Class name: [org.apache.log4j.RollingFileAppender]
      log4j: Setting property [file] to [**************/launcher.log].
      log4j: Setting property [append] to [true].
      log4j: Setting property [maxFileSize] to [10MB].
      log4j: Setting property [maxBackupIndex] to [15].
      log4j: Parsing layout of class: "org.apache.log4j.PatternLayout"
      log4j: Setting property [conversionPattern] to [%d

      {dd MMM yyyy HH:mm:ss,SSS}

      %t %-5p %c

      {2}

      - %m%n].
      log4j: setFile called: **************/launcher.log, true
      log4j: setFile ended
      log4j: Adding appender named [FILE] to category [root].
      -> log4j:ERROR A "org.apache.log4j.xml.DOMConfigurator" object is not assignable to a "org.apache.log4j.spi.Configurator" variable.
      log4j:ERROR The class "org.apache.log4j.spi.Configurator" was loaded by
      log4j:ERROR [6.0] whereas object of type
      log4j:ERROR "org.apache.log4j.xml.DOMConfigurator" was loaded by [sun.misc.Launcher$AppClassLoader@17182c1].
      log4j:ERROR Could not instantiate configurator [org.apache.log4j.xml.DOMConfigurator].
      log4j:WARN No appenders could be found for logger (org.springframework.osgi.extender.internal.activator.ContextLoaderListener).
      log4j:WARN Please initialize the log4j system properly.

      =====

      [ 0] [Active ] [ 0] System Bundle (2.0.1)
      [ 1] [Active ] [ 5] AOP Alliance API (1.0.0)
      [ 2] [Active ] [ 5] Apache Commons Collections (3.2.0)
      [ 3] [Active ] [ 5] Apache Commons Lang (2.4.0)
      [ 4] [Active ] [ 5] Apache Commons Logging (1.1.1)
      [ 5] [Active ] [ 5] Apache Commons Pool (1.3.0)
      [ 6] [Active ] [ 5] Apache Log4J (1.2.15)
      [ 7] [Active ] [ 5] Apache Felix Bundle Repository (1.4.2)
      [ 8] [Active ] [ 5] Apache Felix Shell Service (1.4.1)
      [ 9] [Active ] [ 5] Apache Felix Shell TUI (1.4.1)
      [ 10] [Active ] [ 5] Spring AOP (2.5.6)
      [ 11] [Active ] [ 5] Spring Beans (2.5.6)
      [ 12] [Active ] [ 5] Spring Context (2.5.6)
      [ 13] [Active ] [ 5] Spring Context Support (2.5.6)
      [ 14] [Active ] [ 5] Spring Core (2.5.6)
      [ 15] [Active ] [ 5] spring-osgi-core (1.2.1)
      [ 16] [Active ] [ 5] spring-osgi-extender (1.2.1)
      [ 17] [Active ] [ 5] spring-osgi-io (1.2.1)

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

      Attachments

        1. felix-launcher.zip
          1.25 MB
          Shrini Joshi
        2. log4jconfig_1.0.0.jar
          0.7 kB
          Shrini Joshi
        3. osgi-simple-service.zip
          1.07 MB
          Shrini Joshi

        Activity

          People

            karlpauls Karl Pauls
            shreeneewas Shrini Joshi
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: