Win a copy of Learn Spring Security (video course) this week in the Spring forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Null pointer exception using CachedRowSetImpl in Servlet

 
Raju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm trying to use CachedRowSetImpl. Created a ResultSet object and passed it to populate method of CachedRowSetImpl. This is working fine in Java program. But when using the same code inside a servlet i'm getting null pointer exception. I have also copied the rowset.jar into common/lib as well as web-inf/lib. Can anybody help please...

Error:
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Ramon",

We're pleased to have you here with us on the Ranch, but there are a few rules that need to be followed, and one is that proper names are required. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
Forum Bartender
 
Raju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks... got my display name updated!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raju,
Thanks for changing your display name.

Fron the exception, it looks like the program can't find your properties file. Try checking that it is in the web project's classpath.
 
Raju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The properties file is being read only when if rowset.jar is placed
in "C:\Program Files\Java\j2re1.4.1_05\lib\ext" or else the classpath
is explicitly set in "setclasspath.bat" in Tomcat4.1 bin directory.

My doubt is that why, even if the rowset.jar is placed in
"tomcat/common/lib" or "web-inf/lib", the properties file is not read.

Whatever is necessary I have to do it within the application as it will
be packaged and delivered to client for deployment. Any suggestions...
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 34071
331
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Raju,
I don't think it is having problems reading the jar. I think it is having problems reading some properties file. Do you know what file it is looking for and where it is located?
 
Raju
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Got some good news...
downloaded jdbc_rowset_tiger-1_0_1-mrel-jwsdp.zip
and got the rowset jar from this distribution.
This one is working fine for me if I place the jar
in web-inf/lib as expected without any exceptions.

Thanks...
 
Bear Bibeault
Author and ninkuma
Marshal
Pie
Posts: 64613
86
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Raju VS",

You have changed your display name to an invalid name. VS is not valid for a last name. Please be advised that accounts with invalid display names are subject to closure.

bear
Forum Bartender
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic