felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Edelson <justinedel...@gmail.com>
Subject Re: Is is a bug to omit the Annotation class?
Date Fri, 15 Jan 2010 16:10:29 GMT
Aside from this being the correct behavior (, it sounds like a manifest
problem. If App is in package com.foo.bar, then your bundle needs to import
this package. If that import is not-optional (the default), then the bundle
won't start. If you are concerned about the annotation being deleted from
that package, then require a specific version of the package.

Justin

On Fri, Jan 15, 2010 at 2:57 AM, Brodie <brodie.chi@gmail.com> wrote:

>
> hi,
> i find that when felix installing a bundle, if the bundle referred to some
> other bundle's exported Annotation, and if the Annotation class is not
> accessible(for example the annotation class is deleted) , felix omit the
> Annotation.
> i am not sure if this is a bug, or the JVM runs in this way, but it is
> definitely not reasonable. i waste much time on it.
>
> Here is the test,
> public class TestLoadAnnotation {
>        @Test
>        public void testLoad() throws Exception{
>                Felix f = new Felix(new HashMap());
>                f.init(); f.start();
>                Bundle bundle =
>
> f.getBundleContext().installBundle("file:///home/chi/workspace/profile/target/profile-0.0.1-SNAPSHOT-package.jar");
>                bundle.start();
>                BundleActivator activator =
> FelixHelper.getBundleActivator(bundle);
>                System.out.println(activator.getClass().getClassLoader());
>                Assert.assertTrue(0 !=
> activator.getClass().getAnnotations().length);
>        }
> }
>
> and the profile bundle's activator definition.
> @App("profile")
> public class Activator implements BundleActivator{...}
>
> i checked the class file of Activator, and there is this runtime visible
> @App annotation. why the annotation is missing?
>
>
>
> --
> View this message in context:
> http://old.nabble.com/Is-is-a-bug-to-omit-the-Annotation-class--tp27173344p27173344.html
> Sent from the Apache Felix - Dev mailing list archive at Nabble.com.
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message