2 Replies Latest reply on Mar 22, 2007 7:35 AM by jbarthel

    JBOSS 4.0.5 Shutdown : Failed to initalize plugin: org.jboss

    vk.iyengar

      We wanted to use our own Log4j component to log our application messages. I used RepositorySelector implementation provided in one of the jboss wiki site. Everything works fine, except when i shutdown, i am getting this error during jboss undeployment of /jbossmq-httpil.war and unbound ConnectionManager. I also tried specifying explictly the logger plugin as JVM argument, no luck. Please help. FYI we are using Jboss 4.0.5.

      Thanks

      ERROR [STDERR] Failed to initalize plugin: org.jboss.logging.Log4jLoggerPlugin@c1c7c4

        • 1. Re: JBOSS 4.0.5 Shutdown : Failed to initalize plugin: org.j
          jbarthel

          Hi, we are getting the same problem here, please elaborate if you make any progress.

          Thanks,
          jb

          • 2. Re: JBOSS 4.0.5 Shutdown : Failed to initalize plugin: org.j
            jbarthel

            Ok, I have a solution to this error, which works for me.

            The general problem is that when JBoss AS is shutdown, the application which contains the custom RepositorySelector implementation is undeployed.
            This means that other applications which are undeployed during server shutdown _after_ this, still try to access the custom RepositorySelector through the LogManager if they log during undeployment. This results in a NullPointerException, since the referenced RepositorySelector is already gone.

            The NPE is thrown in jboss.Logger.getDelegate(String name) while trying to initialize the LoggerPlugin (a Log4jLoggerPlugin by default), and is caught without printing the stacktrace and printing the "failed to initalize" message instead.

            In order to prevent this, the RepositorySelector of LogManager needs to be set to a DefaultRepositorySelector during undeployment of our application.
            for example:

            LogManager.setRepositorySelector(new DefaultRepositorySelector(defaultRepository), guard);


            where defaultRepository is the default LoggerRepository and guard is the RootLogger of LogManager which I have saved during the initialization of my custom RepositorySelector