Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null URL Exception

 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 24211
35
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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 .
 
Darren Jackson
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you.

All sorted now :-).
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic