Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [ecf-dev] [Discovery] java.net.MalformedURLException: unknownprotocol: unknown

Hi Scott,

> And I can't find this package/class in my codebase
> org.osgi.impl.service.discovery.ecf.ECFServiceEndpointDescription...am
> I
> missing some other bundle?
Sorry for not mentioning it, that class is not yet part of ECF sources,
but hopefully soon.

I guess you are right, ntp as protocol will probably result in an
malformed url exception as well. On the first glance "ntp://host.de:123"
looked better to me than "unknown://..." :-). So it's not really a
solution. I'll take a close look at the option to change it to URI.
Seems like it would make sense.

Regards, 
Philipp





> -----Original Message-----
> From: ecf-dev-bounces@xxxxxxxxxxx [mailto:ecf-dev-bounces@xxxxxxxxxxx]
> On Behalf Of Scott Lewis
> Sent: Friday, April 17, 2009 4:29 PM
> To: Eclipse Communication Framework (ECF) developer mailing list.
> Subject: Re: [ecf-dev] [Discovery] java.net.MalformedURLException:
> unknownprotocol: unknown
> 
> Hi Phillip,
> 
> Although this does indeed seem like a bug to me, wouldn't creating a
> URL
> for ntp://host.de:123 also result in a MalformedURLException (i.e. no
> protocol for ntp?).
> 
> I actually believe this is a weakness in the spec...i.e. the location
> should be a URI rather than a URL to allow for arbitrary protocols
> (i.e.
> those that have not registered any protocol handler). If I'm wrong on
> this please LMK. But in any case we do need to fix the exception so
> please open as a bug.
> 
> And I can't find this package/class in my codebase
> org.osgi.impl.service.discovery.ecf.ECFServiceEndpointDescription...am
> I
> missing some other bundle?
> 
> Thanks,
> 
> Scott
> 
> 
> Konradi, Philipp wrote:
> >
> > Hi all,
> >
> > While testing our to ECF 3.0 migrated Discovery contribution, I've
> > stumbled upon a_ java.net.MalformedURLException_ thrown for some
> > services discovered via SLP.
> >
> > The exception message and stacktrace is:
> >
> > _java.net.MalformedURLException_: unknown protocol: unknown
> >
> > at java.net.URL.<init>(_URL.java:574_)
> >
> > at java.net.URL.<init>(_URL.java:464_)
> >
> > at java.net.URL.<init>(_URL.java:413_)
> >
> > at java.net.URI.toURL(_URI.java:1081_)
> >
> > at
> >
>
org.osgi.impl.service.discovery.ecf.ECFServiceEndpointDescription.<init
> >(_ECFServiceEndpointDescription.java:205_)
> >
> > ...
> >
> > The cause has been that ServiceInfo returned as location the URI of
> > the form "unknown://host.de:123". When one tries to transform this
> URI
> > to an URL the above exception is thrown. Important to note is that
> the
> > original SLP URL of the discovered service has been of the form
> > "service:ntp://host.de:123".
> >
> > Tracking down where the protocol "unknown" came from, I found out
> that
> > it is set in the
> > org.eclipse.ecf.internal.provider.jslp.ServiceURLAdapter class, the
> > setURI(ServiceURL) method:
> >
> > ...
> >
> > String protocol = aServiceURL.getProtocol();
> >
> > * if* (protocol ==* null*) {
> >
> > protocol = "unknown"; //$NON-NLS-1$
> >
> > }
> >
> > ...
> >
> > It looks to me like a bug. I'd actually expect something like
> > ntp://host.de:123 as URL.
> >
> > What do you think? Is this a known problem?
> >
> > Regards,
> >
> > Philipp
> >
> >
---------------------------------------------------------------------
> ---
> >
> > _______________________________________________
> > ecf-dev mailing list
> > ecf-dev@xxxxxxxxxxx
> > https://dev.eclipse.org/mailman/listinfo/ecf-dev
> >
> 
> _______________________________________________
> ecf-dev mailing list
> ecf-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/ecf-dev


Back to the top