Skip to main content

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

Title: [ecf-dev] [Discovery] java.net.MalformedURLException: unknown protocol: unknown

Hi all,

While testing our to ECF 3.0 migrated Discovery contribution, Ive 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. Id actually expect something like ntp://host.de:123 as URL.

What do you think? Is this a known problem?

Regards,

Philipp


Back to the top