java.lang.NoClassDefFoundError: javax/crypto/Ciphe

2019-09-02 07:24发布

问题:

I am implementing SNMP traps in JBOSS FUSE using log4j and unfortunately getting into an issue as follows. Can any one please advise on what bundle/dependency I need to install to resolve this issue

Caused by: java.lang.NoClassDefFoundError: javax/crypto/Cipher at org.snmp4j.security.SecurityProtocols.addDefaultProtocols(SecurityProtocols.java:152)[244:AbstractionAPI:1.0.0] at org.snmp4j.Snmp.initMessageDispatcher(Snmp.java:225)[244:AbstractionAPI:1.0.0] at org.snmp4j.Snmp.(Snmp.java:251)[244:AbstractionAPI:1.0.0]

Caused by: java.lang.ClassNotFoundException: javax.crypto.Cipher not found by org.ops4j.pax.logging.pax-logging-service [5]

回答1:

Looks like this package isn't imported as optional dependency to pax-logging, as it is provided by the root bundle in Karaf. Therefore you should create a little fragment bundle that will adapt the pax-logging-service manifest, so this package can be imported. The blog about adding custom appenders to Pax Logging might give you a hint on how to create this.