Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No SLF4J providers found when using the standalone version #1520

Closed
Wer-Wolf opened this issue Jul 26, 2024 · 9 comments · Fixed by #1522
Closed

No SLF4J providers found when using the standalone version #1520

Wer-Wolf opened this issue Jul 26, 2024 · 9 comments · Fixed by #1522
Labels

Comments

@Wer-Wolf
Copy link

Describe the bug
When starting the downloaded fitnesse-standalone.jar by executing java -jar fitnesse-standalone.jar, no SLF4J providers are found and logging will be disabled.

This makes it hard to diagnose issues when the SLIM server refuses to start.

To Reproduce
Steps to reproduce the behavior:

  1. Download the latest standalone version
  2. Execute java -jar fitnesse-standalone.jar
  3. See SLF4J error

Expected behavior
Assuming that the standalone version bundles a SLF4J provider, this provider should automatically be selected.

Configuration:

  • OS: Windows 11
  • Browser: Firefox
  • Version: 20240707
  • Test System: Fit
  • Plugins in use: None

Additional context
I am using the prebuild OpenJDK 11 version provided by Microsoft.

@Wer-Wolf Wer-Wolf added the Bug label Jul 26, 2024
@fhoeben
Copy link
Collaborator

fhoeben commented Jul 26, 2024

Issues starting a test system normally show up in the 'Execution' log that can be reached from the wiki page, after you started the test. Is there any relevant information there.

Usage of an slf4j implementation is always a bit tricky for FitNesse given that it is both a library and a separate process. When used as a library we want to allow the fixture (or System Under Test) code to be able to choose its implementation for logging and FitNesse should not get in the way. When starting a server it would be best to have an slf4j implementation activated. I actually thought we did bundle and activate one that would cause logging to go to the console.

But I have to admit I haven't looked at this in a long time, never had any need for logging of the wiki server. I'm fairly sure the Execution Log will contain the information needed to trouble shoot the issue you are having

@Wer-Wolf
Copy link
Author

The execution log contains no information besides that the slim server failed to start. I also found out that when using the official Java 8 JRE together with an older FitNesse version, the logging works.

I suspect that this has something to do with the OpenJDK installation.

@six42
Copy link
Contributor

six42 commented Jul 27, 2024 via email

@Wer-Wolf
Copy link
Author

Even the command is not displayed inside the execution log.

It is however displayed together with a Exception when using the official Java 8 JRE.

@six42
Copy link
Contributor

six42 commented Aug 12, 2024

Hi Wer-Wolf,
I tried the same configuration which you mentioned: Winows 11, openJDK11 and Fitnesse 20240707.
It is correct that at startup it logs that no SLF4J provider is found.
This has no influence on running the system and executing tests. They all work without problems.
Tried:
http://localhost/FitNesse.SuiteAcceptanceTests.SuiteFitDecoratorTests.MaxTimeDivision?test
http://localhost/FitNesse.UserGuide.TwoMinuteExample?test

Can you try these?
Do you have a problem with a testcase you created yourself?

@Wer-Wolf
Copy link
Author

I am having a problem with a test case i created myself. The problem is that no error information is displayed when the test fails, likely because of the missing SLF4J provider.

If this the intended behaviour for the standalone fitnesse binary, then we might close this issue and i will try to install a proper SLF4J provider.

@fhoeben
Copy link
Collaborator

fhoeben commented Aug 16, 2024

What error kind of error were you expecting when a test fails. Normally in FitNesse we expect the test result to be visible in the resulting HTML page. Building that page is not done via slf4j so it should not require a provider.

@fhoeben
Copy link
Collaborator

fhoeben commented Aug 16, 2024

I just checked the source setup (as we do seem to include slf4j-jdk14 as a dependency) and it is strange that this message is displayed. You already indicated that it does not occur with Java 8 and an older FitNesse version,

@fhoeben
Copy link
Collaborator

fhoeben commented Aug 16, 2024

Due to our build process I believe we are missing the configuration for the logging implementation to be picked up automatically.

As a workaround you can add -Dslf4j.provider=org.slf4j.jul.JULServiceProvider to your startup command and slf4j logging will work as before (you can of course also add your own provider/binding, which I recommend if your fixtures rely on slf4j logging, and configuration). So the full command then becomes something like:

java -Dslf4j.provider=org.slf4j.jul.JULServiceProvider -jar fitnesse-20240218-standalone.jar -p 9090

We should see whether we can default the provider (so only use this provider if no other provider is available) to prevent this message. That should also resolve the older issue where we want to have a provider in the wiki process (where we are the application) but we don't want to add this provider to test processes (when FitNesse acts as a library which should only rely on the API) where fixtures provide their own logging provider/config.

fhoeben added a commit to fhoeben/fitnesse that referenced this issue Aug 16, 2024
Ensure slf4j logging is not lost but is sent to 'java.util.logging' (using 'slf4j-jdk14'), an explicit other provider can be used via the system property slf4j.provider, see SLF4J Manual.

Fixes unclebob#1520
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants