aws-samples / aws-cloudhsm-jce-examples

Sample applications demonstrating how to use the CloudHSM JCE
MIT No Attribution
36 stars 56 forks source link

LoginManger dependency on log4j #40

Closed prakashtanaji closed 3 years ago

prakashtanaji commented 3 years ago

I am getting the below bean creation failure as the cavium LoginManager is unable to find reference to log4j.LogManager.

Caused by: java.lang.ClassNotFoundException: org.apache.logging.log4j.LogManager
...

  | Caused by: java.lang.NoClassDefFoundError: org/apache/logging/log4j/LogManager
  |     at com.cavium.cfm2.LoginManager.<clinit>(LoginManager.java:172)

I checked that I have the log4j available. We use slf4j as the logging wrapper, but dont think that will cause an issue.

This happens during the deployment time when the service starts. I also made sure that the log4j-core-2.9.1.jar exists in our deployment .war file.

Is it possible that LoginManager has very strong dependency on one particlar ver. of log4j?

mayankambaliya commented 3 years ago

Is this still an open issue? We have a new release 3.2.1 which should allow you to use SLF4j with CloudHSM JCE. However your original issue is probably because of not including “log4j-api” and “log4j-core” in your packaged war. You need to have at least one implementation of Log4j-api along with log4j-api in your packaged war (either log4j-core or SLF4j’s implementation).

3.2.1 release of CloudHSM JCE library: https://docs.aws.amazon.com/cloudhsm/latest/userguide/client-history.html#client-version-3-2-1

rday commented 3 years ago

I'm closing this out because of the software updates which should address the issue.

Please re-open if there is still a problem.