Hello, this is really strange since we do pass in a fake URLHandler but with an empty context. Maybe that is what causing the trouble. Anyways, I'm going to remove this asap (it was a temporary placeholder anyways).
regards, Karl On 1/29/07, Felix Meschberger <[EMAIL PROTECTED]> wrote:
Hi, This seems to have only been introduced lately into Felix. I use the same API call and just put a name there. To fix, I just prepend the string "inputstream:" (not a good name after all :-) ), which works. The API spec just says, the location is "used as the identity of the bundle". That is each bundle has its unique location name. The BundleContext.installBundle(String location) spec says, that the bundle is retrieved from the named location in a Framework dependent manner and that the location string is "typically in the form of a URL". All in all, I can live with the situation of the location string to be an URL. On the other hand as the spec does not require it, Felix should probably handle the case of a missing scheme name properly when creating the code source URL. Perhaps with something like this : URL dummy = new URL(null, "location:", fakeHandler); // might by Constant URL codeSource = new URL(dummy, locationString, fakeHandler); Regards Felix On 1/29/07, Chris Custine <[EMAIL PROTECTED]> wrote: > Need a little insight from others here... When installing a bundle from an > InputStream using the form: > > bundleContext.installBundle(String location, InputStream is) > > does the location String have to be a valid URL string? I have a couple of > scenarios where existing code running on Equinox and Knopflerfish handles > this fine, but in Felix we are using that String to create a valid URL > object for the CodeSource constructor at Felix.java:2921 so we get a > MalformedURLException at SecureAction.java:161 > > I am just trying to figure out if it is pure luck that Equinox and KF work > with bogus location Strings (only when installing from InputStream) or if it > is something that we need to look at in Felix. I have run into this twice > this week, once with a client's code and once in Spring-OSGi test harness. > > Chris > >
-- Karl Pauls [EMAIL PROTECTED]