Get used to it, it is a hack :-)

JEC> I may not understand this... but doesn't the path refer to resources
JEC> within the bundle/jar? If a bundle is created with a Bundle-Classpath
JEC> pointing to /target/classes/ why would the Equinox runtime look for
JEC> resources on the file system? Do other frameworks do this?
The reason is that Equinox gets started with a "magic" url. This url
is mapped to the directory of the project. So normally this does not
(and should not) work. However, Equinox insists on -not- having a build
phase but unfortunately their disk layout is slightly different than
the bundle layout.

JEC> So if I create a production bundle and deploy it with such a Bundle-
JEC> Classpath and one or more OSGi frameworks looks outside of the bundle
JEC> for resources on the filesystem wouldn't this be a potential security
JEC> issue?
A framework should NEVER look outside its bundle. In the Equinox case
the jar == the project directory  and that is why it works.

Kind regards,

     Peter Kriens
     

JEC> On Sun, 2007-01-21 at 13:46 -0500, Richard S. Hall wrote: 
>> John E. Conlon wrote:
>> > Ran across a case where a project bundle was using a Bundle-Classpath
>> > entry with the /target/classes/ value in it's manifest even though it
>> > had no such path in the bundle.  As expected Bnd flagged this as an
>> > error.  
>> >
>> > Over at the spring-osgi maillist someone mentioned this practice as a
>> > way to get their bundle working in an equinox environment. Don't
>> > understand this statement really - Although I run eclipse I don't have
>> > much experience with Equinox.
>> >
>> > Is fudging the behavior of Bundle-Classpath in this manner okay or is
>> > this verboten?
>> 
>> Yes, they are using this trick to get their bundles to work correctly as 
>> PDE projects (they are working with maven that puts classes in 
>> target/classes, but PDE doesn't expect them there, so they can add this 
>> to the bundle class path to get PDE to look in the right place...or 
>> something like that).
>> 
>> The spec says that missing class path entries should be ignored, so this 
>> is ok I guess, but it does make life difficult for BND.
>> 
JEC> I may not understand this... but doesn't the path refer to resources
JEC> within the bundle/jar? If a bundle is created with a Bundle-Classpath
JEC> pointing to /target/classes/ why would the Equinox runtime look for
JEC> resources on the file system? Do other frameworks do this? 

JEC> So if I create a production bundle and deploy it with such a Bundle-
JEC> Classpath and one or more OSGi frameworks looks outside of the bundle
JEC> for resources on the filesystem wouldn't this be a potential security
JEC> issue?

JEC> regards - John


-- 
Peter Kriens                              Tel +33467542167
9C, Avenue St. Drézéry                    AOL,Yahoo: pkriens
34160 Beaulieu, France                    ICQ 255570717
Skype pkriens                             Fax +1 8153772599

Reply via email to