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: unknown protocol: 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



Back to the top