Help: Use of slf4j in jacorb

"ZION Stephane (SAFRAN ELECTRONICS & DEFENSE)" <[email protected]> Thu, 27 Aug 2020 07:39:38 +0000
Newsgroups gmane.comp.corba.jacorb.devel
Message-ID <[email protected]>
Hi everyone,

I try to use Jacorb 3.9 (as I used 2.3 before).
When launching my application, I got one exception when loading the web.xml=
 :

SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explana=
tion.
SLF4J: Actual binding is of type [org.slf4j.impl.JDK14LoggerFactory]
sept. 04, 2020 5:39:09 AM org.apache.catalina.core.StandardContext
listenerStart
GRAVE: Exception lors de l'envoi de l'=E9v=E8nement contexte initialis=E9 (=
context initialized) =E0 l'instance de classe d'=E9coute (listener) com.ser=
ver.PrintLogStatusListener

java.lang.ClassCastException: org.slf4j.impl.JDK14LoggerFactory cannot be c=
ast to ch.qos.logback.classic.LoggerContext
at   com.server.PrintLogStatusListener.contextInitialized(PrintLogStatusLis=
tener.java:25)
at   org.apache.catalina.core.StandardContext.listenerStart(StandardContext=
.java:5127)
at   org.apache.catalina.core.StandardContext.startInternal(StandardContext=
.java:5643)
at   org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:145)
at   org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.=
java:899)
at   org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:875)
at   org.apache.catalina.core.StandardHost.addChild(StandardHost.java:652)
at   org.apache.catalina.startup.HostConfig.deployDirectory(HostConfig.java=
:1260)
at   org.apache.catalina.startup.HostConfig$DeployDirectory.run(HostConfig.=
java:2002)
at   java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at   java.util.concurrent.FutureTask.run(FutureTask.java:266)
at   java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.j=
ava:1149)
at   java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.=
java:624)
at   java.lang.Thread.run(Thread.java:748)


PrintLogStatusListener is defined like this in the web.xml:
<listener>
    <listener-class>com.server.PrintLogStatusListener</listener-class>
  </listener>



My PrintLogStatusListener class looks like this:

import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.util.StatusPrinter;
import org.slf4j.LoggerFactory;

public class PrintLogStatusListener implements ServletContextListener,
                                               HttpSessionListener, HttpSes=
sionAttributeListener {

                                                 // -----------------------=
--------------------------------
          // ServletContextListener implementation
          // -------------------------------------------------------
          public void contextInitialized( ServletContextEvent sce ) {
            LoggerContext lc =3D ( LoggerContext ) LoggerFactory.getILogger=
Factory();
            StatusPrinter.print( lc );
          }
  }

  I think the pb deals with a conflict between slf4j and logback. The 3.9 j=
acorb version seems to impose the use of slf4j (via loads slf4j-api-1.7.14.=
jar).
  I Use JAVA_ENDORSED_DIRS=3D/opt/Jacorb/3.9.1/lib

  How could I solve my pb? Thanks for your help ;)

  St=E9phane


#
" Ce courriel et les documents qui lui sont joints peuvent contenir des inf=
ormations confidentielles, =EAtre soumis aux r=E8glementations relatives au=
 contr=F4le des exportations ou ayant un caract=E8re priv=E9. S'ils ne vous=
 sont pas destin=E9s, nous vous signalons qu'il est strictement interdit de=
 les divulguer, de les reproduire ou d'en utiliser de quelque mani=E8re que=
 ce soit le contenu. Toute exportation ou r=E9exportation non autoris=E9e e=
st interdite Si ce message vous a =E9t=E9 transmis par erreur, merci d'en i=
nformer l'exp=E9diteur et de supprimer imm=E9diatement de votre syst=E8me i=
nformatique ce courriel ainsi que tous les documents qui y sont attach=E9s."
******
" This e-mail and any attached documents may contain confidential or propri=
etary information and may be subject to export control laws and regulations=
. If you are not the intended recipient, you are notified that any dissemin=
ation, copying of this e-mail and any attachments thereto or use of their c=
ontents by any means whatsoever is strictly prohibited. Unauthorized export=
 or re-export is prohibited. If you have received this e-mail in error, ple=
ase advise the sender immediately and delete this e-mail and all attached d=
ocuments from your computer system."
#
_______________________________________________
jacorb-developer maillist  -  [email protected]
https://lists.spline.inf.fu-berlin.de/mailman/listinfo/jacorb-developer