redhawk icon indicating copy to clipboard operation
redhawk copied to clipboard

V3.0.0 encounters error in Basic Sandbox example - Can't find appenders for log4j

Open smgutstein opened this issue 2 years ago • 0 comments

I've compiled RedhawkSDR v3.0.0 within a Docker container and tried to implement the Basic Sandbox Example from RedhawkSDR's manual . However, I've encountered the problem shown below:

$ docker run -it docker-redhawk3.0.0-src

[root@2c65bf0659d7 Redhawk_User]# python3
Python 3.6.8 (default, Nov 16 2020, 16:55:22) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-44)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from ossie.utils import sb
>>> sb.catalog()
['rh.AmFmPmBasebandDemod', 'rh.ArbitraryRateResampler', 'rh.DataConverter', 'rh.FileReader', 'rh.FileWriter', 'rh.HardLimit', 'rh.RBDSDecoder', 'rh.SigGen', 'rh.SinkSDDS', 'rh.SinkVITA49', 'rh.SourceSDDS', 'rh.SourceVITA49', 'rh.TuneFilterDecimate', 'rh.agc', 'rh.autocorrelate', 'rh.fastfilter', 'rh.fcalc', 'rh.psd', 'rh.psk_soft', 'rh.sinksocket', 'rh.sourcesocket']
>>> sigGen = sb.launch("rh.SigGen")
>>> hardLimit = sb.launch("rh.HardLimit")
>>> sb.IDELocation("/eclipse")
>>> plot = sb.Plot()
>>> sigGen.connect(hardLimit)
>>> hardLimit.connect(plot)
>>> log4j:WARN No appenders could be found for logger (jacorb.config).
log4j:WARN Please initialize the log4j system properly.
Plotter: Cannot open display: 

(Note: The error takes about 5 sec to appear, which is why the >>> prompt appears before the error message.)

I've Googled this error and found a relevant StackOverflow entry(https://stackoverflow.com/questions/12532339/no-appenders-could-be-found-for-loggerlog4j). I also looked at the section on logging in the Redhawk (https://redhawksdr.org/3.0.1/html/Logging/configuring-logging-capabilities.html) I got the impression that if I created a file called log4j.properties and either indicated where it was by including it in the Java CLASSPATH environment variable, or placed it in the directory with the log4j jar files, then this error would be resolved.

A reasonable default for this file was given as: (Note: Multiple answers in StackOverflow had the bottom formatted string without quotes, but the Redhawk version used quotes. I tried with & without, but without success):

# Root logger option
log4j.rootLogger=INFO, stdout

# Direct log messages to stdout
log4j.appender.stdout=org.apache.log4j.ConsoleAppender
log4j.appender.stdout.Target=System.out
log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
log4j.appender.stdout.layout.ConversionPattern=%d{yyyy-MM-dd HH:mm:ss} %-5p %c{1}:%L - %m%n

However, adding this file in both locations did not solve the problem. I also tried adding the directory with log4j jar files to the CLASSPATH variable, but without success.

At this point, I don't know what to do. How can I fix the log4j errors? How can I open the plotter? Is the plotter not opening a function of the log4j errors or does it have something to do with my use of Docker?

smgutstein avatar Jan 11 '23 00:01 smgutstein