J# URL setup

Hi  everyone,
Got a problem here I am tearing my hair out over.
Am creating a J# windows app in which I am trying to declare a URL.
My declaration goes as follows.

import java.net.*

URL url = new URL ("http://localhost:8080/soap/servlet/rpcrouter/");

When I try to build the solution I get the MalformedURLException.
The declaration came from a console application which worked perfectly so
I know that it cant be the declaration.

Any help is greatly appreciated.

Mike



Answer this question

J# URL setup

  • Andy Olson - MSFT

    Hi Mike,

    The source code you have mentioned is just asking you to catch the MalformedURLException.

    You can get this compiling by just putting a try catch block around it.

    try{
    URL url = new URL (
    http://localhost:8080/soap/servlet/rpcrouter/);
    }catch(MalformedURLException e){
       e.printStackTrace();
    }

    Let me know if this doesnt answer your question.

    Thanks


  • J# URL setup