• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

Mobile Application - Device Null Pointer Exception

 
Ranch Hand
Posts: 57
Java
  • Mark post as helpful
  • send pies
  • 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
  • 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
  • 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
  • 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
  • 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...

 
    Bookmark Topic Watch Topic
  • New Topic