aspose file tools*
The moose likes Java Micro Edition and the fly likes Null URL Exception Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Null URL Exception" Watch "Null URL Exception" New topic
Author

Null URL Exception

Darren Jackson
Ranch Hand

Joined: Jan 18, 2007
Posts: 42
I am trying to connect to a servlet via a MIDlet.

However I am getting a Null URL Exception error.

Does this mean anything to anyone?



Here is my code.



Any help would be great.

Cheers.

Darren
Ernest Friedman-Hill
author and iconoclast
Marshal

Joined: Jul 08, 2003
Posts: 24187
    
  34

You're never testing that the value returned here:

String url = getAppProperty("http://localhost:8080/midp/thename");

is not null, so it might be... and in fact, almost certainly is. The argument to this method is supposed to be the name of a property, like APP_URL or something; the value of the property would be the actual URL. You could start by simply changing above to

String url = "http://localhost:8080/midp/thename";

and see if things work; then look into properly storing this url in your JAD file under a name like APP_URL .


[Jess in Action][AskingGoodQuestions]
Darren Jackson
Ranch Hand

Joined: Jan 18, 2007
Posts: 42
Thank you.

All sorted now :-).
 
Don't get me started about those stupid light bulbs.
 
subject: Null URL Exception