File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Beginning Java and the fly likes Attempted a bean operation on a null object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Attempted a bean operation on a null object" Watch "Attempted a bean operation on a null object" New topic
Author

Attempted a bean operation on a null object

rakesh krish
Greenhorn

Joined: Jan 09, 2011
Posts: 7
Hello All,


I need help with this.....I am just trying to set values in beans and trying to display them but i am getting this error message..


org.apache.jasper.JasperException: Attempted a bean operation on a null object.
org.apache.jasper.runtime.JspRuntimeLibrary.handleGetProperty(JspRuntimeLibrary.java:603)
org.apache.jsp.display_jsp._jspService(display_jsp.java:79)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.runtime.PageContextImpl.doForward(PageContextImpl.java:694)
org.apache.jasper.runtime.PageContextImpl.forward(PageContextImpl.java:665)
org.apache.jsp.secondpage_jsp._jspService(secondpage_jsp.java:98)
org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:70)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:393)
org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:320)
org.apache.jasper.servlet.JspServlet.service(JspServlet.java:266)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


The code goes like this...




Please advice me on the error i received.

Thanks in advance
rakesh


Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
Welcome to the Ranch rakesh krish

The message tells you exactly what is going wrong. You need to make sure the reference does not point to null before you try to use it. The code to initialise the reference is not shown in your posting.
Please always use the code button for code; I shall try to edit your post, since you are new; if I succeed you can see how much better it looks
rakesh krish
Greenhorn

Joined: Jan 09, 2011
Posts: 7
Hello Campbell Ritchie,


Thanks for taking time in trying to help me out. I did initialise the reference but still i am getting the same error.Please do advice...The bean part of the code is as follows.




Please do advice as its the second day that i am stuck at the same place ..
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38519
    
  23
You have already shown us that code, which does not appear to be where your problem is occurring. You need to find the line number from the stack trace.

And do you really want to record a password as a field of a bean?
rakesh krish
Greenhorn

Joined: Jan 09, 2011
Posts: 7
I was trying to learn how this bean concept works in jsp... I just put some random fields. ..I have got it fixed..I was not initialising my refernce bean in my display jsp.That was creating the error as you suggested..Thanks for your help Campbell Ritchie..

 
jQuery in Action, 2nd edition
 
subject: Attempted a bean operation on a null object