felix-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Felix Meschberger <fmesc...@gmail.com>
Subject Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)
Date Fri, 07 Sep 2007 07:21:08 GMT
Hi Paulex,

If you have issues with the URL Handlers Service of Felix you can switch
it off by setting the framework.service.urlhandlers property to false
(see also [1]). This is currently also the only solution to run the
Felix framework in an environment, which already sets the Java runtime
URLStreamHandlersFactory such as application servers.

Am Freitag, den 07.09.2007, 14:32 +0800 schrieb Yang Paulex:
> After some tracing, I finally found these two constants in
> framework/src/main/java/org/apache/felix/framework/URLHandlers.java:
>     private static final String DEFAULT_STREAM_HANDLER_PACKAGE = "
> sun.net.www.protocol";
>     private static final String DEFAULT_CONTENT_HANDLER_PACKAGE = "
> sun.net.www.content";

You might also try to set the standard properties
"java.protocol.handler.pkgs" and "java.content.handler.pkgs" to the
harmony packages. This would not require touching the framework code.

> My current thoughts is, is it possible for Felix's URLHandlers.java to only
> handle the Felix interested protocals("Felix://"?), and just ignore others
> (return null in createURLStreamHandler()), and actually java.net.URL will
> try to handle them with builtin URLStreamHandlers. If I find some time
> recently, I'll try if this works. But I'd like to hear from Felix guru at
> first if this has any potential problems, i.e., it may be intentional
> behavior to load JSE built in handlers at first.

This will probably not work because the Felix handlers exist to
implement the OSGi URL Handlers Service Specification which allow for
the registration and unregistration of custom URL Stream and Content

The check for the configured handlers exists to not overwrite any
pre-configured handler from the environment with a handler provided from
within the framework. This is also specified in section 11.3.2 (Built-in
Handlers) of the core specification: "[...] built-in handlers should
take priority over handlers from the service registry to guarantee
consistency. The built-in handlers, as defined in the OSGi execution
environments must never be overridden." (page 266 of the R 4.1 Core

Actually, URL Handlers is the issue of another Felix issue (FELIX-38
[2]). The attached fix is probably not usable due to licensing issues
and a new implementation has to be devised.


[1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
[2] https://issues.apache.org/jira/browse/FELIX-38

View raw message