• Post Reply Bookmark Topic Watch Topic
  • New Topic

URGENT- NullProinter while creating new record  RSS feed

 
Ramneek Handa
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I am facing a problem of null pointer exception while inserting a record in DB.
I am using CMP- Entity Bean on Weblogic6.1 and Oracle8.1.7.
Say, In a table PO there are 15 fields out of will 5 are not null able and 10 are null able. Out of these 10 null able fields two fields are of Varchar2 and Date type.
Now, when I create a new record with the mandatory fields only it throws Null Pointer Exception. But When I create a new record with not null able fields and that Varchar2 and date type fields, it creates a new records.
I don't know why it is throwing null pointer exception for null able fields.
Although I can handle this for Varchar2 by sending blank space but what is the solution of Date then.
I will appreciate any help for u.
Please respond soon...Thanks
 
Marcos Maia
Ranch Hand
Posts: 977
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, for me it looks like the problem is not with the ejb�s, I think that you are problably trying to do some operation with some null value passed from some form, pls check the code from where you recover the values the user has to fill in, the error is problably there.
regards.
 
Ramneek Handa
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Thanks for the ans.
I believe you did not get the problem. I am inserting the null values for the null able fields only. so it should have allowed to do that.
Anyway I have resolved the problem. I was deployment descriptor�s problem as I as using 5.1 doctype xml deployment descriptor. Now it is working fine with the new 6.0 deployment descriptor.
I will appreciate if you can tell me how to specify finder methods in deployment descriptor for 6.0 as I have been stucked at this point now.
Thanks
Ramneek
 
Ghalib Jamil
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's the date field. I was having the same nightmares with a timestamp field, until I finally passed in a new String() value instead of a null or "" value.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!