The remote poller is not working when using HTTP, but it works with RMI

Description

After creating a simple testing environment with the latest code from the master branch in order to play with the Remote Poller (following the directions from the Wiki), I noticed that if I start the remote poller with the following command:

/opt/opennms/bin/remote-poller.sh -l RDU -n admin -p admin -g -u http://localhost:8980/opennms-remoting

it doesn't start, but if I execute it using RMI like the following, it works:

./remote-poller.sh -l RDU -n admin -p admin -g -u rmi://localhost/

I found a problem on ~/.opennms/opennms-remote-poller.log, it is related with a missing class:

2012-12-14 09:29:01,418 INFO [main] org.opennms.poller.remote.Main: org.opennms.netmgt.icmp.pingerClass not set; using JnaPinger by default
2012-12-14 09:29:01,427 INFO [main] org.opennms.poller.remote.Main: user.home.url = file:/Users/agalue
2012-12-14 09:29:01,427 INFO [main] org.opennms.poller.remote.Main: opennms.poller.server.url = http://localhost:8980/opennms-remoting
2012-12-14 09:29:01,427 INFO [main] org.opennms.poller.remote.Main: location name = HOME
2012-12-14 09:29:01,457 INFO [main] org.springframework.context.support.ClassPathXmlApplicationContext: Refreshing org.springframework.context.support.ClassPathXmlApplicationContext@32df8508: startup date [Fri Dec 14 09:29:01 EST 2012]; root of context hierarchy
2012-12-14 09:29:01,483 INFO [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]
2012-12-14 09:29:01,673 INFO [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [META-INF/opennms/applicationContext-pollerFrontEnd.xml]
2012-12-14 09:29:01,698 INFO [main] org.springframework.beans.factory.xml.XmlBeanDefinitionReader: Loading XML bean definitions from class path resource [META-INF/opennms/applicationContext-ws-gui.xml]
2012-12-14 09:29:01,759 INFO [main] org.springframework.beans.factory.support.DefaultListableBeanFactory: Pre-instantiating singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@22531380: defining beans [frontEndConfigurer,pollerBackEnd,timeAdjustment,pollService,pollerSettings,pollerFrontEnd,checkConfigJobDetail,configCheckTrigger,scheduler,poller,pollerView]; root of factory hierarchy
2012-12-14 09:29:01,767 INFO [main] org.springframework.beans.factory.support.DefaultListableBeanFactory: Destroying singletons in org.springframework.beans.factory.support.DefaultListableBeanFactory@22531380: defining beans [frontEndConfigurer,pollerBackEnd,timeAdjustment,pollService,pollerSettings,pollerFrontEnd,checkConfigJobDetail,configCheckTrigger,scheduler,poller,pollerView]; root of factory hierarchy
2012-12-14 09:29:01,768 ERROR [main] org.opennms.poller.remote.Main: Exception occurred during registration!
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'pollerBackEnd' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]: Cannot create inner bean 'org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean#65cccd3' of type [org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean] while setting bean property 'remoteBackEnd'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean#65cccd3' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]: Cannot create inner bean 'org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor#5ce03f50' of type [org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor] while setting bean property 'httpInvokerRequestExecutor'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor] for bean with name 'org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor#5ce03f50' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:293)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:222)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:290)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:192)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:585)
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:895)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:425)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:139)
at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:93)
at org.opennms.poller.remote.Main.createAppContext(Main.java:257)
at org.opennms.poller.remote.Main.run(Main.java:143)
at org.opennms.poller.remote.Main.main(Main.java:313)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.simontuffs.onejar.Boot.run(Boot.java:306)
at com.simontuffs.onejar.Boot.main(Boot.java:159)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean#65cccd3' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]: Cannot create inner bean 'org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor#5ce03f50' of type [org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor] while setting bean property 'httpInvokerRequestExecutor'; nested exception is org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor] for bean with name 'org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor#5ce03f50' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:281)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:120)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.applyPropertyValues(AbstractAutowireCapableBeanFactory.java:1327)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.populateBean(AbstractAutowireCapableBeanFactory.java:1085)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:516)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:455)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 23 more
Caused by: org.springframework.beans.factory.CannotLoadBeanClassException: Cannot find class [org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor] for bean with name 'org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor#5ce03f50' defined in class path resource [META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml]; nested exception is java.lang.ClassNotFoundException: org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1261)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:432)
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveInnerBean(BeanDefinitionValueResolver.java:270)
... 29 more
Caused by: java.lang.ClassNotFoundException: org.springframework.security.context.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor
at com.simontuffs.onejar.JarClassLoader.findClass(JarClassLoader.java:602)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
at org.springframework.util.ClassUtils.forName(ClassUtils.java:257)
at org.springframework.beans.factory.support.AbstractBeanDefinition.resolveBeanClass(AbstractBeanDefinition.java:408)
at org.springframework.beans.factory.support.AbstractBeanFactory.doResolveBeanClass(AbstractBeanFactory.java:1282)
at org.springframework.beans.factory.support.AbstractBeanFactory.resolveBeanClass(AbstractBeanFactory.java:1253)
... 31 more

Acceptance / Success Criteria

None

Lucidchart Diagrams

Activity

Show:

Alejandro Galue December 14, 2012 at 12:25 PM

Fixed on revision 7469bebf7ab2e50d80c0e697e223ee0e21435243 on master.

The problem is that I'm not sure how can I create a JUnit test based on PollerFrontEndIntegrationTest, to initialize a mock servlet context in order to emulate:

http://localhost:8980/opennms-remoting/pollerBackEnd

Alejandro Galue December 14, 2012 at 10:51 AM

Seth told me that the class in question has changed their name on SpringSecurity 3.1. The new name is:

org.springframework.security.remoting.httpinvoker.AuthenticationSimpleHttpInvokerRequestExecutor

The AuthenticationSimpleHttpInvokerRequestExecutor class is referenced in 3 files of the source code:

  • features/remote-poller/src/test/resources/applicationContext-client.xml

  • opennms-services/src/main/resources/META-INF/opennms/applicationContext-remotePollerBackEnd-http.xml

  • opennms-services/src/main/resources/META-INF/opennms/applicationContext-remotePollerBackEnd-https.xml

Inside the first XML the classname is correct, but on the last two, the class is not correct.

After fixing those files, the remote poller started to work again with HTTP. So I'll try to create a JUnit test to verify those context files in order to be able to detect problems on future upgrades.

Alejandro Galue December 14, 2012 at 9:52 AM

This only affects master (i.e., 1.11.x), on 1.10.x it works as expected. The only difference is that master is using a new version of Spring Security (if I recall correctly).

Fixed

Details

Assignee

Reporter

Components

Fix versions

Affects versions

Priority

PagerDuty

Created December 14, 2012 at 9:51 AM
Updated January 27, 2017 at 4:21 PM
Resolved December 14, 2012 at 12:25 PM

Flag notifications