Skip to content

Exception when opening port #164

Closed
Closed

Description

@athach

Hello,
Thank you very much for your work and sharing it.

I moved from 2.8.0 to 2.9.6 and now I get an exception when opening a port: "SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder"."

I had a look inside the jar and there are slf4j files in there. Am I supposed to include something more?

Thanks

Activity

  1. pietrygamat commented on Jan 4, 2024

    @pietrygamat
    Collaborator

    This is the same as #76. It should not be a critical problem, so if it prevents you from opening port, please share more details / stack trace.

  2. athach commented on Jan 4, 2024

    @athach
    Author

    Thank you. I included the library and the error message is gone. Before posting here I did try that but with a more recent version of slf4j and that did not work. Maybe you should make a note about this on the front page for other users.

  3. tresf commented on Jan 4, 2024

    @tresf

    Thank you. I included the library and the error message is gone. Before posting here I did try that but with a more recent version of slf4j and that did not work. Maybe you should make a note about this on the front page for other users.

    This will depend where you get the library. On our downloads page, it should never appear however from Maven it will. This is because Maven requires the transient dependencies to be resolved by the build system whereas our download should contain everything needed to use the library.

    Where did you download it from? If it was from our downloads area, that's a bug.

  4. athach commented on Jan 5, 2024

    @athach
    Author
  5. tresf commented on Jan 10, 2024

    @tresf

    @athach from my testing against v2.9.6, this is not an Exception, but rather a benign message logged to stderr. Here's my code:

    public class MainJssc {
        public static void main(String... args) {
            System.out.println(Arrays.toString(SerialPortList.getPortNames()));
        }
    }

    This is the same as #76. It should not be a critical problem, so if it prevents you from opening port, please share more details / stack trace.

    This seems to be accurate. Here's my output:

    - SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
    - SLF4J: Defaulting to no-operation (NOP) logger implementation
    - SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
      [/dev/cu.Bluetooth-Incoming-Port, /dev/cu.wlan-debug, /dev/tty.Bluetooth-Incoming-Port, /dev/tty.wlan-debug]

    No exceptions are thrown in this example. I believe the long-term plan is to remove native-lib-loader as a project dependency which will remove the transient dependency on slf4j. With regards to documenting this, we're welcome to recommendations on how to present this to the user on the project page.

  6. athach commented on Jan 11, 2024

    @athach
    Author

    I am sorry. You are correct, it is not an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions