The logviewer program does not start (log4j?)

Hi,

My work environment is as follows.
  • Debian 11 (in VirtualBox)
  • prerequisites installed (mariadb, omniorb, sphinx…)
  • Tango 9.3.4 (from GitLab, and jar from Github)
  • database configuration (user, privileges…) done

tango-controls is built very well and I can start playing with the different components (astor, jive, pogo…). But one of them doesn't work: logviewer.

$ logviewer
Exception in thread "main" java.lang.NoClassDefFoundError: org/apache/log4j/Logger
at fr.esrf.logviewer.Main.<clinit>(Main.java:45)
Caused by: java.lang.ClassNotFoundException: org.apache.log4j.Logger
at java.net.URLClassLoader.findClass(URLClassLoader.java:382)
at java.lang.ClassLoader.loadClass(ClassLoader.java:418)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:352)
at java.lang.ClassLoader.loadClass(ClassLoader.java:351)
… 1 more


Any help is welcome.
I have the same problem with Tango 9.3.4 on a CentOS 8 machine with Java 1.8.0. See post-4682. I would be interested in a solution as well.

Thanks,
Andre
Hi guys,
The Java gurus will correct me if I'm wrong but your problem seems related to the fact that log4j is no longer in the jtango jar file(s). It means you need to install it somewhere and then add it to the CLASSPATH while launching the LogViewer. Clearly speaking, you have to edit logviewer.sh (launcher/script) and add the log4j.jar to the CLASSPATH.
Hi Nicolas,

Indeed log4j is no longer in /usr/local/share/java/ which contains the Java classes for Tango.

The easiest way I found for now is to install log4j (via official Debian packages) and then create a link in /usr/local/share/java/ directory:

$ sudo ln -s /usr/share/java/log4j-1.2.jar /usr/local/share/java/log4j.jar


The other scripts astor and jive (in /usr/local/bin/) define a reference to log4j which is located in the Tango Java classes directory (/usr/local/share/java/). It seems appropriate to create a ticket GitLab to correct this missing dependency. What do you think?
Hi JC,
Sorry for the late answer. We definitively have to fix that problem. Let's create an issue on gitlab and see what the gurus could propose. The proposed gitlab project (i.e., TangoSourceDistribution) seems to be the right place to create the this issue. Thanks for your contribution.
 
Register or login to create to post a reply.