URL u=new URL("telnet://route-server.exodus.net");
This line is generating :
java.net.MalformedURLException: unknown protocol: telnet
And I encounter similar problems with other URLs that begin with "news://"
These are URLs extracted from ODP, so I don't understand why such exceptions arise..
Issue
Java throws a
MalformedURLExceptionbecause it couldn't find aURLStreamHandlerfor that protocol. Check the javadocs of the constructors for the details.Summary
Since the
URLclass has anopenConnectionmethod, the URL class checks to make sure that Java knows how to open a connection of the correct protocol. Without aURLStreamHandlerfor that protocol, Java refuses to create aURLto save you from failure when you try to callopenConnection.Solution
You should probably be using the
URIclass if you don't plan on opening a connection of those protocols in Java.