You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@felix.apache.org by Os...@emc.com on 2009/02/26 04:57:32 UTC

OSGi and URL.openConnection

I am total novice with OSGi and this is my first experiment. I turned my
application into set of bundles and it was successful except for one
issue. I have piece of code where I do something like that
url.openConnection (proxy); and here I've got
UnsupportedOperationException. Apparently something is getting messed up
in between OSGi and java.protocol.handler.pkgs system property. I made
several unsuccessful attempts to fix it but eventually only way I
managed to make it work is by setting "felix.service.urlhandlers" to
"false". I think this is a wrong way to do it. What would be the right
way and also what functionality did I loose by setting this property to
"false"

Alex

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


RE: OSGi and URL.openConnection

Posted by Os...@emc.com.
Thank you Karl,
I appreciate it.

Regards,
	Alex 

-----Original Message-----
From: Karl Pauls [mailto:karlpauls@gmail.com] 
Sent: Thursday, February 26, 2009 10:11 PM
To: users@felix.apache.org
Subject: Re: OSGi and URL.openConnection

we might have an issue with proxies. I will look into it.

regards,

Karl

Am 26.02.2009 um 23:56 schrieb Oscherov_Alex@emc.com:

> Richard,
> There is nothing specific in what I am doing. The protocol is HTTP.  
> The
> only thing is that I use proxy i.e. call looks like url.openConnection
> (proxy). The exception comes from
> java.net.URLStreamHandler.openConnection(URLStreamHandler.java:80)  
> and I
> use Sun JVM. Normally handler for open connection comes from
> sun.net.www.protocol so either urlhandler bundle redefines system
> property java.protocol.handler.pkgs or it sets its own
> URLStreamHandlerFactory. I didn't look into source code yet and by the
> way can I?
> Please let me know what additional information do you want me to
> provide.
>
> Regards,
>    Alex
>
> -----Original Message-----
> From: Richard S. Hall [mailto:heavy@ungoverned.org]
> Sent: Thursday, February 26, 2009 6:51 AM
> To: users@felix.apache.org
> Subject: Re: OSGi and URL.openConnection
>
> We probably need more details about what is exactly going on, but you
> are right, it shouldn't be necessary to disable it.
>
> What does the URL look like for which you are doing  
> url.openConnection()
> ?
>
> Are you defining your own stream handler for a custom protocol?
>
> -> richard
>
> Oscherov_Alex@emc.com wrote:
>> I am total novice with OSGi and this is my first experiment. I turned
> my
>> application into set of bundles and it was successful except for one
>> issue. I have piece of code where I do something like that
>> url.openConnection (proxy); and here I've got
>> UnsupportedOperationException. Apparently something is getting messed
> up
>> in between OSGi and java.protocol.handler.pkgs system property. I  
>> made
>> several unsuccessful attempts to fix it but eventually only way I
>> managed to make it work is by setting "felix.service.urlhandlers" to
>> "false". I think this is a wrong way to do it. What would be the  
>> right
>> way and also what functionality did I loose by setting this property
> to
>> "false"
>>
>> Alex
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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



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


Re: OSGi and URL.openConnection

Posted by Karl Pauls <ka...@gmail.com>.
we might have an issue with proxies. I will look into it.

regards,

Karl

Am 26.02.2009 um 23:56 schrieb Oscherov_Alex@emc.com:

> Richard,
> There is nothing specific in what I am doing. The protocol is HTTP.  
> The
> only thing is that I use proxy i.e. call looks like url.openConnection
> (proxy). The exception comes from
> java.net.URLStreamHandler.openConnection(URLStreamHandler.java:80)  
> and I
> use Sun JVM. Normally handler for open connection comes from
> sun.net.www.protocol so either urlhandler bundle redefines system
> property java.protocol.handler.pkgs or it sets its own
> URLStreamHandlerFactory. I didn't look into source code yet and by the
> way can I?
> Please let me know what additional information do you want me to
> provide.
>
> Regards,
>    Alex
>
> -----Original Message-----
> From: Richard S. Hall [mailto:heavy@ungoverned.org]
> Sent: Thursday, February 26, 2009 6:51 AM
> To: users@felix.apache.org
> Subject: Re: OSGi and URL.openConnection
>
> We probably need more details about what is exactly going on, but you
> are right, it shouldn't be necessary to disable it.
>
> What does the URL look like for which you are doing  
> url.openConnection()
> ?
>
> Are you defining your own stream handler for a custom protocol?
>
> -> richard
>
> Oscherov_Alex@emc.com wrote:
>> I am total novice with OSGi and this is my first experiment. I turned
> my
>> application into set of bundles and it was successful except for one
>> issue. I have piece of code where I do something like that
>> url.openConnection (proxy); and here I've got
>> UnsupportedOperationException. Apparently something is getting messed
> up
>> in between OSGi and java.protocol.handler.pkgs system property. I  
>> made
>> several unsuccessful attempts to fix it but eventually only way I
>> managed to make it work is by setting "felix.service.urlhandlers" to
>> "false". I think this is a wrong way to do it. What would be the  
>> right
>> way and also what functionality did I loose by setting this property
> to
>> "false"
>>
>> Alex
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
>> For additional commands, e-mail: users-help@felix.apache.org
>>
>>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>

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


RE: OSGi and URL.openConnection

Posted by Os...@emc.com.
Richard,
There is nothing specific in what I am doing. The protocol is HTTP. The
only thing is that I use proxy i.e. call looks like url.openConnection
(proxy). The exception comes from
java.net.URLStreamHandler.openConnection(URLStreamHandler.java:80) and I
use Sun JVM. Normally handler for open connection comes from
sun.net.www.protocol so either urlhandler bundle redefines system
property java.protocol.handler.pkgs or it sets its own
URLStreamHandlerFactory. I didn't look into source code yet and by the
way can I?
Please let me know what additional information do you want me to
provide.

Regards,
	Alex 

-----Original Message-----
From: Richard S. Hall [mailto:heavy@ungoverned.org] 
Sent: Thursday, February 26, 2009 6:51 AM
To: users@felix.apache.org
Subject: Re: OSGi and URL.openConnection

We probably need more details about what is exactly going on, but you 
are right, it shouldn't be necessary to disable it.

What does the URL look like for which you are doing url.openConnection()
?

Are you defining your own stream handler for a custom protocol?

-> richard

Oscherov_Alex@emc.com wrote:
> I am total novice with OSGi and this is my first experiment. I turned
my
> application into set of bundles and it was successful except for one
> issue. I have piece of code where I do something like that
> url.openConnection (proxy); and here I've got
> UnsupportedOperationException. Apparently something is getting messed
up
> in between OSGi and java.protocol.handler.pkgs system property. I made
> several unsuccessful attempts to fix it but eventually only way I
> managed to make it work is by setting "felix.service.urlhandlers" to
> "false". I think this is a wrong way to do it. What would be the right
> way and also what functionality did I loose by setting this property
to
> "false"
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>   

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



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


Re: OSGi and URL.openConnection

Posted by "Richard S. Hall" <he...@ungoverned.org>.
We probably need more details about what is exactly going on, but you 
are right, it shouldn't be necessary to disable it.

What does the URL look like for which you are doing url.openConnection() ?

Are you defining your own stream handler for a custom protocol?

-> richard

Oscherov_Alex@emc.com wrote:
> I am total novice with OSGi and this is my first experiment. I turned my
> application into set of bundles and it was successful except for one
> issue. I have piece of code where I do something like that
> url.openConnection (proxy); and here I've got
> UnsupportedOperationException. Apparently something is getting messed up
> in between OSGi and java.protocol.handler.pkgs system property. I made
> several unsuccessful attempts to fix it but eventually only way I
> managed to make it work is by setting "felix.service.urlhandlers" to
> "false". I think this is a wrong way to do it. What would be the right
> way and also what functionality did I loose by setting this property to
> "false"
>
> Alex
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@felix.apache.org
> For additional commands, e-mail: users-help@felix.apache.org
>
>   

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