1 Reply Latest reply on Nov 30, 2012 6:56 AM by Nicklas Karlsson

    Datasource Lifecycle - Custom Log Handler

    fhauschel Newbie

      Hi all,

      I'm creating a custom log handler as described here: https://community.jboss.org/wiki/CustomLogHandlersOn701

      But I will use my datasource configured in the standalone.xml and access it via jndi.


      No JBOSS tells me "Error looking up xysDS, service service jboss.naming.context.java.xyzDS is not started."

      Does anybody have an idea how the lifecycle of the modules, jndi objects, datasources is? Or where I can find some documentation?


      Thanks Fredy

        • 1. Re: Datasource Lifecycle - Custom Log Handler
          Nicklas Karlsson Master

          The logging subsystem is probably one of the first to be brought up so If you want to use a connection pool from the AS JNDI, I don't think you can do much more than have a "initialized" flag and when a log request comes in, check if the initialized=false, try the JNDI lookup and if it fails, you drop the log message and if it works, you set intialized=true and do your logging. I'm not sure if JNDI lookup from a logger is that future-proof, I think I heard talks about at one point of not being guaranteed in future releases.