Re: [jnc-users] NullPointerException in HTTPUrlConnection
Status: Beta
Brought to you by:
soapy
From: Marco T. <ma...@mt...> - 2008-05-28 08:32:07
|
Hey Avi Avi Cohen wrote: > Trying to compile a simple code that creates an HTTP connection: If you do not exclude JCE, your sample works. Hope that helps Marco > * > > import > > * java.net.URL;* > > import > > * java.net.URLConnection; > > * > > public > > * *class* PTest { > > *static* *public* *void* main(String[] args) { > > URLConnection conn = > > *null*; > > *try* { > > URL url = > > *new* URL("http://www.apache.org/"); > > conn = url.openConnection(); > > *if* (conn == *null*) { > > System. > > /out/.println("conn is null"); > > } > > conn.connect(); > > } > > *catch* (Exception ex) { > > ex.printStackTrace(); > > } > > } > > } > > Getting NPE in the connect() part: > > java.lang.NullPointerException > at gnu.java.net.protocol.http.HTTPURLConnection.connect(PTest.exe) > at PTest.main(PTest.exe) > > Any ideas ? > > using version 1.1.1, standard installation (other stuff work well). > Running on XP SP2 and Vista. > > Thx, > > Avi > > > > > ------------------------------------------------------------------------ > > ------------------------------------------------------------------------- > This SF.net email is sponsored by: Microsoft > Defy all challenges. Microsoft(R) Visual Studio 2008. > http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/ > > > ------------------------------------------------------------------------ > > _______________________________________________ > javaCompiler-users mailing list > jav...@li... > https://lists.sourceforge.net/lists/listinfo/javacompiler-users |