Thanks for the update ;)

Good catch.

Regards
JB

On 11/26/2012 10:28 AM, Bengt Rodehav wrote:
Mystery solved. It turned out that this server had BackupExec installed.
BackupExcec. That installation had done the following to the CLASSPATH
environment variable:

CLASSPATH=C:\Program Files\VERITAS\Backup
Exec\NT\ECM\bumodule.jar;C:\Program Files\VERITAS\Backup
Exec\NT\ECM\LOG4J-CORE.JAR;C:\Program Files\VERITAS\Backup
Exec\NT\ECM\LOG4J.JAR;.

So, log4j was added to the application classpath and therefore collided
with the exports from pax-logging.

Still, Equinox seems to handle this nicely while Felix does not.

/Bengt


2012/11/26 Bengt Rodehav <[email protected] <mailto:[email protected]>>

    Interestingly, if I use Equinox instead of Felix, Karaf starts with
    no problems. I tried this since the error messages indicate that
    there seem to be some problem between Felix classloading and the JVM
    default class loader (I think).

    /Bengt


    2012/11/26 Bengt Rodehav <[email protected] <mailto:[email protected]>>

        JB and Achim,

        I've tried with a standard Karaf 2.3.0 - without any
        customizations - and I still get this problem. Therefore, the
        etc/org.ops4j.pax.logging.cfg and the etc/jre.properties are the
        ones bundled with Karaf.

        There seems to be no other bundle exporting log4j:

        karaf@root> exports | grep -i log4j
              4 org.apache.log4j; version=1.2.15
              4 org.apache.log4j.spi; version=1.2.15
              4 org.apache.log4j.xml; version=1.2.15

        Bundle #4 is the pax-logging-api bundle (version 1.7.0).

        I realize that there must be a problem - or at least somethning
        very unusual - with the server I'm trying to install to since it
        works everywhere else. Just can't figure out what...

        /Bengt



        2012/11/26 Achim Nierbeck <[email protected]
        <mailto:[email protected]>>

            Another possibility, is there another bundle installed that
            also exports log4j classes?

            you'll be able to find such bundles with a packages:exports
            on the shell

            regards, Achim


            2012/11/26 Jean-Baptiste Onofré <[email protected]
            <mailto:[email protected]>>

                Hi Bengt,

                it may require some tweak on the etc/jre.properties, to
                prevent the JVM to load some classes.

                Could you share your etc/org.ops4j.pax.logging.cfg file
                to try to reproduce the issue ?

                Thanks,
                Regards
                JB


                On 11/26/2012 09:34 AM, Bengt Rodehav wrote:

                    I have the strangest of problems on one of my
                    installations. I have a
                    custom server based on Karaf 2.3.0. I have installed
                    it in several
                    places with no problem. But, on one of our virtual
                    servers running
                    Windows Server 2003 SP2, I cannot start Karaf
                    correctly due to the
                    following:

                    log4j:ERROR A "org.apache.log4j.TTCCLayout" object
                    is not assignable to
                    a "org.apache.log4j.Layout" variable.
                    log4j:ERROR The class "org.apache.log4j.Layout" was
                    loaded by
                    log4j:ERROR
                    [org.apache.felix.framework.__BundleWiringImpl@73305c]
                    whereas
                    object of type
                    log4j:ERROR "org.apache.log4j.TTCCLayout" was loaded by
                    [sun.misc.Launcher$__AppClassLoader@360be0].
                    log4j:ERROR A "org.apache.log4j.TTCCLayout" object
                    is not assignable to
                    a "org.apache.log4j.Layout" variable.
                    log4j:ERROR The class "org.apache.log4j.Layout" was
                    loaded by
                    log4j:ERROR
                    [org.apache.felix.framework.__BundleWiringImpl@73305c]
                    whereas
                    object of type
                    log4j:ERROR "org.apache.log4j.TTCCLayout" was loaded by
                    [sun.misc.Launcher$__AppClassLoader@360be0].
                    log4j:ERROR A "org.apache.log4j.TTCCLayout" object
                    is not assignable to
                    a "org.apache.log4j.Layout" variable.
                    log4j:ERROR The class "org.apache.log4j.Layout" was
                    loaded by
                    log4j:ERROR
                    [org.apache.felix.framework.__BundleWiringImpl@73305c]
                    whereas
                    object of type
                    log4j:ERROR "org.apache.log4j.TTCCLayout" was loaded by
                    [sun.misc.Launcher$__AppClassLoader@360be0].

                    I then tried with a standard Karaf 2.3.0 and got the
                    exact same error.

                    The above errors only show up in the console since
                    the logging system
                    cannot initialize properly. It seems like a strange
                    classloading issue
                    but I fail to understand how it can happen. It looks
                    like the JVM itself
                    has loaded log4j classes making them incompatible
                    with the "real" ones.

                    Has anyone seen this before? Any clues?

                    It's 32 bit Windows and I've tried with java
                    1.6.0_29 as well as 1.6.0_37.

                    /Bengt


                --
                Jean-Baptiste Onofré
                [email protected] <mailto:[email protected]>
                http://blog.nanthrax.net
                Talend - http://www.talend.com




            --

            Apache Karaf <http://karaf.apache.org/> Committer & PMC
            OPS4J Pax Web
            <http://wiki.ops4j.org/display/paxweb/Pax+Web/> Committer &
            Project Lead
            OPS4J Pax for Vaadin
            <http://team.ops4j.org/wiki/display/PAXVAADIN/Home> Commiter
            & Project Lead
            blog <http://notizblog.nierbeck.de/>





--
Jean-Baptiste Onofré
[email protected]
http://blog.nanthrax.net
Talend - http://www.talend.com

Reply via email to