URL() problem

Urban Widmark urban@svenskatest.se
Fri Apr 9 15:58:00 GMT 1999


Hello
I've been playing a little with gcj when I ran into the following problem.
The following fails with an exception, where:
	String url = " http://www.svenskatest.se/ ";
	URL u = new URL(url);
	URLConnection con = u.openConnection();
The error message is:
java.net.MalformedURLException: Handler for protocol not found
I added an 'e.printStackTrace();' to java.net.URL.setURLStreamHandler, to
see why the handler isn't loaded (to me the code looked like it should
work). Then I got these:
java.lang.ClassNotFoundException: gnu.gcj.protocol.http.Handler
java.lang.ClassNotFoundException: sun.net.www.protocol.http.Handler
but nm shows traces of 'gnu.gcj.protocol.http.Handler' in libgcj.a (the
installed one), such as:
00000000 T __Q53gnu3gcj8protocol4http7Handler
However nm does not show anything in my program, but it does show other
parts of the gnu.* packages. I'm thinking that this is a linkage problem,
where the code from Handler.o is not included since it is not directly
referenced, only loaded dynamically by the URL class.
Is it a known problem? Workarounds?
/Urban
---
Urban Widmark urban@svenskatest.se
Svenska Test AB +46 90 71 71 23


More information about the Java mailing list

AltStyle によって変換されたページ (->オリジナル) /