apache / plc4x

PLC4X The Industrial IoT adapter
https://plc4x.apache.org/
Apache License 2.0
1.19k stars 388 forks source link

[Bug]: plc4x-opcua-server jar package doesn't work - No SLF4J providers were found. #1662

Open stegal-bh opened 2 weeks ago

stegal-bh commented 2 weeks ago

What happened?

I was running plc4x-opcua-server jar file, but I got the following error:

SLF4J(W): No SLF4J providers were found.
SLF4J(W): Defaulting to no-operation (NOP) logger implementation
SLF4J(W): See https://www.slf4j.org/codes.html#noProviders for further details.

JDK version: "17.0.9" 2023-10-17 LTS Maven version: Apache Maven 3.9.7

My steps performed:

  1. Download release v0.12.0 version link to v0.12.0
  2. Go to the opcua-server folder (plc4j\tools\opcua-server)
  3. Perform mvn package command
  4. Go to the plc4x-opcua-server-0.12.0-uber-jar.jar package at plc4j\tools\opcua-server\target folder
  5. Perform java -jar plc4x-opcua-server-0.12.0-uber-jar.jar -c config.yml -i command
  6. I'm getting error plc4x_issue

Version

v.0.12.0

Programming Languages

Protocols

hutcheb commented 2 weeks ago

It looks as though no logger class files were found in your class path. (I spent a few minutes trying to add one on my machine without success). I would expect if you manually added a logger class to your command it should find it.

Not sure if you mentioned if it exits afterwards or not. If it does you might need to create the config file, this should be based on the sample config.yml in the main/resources directory (make sure to uncomment the security directory you want to use). Otherwise fixing the logging issue would give you more information.

stegal-bh commented 2 weeks ago

Hi @hutcheb, I have found the problem. I added slf4j-simple as dependency

  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.13</version>
  </dependency>

and uncommented dir: "./security" in yml config file and now it's working fine.

thanks

ottlukas commented 2 weeks ago

Hi @hutcheb, I have found the problem. I added slf4j-simple as dependency

  <dependency>
    <groupId>org.slf4j</groupId>
    <artifactId>slf4j-simple</artifactId>
    <version>2.0.13</version>
  </dependency>

and uncommented dir: "./security" in yml config file and now it's working fine.

thanks

Does that mean this issue can be closed?

chrisdutz commented 2 weeks ago

Well I think it hasn#t been changed in the code ... so I would say: nope.

chrisdutz commented 2 days ago

When running the opcua-server in SNAPSHOT, I'm getting this message:

cdutz@MacBook-Pro-von-Christofer target % java -jar plc4x-opcua-server-0.13.0-SNAPSHOT.jar -c config.yml -i
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.SecurityException: Invalid signature file digest for Manifest main attributes

Could someone from the OPC-UA folks please have a look at it? @hutcheb @splatch ?

chrisdutz commented 23 hours ago

Ok ... so I had a look at the OPC-UA server in it's current state and it was definitely missing some configuration to merge all driver configs. I was only able to start it with one driver available, as the shade plugin was overwriting the META-INF/services/ property files instead of merging them ... after adding that transformer, I was able to start the OPC-UA server without errors and without the logging message. I think this issue can be closed ... do you agree?