[ 
https://issues.apache.org/jira/browse/FELIX-3638?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Stuart McCulloch resolved FELIX-3638.
-------------------------------------

       Resolution: Fixed
    Fix Version/s: maven-bundle-plugin-2.4.0
    
> Missing package import for annotation default value
> ---------------------------------------------------
>
>                 Key: FELIX-3638
>                 URL: https://issues.apache.org/jira/browse/FELIX-3638
>             Project: Felix
>          Issue Type: Bug
>          Components: Maven Bundle Plugin
>    Affects Versions: maven-bundle-plugin-2.3.7
>            Reporter: Harald Wellmann
>             Fix For: maven-bundle-plugin-2.4.0
>
>         Attachments: FELIX-3638.zip
>
>
> For the following annotation class in an OSGi bundle
> @Retention(RetentionPolicy.RUNTIME)
> @Target({ ElementType.TYPE, ElementType.METHOD })
> public @interface Transactional
> {
>     @Nonbinding Class<? extends Annotation>[] qualifier() default Any.class;
> }
> maven-bundle-plugin fails to generate the package import for 
> javax.enterprise.inject.Any, the default value of the annotation method.
> At runtime, this leads to a non-descriptive exception 
> Caused by: java.lang.ArrayStoreException: 
> sun.reflect.annotation.TypeNotPresentExceptionProxy
>         at 
> sun.reflect.annotation.AnnotationParser.parseClassArray(AnnotationParser.java:673)
>  ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationParser.parseArray(AnnotationParser.java:480) 
> ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationParser.parseMemberValue(AnnotationParser.java:306)
>  ~[na:1.7.0_04]
>         at java.lang.reflect.Method.getDefaultValue(Method.java:726) 
> ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationType.<init>(AnnotationType.java:117) 
> ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationType.getInstance(AnnotationType.java:84) 
> ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationParser.parseAnnotation(AnnotationParser.java:221)
>  ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationParser.parseAnnotations2(AnnotationParser.java:88)
>  ~[na:1.7.0_04]
>         at 
> sun.reflect.annotation.AnnotationParser.parseAnnotations(AnnotationParser.java:70)
>  ~[na:1.7.0_04]
>         at java.lang.Class.initAnnotationsIfNecessary(Class.java:3089) 
> ~[na:1.7.0_04]
>         at java.lang.Class.getDeclaredAnnotations(Class.java:3077) 
> ~[na:1.7.0_04]
> which is hard to debug.
> The problem can be solved by adding an explicit Import-Package element to the 
> plugin configuration, but I don't see why the plugin can't figure this out by 
> itself.
> The example is taken from Apache Deltaspike. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to