Jose4j v0.5.3 - Could not initialize class org.jose4j.jwa.AlgorithmFactoryFactory.

Issue #82 wontfix
Vaishnavi Manjunath created an issue

I am trying to use Jose4j v0.5.3 for authentication in my web application. I did read that it depends on sl4j libraries and not apache common library v0.4.4 onwards. I have added the following jars to my application -

  1. sl4j-api, ext, jcl, jdk14, log4j12, migrator, nop, simple all of 1.7.22 version.
  2. jul-to-sl4j -1.7.22 and osgi-over-sl4j -1.7.22.

I followed the example to produce and consume JWT tokens as mentioned in https://bitbucket.org/b_c/jose4j/wiki/JWT%20Examples.

However I get these errors:

  1. org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory Caused by: java.lang.ClassNotFoundException: org.apache.commons.logging.LogFactory

  2. org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: Could not initialize class org.jose4j.jwa.AlgorithmFactoryFactory.

I tried adding common.logging 1.12 jar and ended up getting Out of memory error(Java heap space). I really want to know if adding this JAR is the solution to this problem.

Any help in this regard will be highly appreciated. Thanks :)

Comments (2)

  1. Brian Campbell repo owner

    The only dependency that jose4j needs is the slf4j-api. SLF4J lets you bind with a logging framework at deployment time by including a binding jar for whatever framework you want (see http://www.slf4j.org/manual.html). So you should only need one other jar for SLF4J and even if you don't have it, all that should happen is that the SLF4J log messages get lost. I'm not sure what else to say or do based on the info provided.

  2. Log in to comment