[ 
https://issues.apache.org/jira/browse/FELIX-1726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12773293#action_12773293
 ] 

Stefan Seifert commented on FELIX-1726:
---------------------------------------

example stacktrace:

Caused by: java.lang.NoClassDefFoundError: org/slf4j/impl/StaticLoggerBinder
        at org.slf4j.LoggerFactory.<clinit>(LoggerFactory.java:60)
        at 
vwg.wcm.vwd4.base.components.global.AbstractStreamComponent.<clinit>(AbstractStreamComponent.java:37)
        at sun.misc.Unsafe.ensureClassInitialized(Native Method)
        at 
sun.reflect.UnsafeFieldAccessorFactory.newFieldAccessor(UnsafeFieldAccessorFactory.java:25)
        at 
sun.reflect.ReflectionFactory.newFieldAccessor(ReflectionFactory.java:122)
        at java.lang.reflect.Field.acquireFieldAccessor(Field.java:918)
        at java.lang.reflect.Field.getFieldAccessor(Field.java:899)
        at java.lang.reflect.Field.get(Field.java:358)
        at 
org.apache.felix.scrplugin.tags.ClassUtil.getInitializationExpression(ClassUtil.java:41)
        ... 32 more
Caused by: java.lang.ClassNotFoundException: org.slf4j.impl.StaticLoggerBinder
        at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
        at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
        at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
        ... 41 more

it's line 41 in ClassUtil.
and you're right - the CFNE was translated to a NoClassDefFoundError, and thats 
what i meant.

> SCR Annotations - Enhance error messages in case of missing project 
> dependencies
> --------------------------------------------------------------------------------
>
>                 Key: FELIX-1726
>                 URL: https://issues.apache.org/jira/browse/FELIX-1726
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven SCR Plugin
>    Affects Versions: maven-scr-plugin-1.4.0
>            Reporter: Stefan Seifert
>            Assignee: Carsten Ziegeler
>            Priority: Minor
>             Fix For: maven-scr-plugin-1.4.1
>
>
> in rev. 821022 felix removed some dependencies that where unneeded for the 
> code that existed in the scr plugin itself.
> there where unneeded to compile the plugin, but they are needed in some 
> usecases for annotation parsing.
> e.g. if a project's class is annotated with SCR annotations, and at the same 
> time declares a static field with a slf4j Logger class, reading other static 
> string field values fails with a ClassNotFound exception pointing to a slf4j 
> class.
> re-adding the slf4j dependencies again solves the problem.
> unfortunately the exception handling in this case is not good - the message 
> is only "Somehing went wrong.", because the ClassNotFound exception was 
> swallowed in ClassUtil.getInitializationExpression method.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to