问题
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.
来源:https://stackoverflow.com/questions/22464764/java-lang-noclassdeffounderror-javax-crypto-cipher