opennms-remoting webapp fails due to org.opennms.core.soa classloader issue

Description

Requesting /opennms-remoting results in a 503 Service Unavailable. This means that remote pollers cannot register or communicate with this version of OpenNMS.

I found the following exception stack trace in jetty-server.log on one affected system:

Environment

Any 15.0.1 system (I've checked four different ones, including demo and barbrady)

Acceptance / Success Criteria

None

Attachments

1

Lucidchart Diagrams

Activity

Seth Leger April 9, 2015 at 11:06 AM

Hi David,

You should be able to remove the /opt/opennms/jetty-webapps/opennms-remoting/WEB-INF/lib/org.opennms.core.soa-15.0.1.jar file. The webapp should classload successfully then. Thanks.

Jeff Gehlbach April 9, 2015 at 10:42 AM
Edited

I don't think a local workaround is possible. You can upgrade to a 15.0.2 snapshot by temporarily changing the baseurl of your YUM repo from:

To:

Change it back after updating so that you'll return to the stable packages once 15.0.2-1 comes out.

-jeff

David Hoffman April 9, 2015 at 10:09 AM

Is there a local workaround for this issue? Or must we wait for a new release?

I am also seeing this on:

OpenNMS 15.0.1 installed on my CentOS 7x64 VPS running Oracle JDK 1.7.0_75 and PostgreSQL 9.4.1.

Seth Leger February 21, 2015 at 4:02 PM

I've fixed this by excluding the org.opennms.core.soa JAR from the opennms-remoting webapp. I also added a smoke test for the remoting page to ensure that the webapp is loading properly. Marking as fixed.

commit 6da1be15b5ace46423fda16a4417a1fa434d3e9c

Seth Leger February 20, 2015 at 6:56 PM

I had a unit test for this but it didn't catch this crash at runtime because it is a webapp classloader problem. The issue is that the org.opennms.core.soa-VERSION.jar file was being installed into the opennms-remoting webapp and this results in the DefaultServiceRegistry class loading from the system classloader and the ServiceRegistry interface loading from the webapp classloader, causing the inheritance to not match.

I need to mark org.opennms.core:org.opennms.core.soa as a provided dependency so that it doesn't get into the opennms-remoting WEB-INF/lib and then things work properly.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

PagerDuty

Created February 12, 2015 at 8:02 PM
Updated April 9, 2015 at 11:06 AM
Resolved February 21, 2015 at 4:02 PM