• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Liutauras Vilda
  • Ron McLeod
Sheriffs:
  • Jeanne Boyarsky
  • Devaka Cooray
  • Paul Clapham
Saloon Keepers:
  • Scott Selikoff
  • Tim Holloway
  • Piet Souris
  • Mikalai Zaikin
  • Frits Walraven
Bartenders:
  • Stephan van Hulst
  • Carey Brown

Mobile Application - Device Null Pointer Exception

 
Ranch Hand
Posts: 57
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi

I am trying to find whether the request is from mobile/tablet/normal browser. For that I followed below configuration

I have added spring-mobile-device1.0 jar to class path.


spring.xml
----------------


web.xml
------------


SessionFilter.java
--------------------


Problem: Null Pointer Exception at : Device currentDevice = DeviceUtils.getCurrentDevice(request);


Could any one please assist to resolve this issue..

 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can you post the complete stack trace?
 
kiran nyala
Ranch Hand
Posts: 57
Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here is stack trace

 
Jayesh A Lalwani
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
That's very weird that you would have a Null Pointer Exception on a call to a static method. Are you sure there is no "Caused by" below that stack trace?. Are you sure line 14 is DeviceUtils.getcurrentDevice Do you have a catch clause inside DeviceUtils.getCurrentDevice method?
 
Greenhorn
Posts: 1
Spring Tomcat Server Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Did any one solve this problem? Because I'm getting the same as you.

Here is the Class where I'm using the DeviceUtils.getCurrentDevice(request);





Here is my stacktrace error, pretty weird because I'm not getting the cause of the error in the trace...

 
I have gone to look for myself. If I should return before I get back, keep me here with this tiny ad:
New web page for Paul's Rocket Mass Heaters movies
https://coderanch.com/t/785239/web-page-Paul-Rocket-Mass
reply
    Bookmark Topic Watch Topic
  • New Topic