You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@felix.apache.org by Felix Meschberger <fm...@gmail.com> on 2007/09/07 09:21:08 UTC

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

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
handlers.

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
Spec)

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.

Regards
Felix

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


Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Friday 07 September 2007 16:23, Karl Pauls wrote:
> Richard has access to the TCK and uses that as a somewhat 
> debatable test-suite 

Stuart and I also have access to the Alliance test suite, through the 
membership of our employer. I have not attempted to run a framework against 
it, only compendium bundles and "it isn't easy"... 

Cheers
Niclas

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Rob Walker <ro...@ascert.com>.
Thanks for this thread guys - I'll go back and revisit, see if we can 
also get our App running under Harmony using these config settings.

-- Rob


>> This property is out of date. The FAQ mentions the correct one:
>>
>> felix.service.urlhandlers=false
>>
>> should work.
>>     
>
>
> Yes, it works!  :)
>   


Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Yang Paulex <pa...@gmail.com>.
2007/9/7, Karl Pauls <ka...@gmail.com>:
>
> On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> > 2007/9/7, Karl Pauls <ka...@gmail.com>:
> > >
> > > I just commented on the JIRA issue you raised (basically saying what
> > > Felix said). Sorry, I missed this thread.
> > >
> > > The important point is that you can change the default handler
> > > packages via properties as described in:
> > >
> > > http://felix.apache.org/site/faq.html
> > >
> > > and as Felix pointed out.
> >
> >
> > Just tried it out, I uncommented the line of "
> > framework.service.urlhandlers=false" in conf/config.properties, but it
> > doesn't work for me with almost same stack trace. :(
>
> This property is out of date. The FAQ mentions the correct one:
>
> felix.service.urlhandlers=false
>
> should work.


Yes, it works!  :)

> And the "-Djava.protocol.handler.pkgs" setting in command line does work,
> > but I hold my thoughts that it has potential issue.
>
> What issue?


The property is provided by JSE  to any java applications, so if Harmony or
other JRE used this to make Felix work, there's risk that application
override the settings, then they'll saw a strange stacktrace like I got
before, i.e., the setting is intrusive and may break applications in some
situation.

> But anyway, thank you both for your help. I'll close the FELIX-358 soon.
> :-)
> >
> > Regarding the test suite, this is one of the major outstanding issues.
> > > We currently don't have one. Richard has access to the TCK and uses
> > > that as a somewhat debatable test-suite and I run a couple of projects
> > > before releases to make sure everything is still working but we really
> > > need to address this asap.
> >
> >
> > Ah...I see, is it OK to share me the projects you are used to run?
>
> Unfortunately no. But we are working on a test-suite which we plan to
> make available to the community soon.


Cool!

regards,
>
> Karl
>
> > regards,
> > >
> > > Karl
> > >
> > > On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> > > > 2007/9/7, Felix Meschberger <fm...@gmail.com>:
> > > > >
> > > > > 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.
> > > >
> > > >
> > > > thanks a lot, Felix, I'll have a try.
> > > >
> > > > 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.
> > > >
> > > >
> > > > Yes, I understood this should work, but I'm not sure it's a
> solution,
> > > > because this properties is provided to applications, so I'd rather
> leave
> > > > this alone for Harmony as a JRE, otherwise, it may be overridden by
> > > > application settings.
> > > >
> > > > > 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.URLwill
> > > > > > 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
> > > > > handlers.
> > > > >
> > > > > 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.1Core
> > > > > Spec)
> > > >
> > > >
> > > > I see,  thanks you for the explanation.
> > > >
> > > > 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.
> > > >
> > > >
> > > >
> > > > Regards
> > > > > Felix
> > > > >
> > > > > [1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
> > > > > [2] https://issues.apache.org/jira/browse/FELIX-38
> > > > >
> > > > >
> > > > I have another question actually, I'd like to explore if Harmony can
> > > support
> > > > Felix completely, the best way I can imagine is to run the Felix's
> test
> > > > suites, but I canont find how to run it if there are any available,
> > > neither
> > > > on felix websites nor in the build.xml, would anybody help?
> > > >
> > > > Or an alternatives is to try some applications as scenario tests, so
> > > does
> > > > anyone have suggestions which application/scenario will be the best
> > > > candidate as start? I've executed several simple commands on Felix's
> > > shell
> > > > like "version", "services", "obr", etc, but IMO it's far from enough
> but
> > > a
> > > > smoke test.
> > > >
> > > > --
> > > > Paulex Yang
> > > > China Software Development Lab
> > > > IBM
> > > >
> > >
> > >
> > > --
> > > Karl Pauls
> > > karlpauls@gmail.com
> > >
> >
> >
> >
> > --
> > Paulex Yang
> > China Software Development Lab
> > IBM
> >
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
>



-- 
Paulex Yang
China Software Development Lab
IBM

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Karl Pauls <ka...@gmail.com>.
On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> 2007/9/7, Karl Pauls <ka...@gmail.com>:
> >
> > I just commented on the JIRA issue you raised (basically saying what
> > Felix said). Sorry, I missed this thread.
> >
> > The important point is that you can change the default handler
> > packages via properties as described in:
> >
> > http://felix.apache.org/site/faq.html
> >
> > and as Felix pointed out.
>
>
> Just tried it out, I uncommented the line of "
> framework.service.urlhandlers=false" in conf/config.properties, but it
> doesn't work for me with almost same stack trace. :(

This property is out of date. The FAQ mentions the correct one:

felix.service.urlhandlers=false

should work.

> And the "-Djava.protocol.handler.pkgs" setting in command line does work,
> but I hold my thoughts that it has potential issue.

What issue?

> But anyway, thank you both for your help. I'll close the FELIX-358 soon. :-)
>
> Regarding the test suite, this is one of the major outstanding issues.
> > We currently don't have one. Richard has access to the TCK and uses
> > that as a somewhat debatable test-suite and I run a couple of projects
> > before releases to make sure everything is still working but we really
> > need to address this asap.
>
>
> Ah...I see, is it OK to share me the projects you are used to run?

Unfortunately no. But we are working on a test-suite which we plan to
make available to the community soon.

regards,

Karl

> regards,
> >
> > Karl
> >
> > On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> > > 2007/9/7, Felix Meschberger <fm...@gmail.com>:
> > > >
> > > > 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.
> > >
> > >
> > > thanks a lot, Felix, I'll have a try.
> > >
> > > 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.
> > >
> > >
> > > Yes, I understood this should work, but I'm not sure it's a solution,
> > > because this properties is provided to applications, so I'd rather leave
> > > this alone for Harmony as a JRE, otherwise, it may be overridden by
> > > application settings.
> > >
> > > > 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.URLwill
> > > > > 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
> > > > handlers.
> > > >
> > > > 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
> > > > Spec)
> > >
> > >
> > > I see,  thanks you for the explanation.
> > >
> > > 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.
> > >
> > >
> > >
> > > Regards
> > > > Felix
> > > >
> > > > [1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
> > > > [2] https://issues.apache.org/jira/browse/FELIX-38
> > > >
> > > >
> > > I have another question actually, I'd like to explore if Harmony can
> > support
> > > Felix completely, the best way I can imagine is to run the Felix's test
> > > suites, but I canont find how to run it if there are any available,
> > neither
> > > on felix websites nor in the build.xml, would anybody help?
> > >
> > > Or an alternatives is to try some applications as scenario tests, so
> > does
> > > anyone have suggestions which application/scenario will be the best
> > > candidate as start? I've executed several simple commands on Felix's
> > shell
> > > like "version", "services", "obr", etc, but IMO it's far from enough but
> > a
> > > smoke test.
> > >
> > > --
> > > Paulex Yang
> > > China Software Development Lab
> > > IBM
> > >
> >
> >
> > --
> > Karl Pauls
> > karlpauls@gmail.com
> >
>
>
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>


-- 
Karl Pauls
karlpauls@gmail.com

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Yang Paulex <pa...@gmail.com>.
2007/9/7, Karl Pauls <ka...@gmail.com>:
>
> I just commented on the JIRA issue you raised (basically saying what
> Felix said). Sorry, I missed this thread.
>
> The important point is that you can change the default handler
> packages via properties as described in:
>
> http://felix.apache.org/site/faq.html
>
> and as Felix pointed out.


Just tried it out, I uncommented the line of "
framework.service.urlhandlers=false" in conf/config.properties, but it
doesn't work for me with almost same stack trace. :(

And the "-Djava.protocol.handler.pkgs" setting in command line does work,
but I hold my thoughts that it has potential issue.

But anyway, thank you both for your help. I'll close the FELIX-358 soon. :-)

Regarding the test suite, this is one of the major outstanding issues.
> We currently don't have one. Richard has access to the TCK and uses
> that as a somewhat debatable test-suite and I run a couple of projects
> before releases to make sure everything is still working but we really
> need to address this asap.


Ah...I see, is it OK to share me the projects you are used to run?

regards,
>
> Karl
>
> On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> > 2007/9/7, Felix Meschberger <fm...@gmail.com>:
> > >
> > > 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.
> >
> >
> > thanks a lot, Felix, I'll have a try.
> >
> > 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.
> >
> >
> > Yes, I understood this should work, but I'm not sure it's a solution,
> > because this properties is provided to applications, so I'd rather leave
> > this alone for Harmony as a JRE, otherwise, it may be overridden by
> > application settings.
> >
> > > 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.URLwill
> > > > 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
> > > handlers.
> > >
> > > 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
> > > Spec)
> >
> >
> > I see,  thanks you for the explanation.
> >
> > 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.
> >
> >
> >
> > Regards
> > > Felix
> > >
> > > [1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
> > > [2] https://issues.apache.org/jira/browse/FELIX-38
> > >
> > >
> > I have another question actually, I'd like to explore if Harmony can
> support
> > Felix completely, the best way I can imagine is to run the Felix's test
> > suites, but I canont find how to run it if there are any available,
> neither
> > on felix websites nor in the build.xml, would anybody help?
> >
> > Or an alternatives is to try some applications as scenario tests, so
> does
> > anyone have suggestions which application/scenario will be the best
> > candidate as start? I've executed several simple commands on Felix's
> shell
> > like "version", "services", "obr", etc, but IMO it's far from enough but
> a
> > smoke test.
> >
> > --
> > Paulex Yang
> > China Software Development Lab
> > IBM
> >
>
>
> --
> Karl Pauls
> karlpauls@gmail.com
>



-- 
Paulex Yang
China Software Development Lab
IBM

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Karl Pauls <ka...@gmail.com>.
I just commented on the JIRA issue you raised (basically saying what
Felix said). Sorry, I missed this thread.

The important point is that you can change the default handler
packages via properties as described in:

http://felix.apache.org/site/faq.html

and as Felix pointed out.

Regarding the test suite, this is one of the major outstanding issues.
We currently don't have one. Richard has access to the TCK and uses
that as a somewhat debatable test-suite and I run a couple of projects
before releases to make sure everything is still working but we really
need to address this asap.

regards,

Karl

On 9/7/07, Yang Paulex <pa...@gmail.com> wrote:
> 2007/9/7, Felix Meschberger <fm...@gmail.com>:
> >
> > 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.
>
>
> thanks a lot, Felix, I'll have a try.
>
> 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.
>
>
> Yes, I understood this should work, but I'm not sure it's a solution,
> because this properties is provided to applications, so I'd rather leave
> this alone for Harmony as a JRE, otherwise, it may be overridden by
> application settings.
>
> > 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.URLwill
> > > 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
> > handlers.
> >
> > 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
> > Spec)
>
>
> I see,  thanks you for the explanation.
>
> 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.
>
>
>
> Regards
> > Felix
> >
> > [1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
> > [2] https://issues.apache.org/jira/browse/FELIX-38
> >
> >
> I have another question actually, I'd like to explore if Harmony can support
> Felix completely, the best way I can imagine is to run the Felix's test
> suites, but I canont find how to run it if there are any available, neither
> on felix websites nor in the build.xml, would anybody help?
>
> Or an alternatives is to try some applications as scenario tests, so does
> anyone have suggestions which application/scenario will be the best
> candidate as start? I've executed several simple commands on Felix's shell
> like "version", "services", "obr", etc, but IMO it's far from enough but a
> smoke test.
>
> --
> Paulex Yang
> China Software Development Lab
> IBM
>


-- 
Karl Pauls
karlpauls@gmail.com

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Yang Paulex <pa...@gmail.com>.
2007/9/7, Felix Meschberger <fm...@gmail.com>:
>
> 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.


thanks a lot, Felix, I'll have a try.

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.


Yes, I understood this should work, but I'm not sure it's a solution,
because this properties is provided to applications, so I'd rather leave
this alone for Harmony as a JRE, otherwise, it may be overridden by
application settings.

> 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.URLwill
> > 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
> handlers.
>
> 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
> Spec)


I see,  thanks you for the explanation.

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.



Regards
> Felix
>
> [1] https://issues.apache.org/jira/browse/FELIX-38#action_12504409
> [2] https://issues.apache.org/jira/browse/FELIX-38
>
>
I have another question actually, I'd like to explore if Harmony can support
Felix completely, the best way I can imagine is to run the Felix's test
suites, but I canont find how to run it if there are any available, neither
on felix websites nor in the build.xml, would anybody help?

Or an alternatives is to try some applications as scenario tests, so does
anyone have suggestions which application/scenario will be the best
candidate as start? I've executed several simple commands on Felix's shell
like "version", "services", "obr", etc, but IMO it's far from enough but a
smoke test.

-- 
Paulex Yang
China Software Development Lab
IBM

Re: Felix on Harmony (was Re: Anyone used Felix succesfully under Harmony?)

Posted by Niclas Hedhman <ni...@hedhman.org>.
On Friday 07 September 2007 15:21, Felix Meschberger wrote:
> "[...] 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."

I don't have the SCSL'ed code in front of me right now, but IIRC the JRE 
caches the URLStreamHandlers indefinitely, which means that once used, the 
java.net.URL "system" won't try the installed handlers again. So, my guess is 
that a;

 URL url = new URL( "http://localhost/" );

for each default system handler, should be enough to get rid of the direct 
access to the Handlers.

If I find time later in the weekend, I will try to remember to look this up.


Cheers
Niclas