NoClassDefFoundError: Could not initialize class sun.reflect.misc.Trampoline

Description

Since a couple of days, sometimes I cannot start opennms.

I always get a NoClassDefFoundError: Could not initialize class sun.reflect.misc.Trampoline

The error seems to occur completly random.
I was not able to reproduce it reliable.
Usually it occurs when I do a clean.pl && compile.pl && assemble.pl -p dir and start OpenNMS afterwards with opennms -vt start

The log:

An error occurred while attempting to start the "OpenNMS:Name=Eventd" service (class org.opennms.netmgt.eventd.jmx.Eventd). Shutting down and exiting. java.lang.NoClassDefFoundError: Could not initialize class sun.reflect.misc.Trampoline at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:190) at org.apache.logging.log4j.core.util.Loader.loadClassWithDefaultClassLoader(Loader.java:288) at org.apache.logging.log4j.core.util.Loader.loadClass(Loader.java:283) at org.apache.logging.log4j.core.impl.ThrowableProxy.loadClass(ThrowableProxy.java:509) at org.apache.logging.log4j.core.impl.ThrowableProxy.toExtendedStackTrace(ThrowableProxy.java:621) at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:170) at org.apache.logging.log4j.core.impl.ThrowableProxy.<init>(ThrowableProxy.java:148) at org.apache.logging.log4j.core.impl.Log4jLogEvent.getThrownProxy(Log4jLogEvent.java:270) at org.apache.logging.log4j.core.pattern.ExtendedThrowablePatternConverter.format(ExtendedThrowablePatternConverter.java:64) at org.apache.logging.log4j.core.pattern.PatternFormatter.format(PatternFormatter.java:36) at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:189) at org.apache.logging.log4j.core.layout.PatternLayout.toSerializable(PatternLayout.java:53) at org.apache.logging.log4j.core.layout.AbstractStringLayout.toByteArray(AbstractStringLayout.java:52) at org.apache.logging.log4j.core.appender.AbstractOutputStreamAppender.append(AbstractOutputStreamAppender.java:104) at org.apache.logging.log4j.core.appender.RollingFileAppender.append(RollingFileAppender.java:86) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97) at org.apache.logging.log4j.core.appender.routing.RoutingAppender.append(RoutingAppender.java:112) at org.apache.logging.log4j.core.config.AppenderControl.callAppender(AppenderControl.java:97) at org.apache.logging.log4j.core.config.LoggerConfig.callAppenders(LoggerConfig.java:428) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:407) at org.apache.logging.log4j.core.config.LoggerConfig.log(LoggerConfig.java:365) at org.apache.logging.log4j.core.Logger.logMessage(Logger.java:103) at org.apache.logging.log4j.spi.AbstractLogger.logMessage(AbstractLogger.java:1347) at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1312) at org.apache.logging.slf4j.Log4jLogger.error(Log4jLogger.java:312) at org.opennms.netmgt.vmmgr.Invoker.invoke(Invoker.java:299) at org.opennms.netmgt.vmmgr.Invoker.invokeMethods(Invoker.java:223) at org.opennms.netmgt.vmmgr.Starter.start(Starter.java:247) at org.opennms.netmgt.vmmgr.Starter.startDaemon(Starter.java:106) at org.opennms.netmgt.vmmgr.Controller.start(Controller.java:184) at org.opennms.netmgt.vmmgr.Controller.main(Controller.java:163) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke(Method.java:606) at org.opennms.bootstrap.Bootstrap$3.run(Bootstrap.java:365) at java.lang.Thread.run(Thread.java:724)

Edit:
I discovered, that if you add remote="true" to a package definition to the default collectd-configuration.xml you can reproduce the error.

Environment

development

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Seth Leger September 23, 2014 at 10:21 AM

I've incorporated the log4j snapshot build into 1.14. Marking as fixed.

fooker September 19, 2014 at 9:08 AM

I also got the same error on a fresh archlinux box (OpenJDK 1.8.0_20-b23) a few minutes ago.

I was able to fix this issue for me by installing jicmp / jicmp6 and re-running install -dis.

Benjamin Reed September 18, 2014 at 12:17 PM

OK, I've deployed log4j 2.1 to our repo, versioned 2.1-ONMS-20140918

Reassigning to Seth so he can work on incorporating that version into the build.

Seth Leger September 18, 2014 at 11:02 AM

I worked with the log4j guys and this is now fixed in their latest 2.1-SNAPSHOT code. Since log4j 2.1 is a couple of weeks away, we need to deploy a snapshot version of 2.1 to our maven repo to patch the bug in the meantime. Reassigning to Ben so that he can deploy this artifact.

Seth Leger September 16, 2014 at 2:55 PM

I opened a bug again log4j2 for this issue:

https://issues.apache.org/jira/browse/LOG4J2-832

However, it is urgent enough for us that I'll probably end up being the one to fix it. winking face

Fixed

Details

Assignee

Reporter

Components

Sprint

Fix versions

Affects versions

Priority

PagerDuty

Created August 14, 2014 at 3:08 PM
Updated September 23, 2014 at 2:16 PM
Resolved September 23, 2014 at 10:21 AM

Flag notifications