I ran into a problem using the rome library for creating RSS Feeds. https://rometools.github.io/ If I just add the lib to my pom.xml and deploy it to an AEM instance and call a servlet which should use the library it just fails. Iam unable to debug into the servlet.
I think it is a class loading issue and on the website of the rome tools is a hint to set the system property 'rome.pluginmanager.useloadclass' to true. How can I achieve this? just as startup parameter or is there a way to do in inside apache felix console or another place inside AEM?
In the error log i got the following message:
failure loooking up method bindRssFeed(org.osgi.framework.ServiceReference) in class class com.xxx.aem.relaunch.servlets.rssfeed.RssFeedServlet. Assuming no such method. (java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException)
java.lang.NoClassDefFoundError: com/rometools/rome/io/FeedException
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Unknown Source)
at java.lang.Class.getDeclaredMethod(Unknown Source)
at org.apache.felix.scr.impl.helper.BaseMethod.getMethod(BaseMethod.java:316)
at org.apache.felix.scr.impl.helper.BindMethod.getServiceReferenceMethod(BindMethod.java:392 )
at org.apache.felix.scr.impl.helper.BindMethod.doFindMethod(BindMethod.java:113)
at org.apache.felix.scr.impl.helper.BaseMethod.findMethod(BaseMethod.java:171)
at org.apache.felix.scr.impl.helper.BaseMethod.access$400(BaseMethod.java:37)
at org.apache.felix.scr.impl.helper.BaseMethod$NotResolved.resolve(BaseMethod.java:558)
at org.apache.felix.scr.impl.helper.BaseMethod$NotResolved.methodExists(BaseMethod.java:580)
at org.apache.felix.scr.impl.helper.BaseMethod.methodExists(BaseMethod.java:513)
at org.apache.felix.scr.impl.helper.BindMethod.getServiceObject(BindMethod.java:643)
at org.apache.felix.scr.impl.manager.DependencyManager.getServiceObject(DependencyManager.ja va:2137)
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.prebind(Depend encyManager.java:1048)
at org.apache.felix.scr.impl.manager.DependencyManager.prebind(DependencyManager.java:1457)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.collectDependencies(AbstractCo mponentManager.java:983)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleCompone ntManager.java:812)
at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManage r.java:774)
at org.apache.felix.framework.ServiceRegistrationImpl.getFactoryUnchecked(ServiceRegistratio nImpl.java:347)
at org.apache.felix.framework.ServiceRegistrationImpl.getService(ServiceRegistrationImpl.jav a:247)
at org.apache.felix.framework.ServiceRegistry.getService(ServiceRegistry.java:344)
at org.apache.felix.framework.Felix.getService(Felix.java:3699)
at org.apache.felix.framework.BundleContextImpl.getService(BundleContextImpl.java:470)
at org.apache.felix.scr.impl.manager.SingleRefPair.getServiceObject(SingleRefPair.java:72)
at org.apache.felix.scr.impl.manager.DependencyManager.getService(DependencyManager.java:139 6)
at org.apache.felix.scr.impl.manager.DependencyManager.getService(DependencyManager.java:137 0)
at org.apache.felix.scr.impl.manager.ComponentContextImpl.locateService(ComponentContextImpl .java:135)
at org.apache.sling.servlets.resolver.internal.SlingServletResolver.createServlet(SlingServl etResolver.java:979)
at org.apache.sling.servlets.resolver.internal.SlingServletResolver.bindServlet(SlingServlet Resolver.java:941)
at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.apache.felix.scr.impl.helper.BaseMethod.invokeMethod(BaseMethod.java:222)
at org.apache.felix.scr.impl.helper.BaseMethod.access$500(BaseMethod.java:37)
at org.apache.felix.scr.impl.helper.BaseMethod$Resolved.invoke(BaseMethod.java:615)
at org.apache.felix.scr.impl.helper.BaseMethod.invoke(BaseMethod.java:499)
at org.apache.felix.scr.impl.helper.BindMethod.invoke(BindMethod.java:41)
at org.apache.felix.scr.impl.manager.DependencyManager.doInvokeBindMethod(DependencyManager. java:1660)
at org.apache.felix.scr.impl.manager.DependencyManager.invokeBindMethod(DependencyManager.ja va:1636)
at org.apache.felix.scr.impl.manager.SingleComponentManager.invokeBindMethod(SingleComponent Manager.java:370)
at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedServic e(DependencyManager.java:319)
at org.apache.felix.scr.impl.manager.DependencyManager$MultipleDynamicCustomizer.addedServic e(DependencyManager.java:295)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.j ava:1215)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.j ava:1136)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTrack er.java:945)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.jav a:881)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.ja va:1167)
at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComp onentActivator.java:120)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispat cher.java:991)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java :839)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546 )
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
at org.apache.felix.framework.Felix.registerService(Felix.java:3549)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentMa nager.java:869)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentMa nager.java:857)
at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationMana ger.java:133)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractCompon entManager.java:915)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractCompo nentManager.java:715)
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(D ependencyManager.java:954)
at org.apache.felix.scr.impl.manager.DependencyManager$SingleStaticCustomizer.addedService(D ependencyManager.java:915)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.j ava:1215)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.customizerAdded(ServiceTracker.j ava:1136)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.trackAdding(ServiceTrack er.java:945)
at org.apache.felix.scr.impl.manager.ServiceTracker$AbstractTracked.track(ServiceTracker.jav a:881)
at org.apache.felix.scr.impl.manager.ServiceTracker$Tracked.serviceChanged(ServiceTracker.ja va:1167)
at org.apache.felix.scr.impl.BundleComponentActivator$ListenerInfo.serviceChanged(BundleComp onentActivator.java:120)
at org.apache.felix.framework.util.EventDispatcher.invokeServiceListenerCallback(EventDispat cher.java:991)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java :839)
at org.apache.felix.framework.util.EventDispatcher.fireServiceEvent(EventDispatcher.java:546 )
at org.apache.felix.framework.Felix.fireServiceEvent(Felix.java:4557)
at org.apache.felix.framework.Felix.registerService(Felix.java:3549)
at org.apache.felix.framework.BundleContextImpl.registerService(BundleContextImpl.java:348)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentMa nager.java:869)
at org.apache.felix.scr.impl.manager.AbstractComponentManager$3.register(AbstractComponentMa nager.java:857)
at org.apache.felix.scr.impl.manager.RegistrationManager.changeRegistration(RegistrationMana ger.java:133)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.registerService(AbstractCompon entManager.java:915)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractCompo nentManager.java:715)
at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManage r.java:399)
at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(Configurabl eComponentHolder.java:676)
at org.apache.felix.scr.impl.BundleComponentActivator.initialEnable(BundleComponentActivator .java:339)
at org.apache.felix.scr.impl.Activator.loadComponents(Activator.java:360)
at org.apache.felix.scr.impl.Activator.access$000(Activator.java:53)
at org.apache.felix.scr.impl.Activator$ScrExtension.start(Activator.java:260)
at org.apache.felix.utils.extender.AbstractExtender.createExtension(AbstractExtender.java:25 9)
at org.apache.felix.utils.extender.AbstractExtender.modifiedBundle(AbstractExtender.java:232 )
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:482)
at org.osgi.util.tracker.BundleTracker$Tracked.customizerModified(BundleTracker.java:415)
at org.osgi.util.tracker.AbstractTracked.track(AbstractTracked.java:232)
at org.osgi.util.tracker.BundleTracker$Tracked.bundleChanged(BundleTracker.java:444)
at org.apache.felix.framework.util.EventDispatcher.invokeBundleListenerCallback(EventDispatc her.java:916)
at org.apache.felix.framework.util.EventDispatcher.fireEventImmediately(EventDispatcher.java :835)
at org.apache.felix.framework.util.EventDispatcher.fireBundleEvent(EventDispatcher.java:517)
at org.apache.felix.framework.Felix.fireBundleEvent(Felix.java:4541)
at org.apache.felix.framework.Felix.startBundle(Felix.java:2172)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:998)
at org.apache.felix.framework.BundleImpl.start(BundleImpl.java:984)
at org.apache.sling.installer.core.impl.tasks.BundleStartTask.execute(BundleStartTask.java:9 7)
at org.apache.sling.installer.core.impl.OsgiInstallerImpl.doExecuteTasks(OsgiInstallerImpl.j ava:894)
at org.apache.sling.installer.core.impl.OsgiInstallerImpl.executeTasks(OsgiInstallerImpl.jav a:729)
at org.apache.sling.installer.core.impl.OsgiInstallerImpl.run(OsgiInstallerImpl.java:286)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassNotFoundException: com.rometools.rome.io.FeedException not found by com.xxx.aem.xx-com-relaunch.core
SOLUTION:
Add your Rome libs also in the embedded dependencies in your pom.xml
<Embed-Dependency>
rome,
rome-utils,
jdom2
</Embed-Dependency>