• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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 would challenge you to a battle of wits, but I see you are unarmed - shakespear. Unarmed tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic