You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@sling.apache.org by Bruce Edge <br...@nextissuemedia.com> on 2015/02/03 07:42:23 UTC

java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory with dropbox example Component

I've created an EventHandler service similar to the dropbox example [1]

Is this example still current for the sling trunk build?

I have the same boilerplate initialization for the Component as the dropbox example:

@Component(immediate=true)
@Service(value=EventHandler.class)
@Property(name=EventConstants.EVENT_TOPIC, value=SlingConstants.TOPIC_RESOURCE_ADDED)
public class WebDavFolderWatchIngestService implements EventHandler {

    /** Default logger. */
    protected final Logger logger = LoggerFactory.getLogger(this.getClass());

at bundle load time I get a java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory

02.02.2015 22:00:24.074 *ERROR* [FelixFrameworkWiring] org.apache.felix.scr [com.nim.ct.dam.ingest.service.WebDavFolderWatchIngestService(141)] Error during instantiation of the implementation object (java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory)
java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
        at com.nim.ct.dam.ingest.service.WebDavFolderWatchIngestService.<init>(WebDavFolderWatchIngestService.java:41)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
        at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
        at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
        at java.lang.Class.newInstance(Class.java:379)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementationObject(SingleComponentManager.java:253)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(SingleComponentManager.java:127)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getService(SingleComponentManager.java:871)
        at org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInternal(SingleComponentManager.java:838)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInternal(AbstractComponentManager.java:850)
        at org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(AbstractComponentManager.java:419)
        at org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableComponents(ConfigurableComponentHolder.java:376)
        at org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleComponentActivator.java:172)
        at org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentActivator.java:120)

My runtime has:
g! lb | grep slf
   11|Active     |    1|log4j-over-slf4j (1.7.10)
   13|Active     |    1|jcl-over-slf4j (1.7.10)
   15|Active     |    1|slf4j-api (1.7.10)

I'm building my own runtime launchpad using the launchpad module with some additional dependencies & versions added to the list.xml.

Any hints on next steps appreciated.

-Bruce

[1] http://sling.apache.org/documentation/tutorials-how-tos/how-to-manage-events-in-sling.html

Re: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory with dropbox example Component

Posted by Bruce Edge <br...@nextissuemedia.com>.
Disregard, resolved.

Re: java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory with dropbox example Component

Posted by Bruce Edge <br...@nextissuemedia.com>.
Another oddity I noticed is that if I try to examine my components from
the sling web console components tab, selecting any of them gives a 404
rather than any actual information. This implies there is something broken
in the structure of the bundle an possibly not related to the actual log
errors I¹m getting.

>From the bundles tab, all looks OK, there are no unresolved modules etc.

-Bruce

>I've created an EventHandler service similar to the dropbox example [1]
>
>Is this example still current for the sling trunk build?
>
>I have the same boilerplate initialization for the Component as the
>dropbox example:
>
>@Component(immediate=true)
>@Service(value=EventHandler.class)
>@Property(name=EventConstants.EVENT_TOPIC,
>value=SlingConstants.TOPIC_RESOURCE_ADDED)
>public class WebDavFolderWatchIngestService implements EventHandler {
>
>    /** Default logger. */
>    protected final Logger logger =
>LoggerFactory.getLogger(this.getClass());
>
>at bundle load time I get a java.lang.NoClassDefFoundError:
>org/slf4j/LoggerFactory
>
>02.02.2015 22:00:24.074 *ERROR* [FelixFrameworkWiring]
>org.apache.felix.scr
>[com.nim.ct.dam.ingest.service.WebDavFolderWatchIngestService(141)] Error
>during instantiation of the implementation object
>(java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory)
>java.lang.NoClassDefFoundError: org/slf4j/LoggerFactory
>        at 
>com.nim.ct.dam.ingest.service.WebDavFolderWatchIngestService.<init>(WebDav
>FolderWatchIngestService.java:41)
>        at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native
>Method)
>        at 
>sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAcc
>essorImpl.java:57)
>        at 
>sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstr
>uctorAccessorImpl.java:45)
>        at java.lang.reflect.Constructor.newInstance(Constructor.java:526)
>        at java.lang.Class.newInstance(Class.java:379)
>        at 
>org.apache.felix.scr.impl.manager.SingleComponentManager.createImplementat
>ionObject(SingleComponentManager.java:253)
>        at 
>org.apache.felix.scr.impl.manager.SingleComponentManager.createComponent(S
>ingleComponentManager.java:127)
>        at 
>org.apache.felix.scr.impl.manager.SingleComponentManager.getService(Single
>ComponentManager.java:871)
>        at 
>org.apache.felix.scr.impl.manager.SingleComponentManager.getServiceInterna
>l(SingleComponentManager.java:838)
>        at 
>org.apache.felix.scr.impl.manager.AbstractComponentManager.activateInterna
>l(AbstractComponentManager.java:850)
>        at 
>org.apache.felix.scr.impl.manager.AbstractComponentManager.enable(Abstract
>ComponentManager.java:419)
>        at 
>org.apache.felix.scr.impl.config.ConfigurableComponentHolder.enableCompone
>nts(ConfigurableComponentHolder.java:376)
>        at 
>org.apache.felix.scr.impl.BundleComponentActivator.initialize(BundleCompon
>entActivator.java:172)
>        at 
>org.apache.felix.scr.impl.BundleComponentActivator.<init>(BundleComponentA
>ctivator.java:120)
>
>My runtime has:
>g! lb | grep slf
>   11|Active     |    1|log4j-over-slf4j (1.7.10)
>   13|Active     |    1|jcl-over-slf4j (1.7.10)
>   15|Active     |    1|slf4j-api (1.7.10)
>
>I'm building my own runtime launchpad using the launchpad module with
>some additional dependencies & versions added to the list.xml.
>
>Any hints on next steps appreciated.
>
>-Bruce
>
>[1] 
>http://sling.apache.org/documentation/tutorials-how-tos/how-to-manage-even
>ts-in-sling.html
>
>
>