This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
The moose likes Java Micro Edition and the fly likes Web page for hand-held Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Mobile » Java Micro Edition
Bookmark "Web page for hand-held" Watch "Web page for hand-held" New topic
Author

Web page for hand-held

Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
Not sure if this is the right forum - but here goes.

I'm developing a web app that will be viewed only from a handheld device, via a wireless network. My app worked fine in a test environment, but when I access it on a handheld, one of my objects isn't visible - I get a null-pointer exception when I try to display it. Without going into all the specifics, is there something special I should know about accessing my page & my objects thru a handheld?

My webserver is Tomcat 5, & using j2sdk1.4.2_02.

Darn. Usually by the time I word my question, I answer it myself. Guess I'll post this one. Any help's appreciated!!
[ January 10, 2005: Message edited by: Elaine Micheals ]

Gail Mikels
Lasse Koskela
author
Sheriff

Joined: Jan 23, 2002
Posts: 11962
    
    5
Do you get the NullPointerException on the server-side or from the handheld's internals?


Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
I got a HTTP Status 500 error, with a root cause of java.lang.NullPointerException, in the handheld's browser. No error in the Tomcat console on the server side. The browser error message points to a line in the compiled JSP. When I look at that line (or close to it...) it is the first time (on this page) where I'm referencing a method on one of my Objects.

Thank you for your interest in my problem!
Yuri Magrisso
Ranch Hand

Joined: Sep 13, 2003
Posts: 58
It is hard to say what can be the problem.
It can be an encoding or content-type problem.
I had once problem when I tried to send POST data without setting proper content-type. Consequently the servlet could not get the parameters from the request and so on.

If you can run that under debugger I think it will be the easiest to catch the problem.

Best regards,
Yuri
Gail Mikels
Ranch Hand

Joined: May 07, 2001
Posts: 634
AACCK!! I just realized I had different versions of both j2sdk & tomcat on my test machine vs the server machine. I reinstalled both & problem's gone
<knocks on wood/>

Thank you for your interest in helping!
 
 
subject: Web page for hand-held