On 5/26/10 9:58, charbel el_kaed wrote:

Hi I am trying to find the location of a .class file in a bundle.
I am trying the following:

BundleActivator cl2 = (BundleActivator) 
cl.loadClass("auto.generated.Activator").newInstance();
         cl2.start(context);
         cl2.stop(context);

//The auto.generated.Activator is exectued correctly.

But Since I generating Java code on the fly I would like to execute each 
service in a seperated bundle so I would like to build another OSGi/bundle

The second part is to take the .class and generate another bundle, so I would 
like to find the Location (URL) of the .class
I am trying the following but the URL is always null

         URL U1 = cl.getResource("/auto/generated/Activator.class");
         System.out.println("URL U1 "+U1);

Anybody have tried this before ?

This should work. Try it without the leading slash (although that shouldn't make a difference). If not, open a JIRA issue and attach an example bundle recreating the issue.

-> richard

Thanks and Regards,
Charbel.

                                        
_________________________________________________________________
Your E-mail and More On-the-Go. Get Windows Live Hotmail Free.
https://signup.live.com/signup.aspx?id=60969

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@felix.apache.org
For additional commands, e-mail: users-h...@felix.apache.org

Reply via email to