aspose file tools*
The moose likes Struts and the fly likes beanpopulate NullPointerException Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "beanpopulate NullPointerException" Watch "beanpopulate NullPointerException" New topic
Author

beanpopulate NullPointerException

riccardo alfrilli
Greenhorn

Joined: Mar 03, 2008
Posts: 16
hi all!this is my action form:

And this is my Action:


i get a NullPointerException on ShowCustomerDetailA,when it try to get the chosen customer from the action form CustomerAF this is the stack error:

java.lang.NullPointerException
customer_pkg.manageCustomer.action_form.CustomerAF.setCustomerId(CustomerAF.java:30)
sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
java.lang.reflect.Method.invoke(Method.java:597)
org.apache.commons.beanutils.PropertyUtilsBean.invokeMethod(PropertyUtilsBean.java:1773)
org.apache.commons.beanutils.PropertyUtilsBean.setSimpleProperty(PropertyUtilsBean.java:1759)
org.apache.commons.beanutils.PropertyUtilsBean.setNestedProperty(PropertyUtilsBean.java:1648)
org.apache.commons.beanutils.PropertyUtilsBean.setProperty(PropertyUtilsBean.java:1677)
org.apache.commons.beanutils.BeanUtilsBean.setProperty(BeanUtilsBean.java:1022)
org.apache.commons.beanutils.BeanUtilsBean.populate(BeanUtilsBean.java:811)
org.apache.commons.beanutils.BeanUtils.populate(BeanUtils.java:298)
org.apache.struts.util.RequestUtils.populate(RequestUtils.java:493)
org.apache.struts.action.RequestProcessor.processPopulate(RequestProcessor.java:816)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:203)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1196)
org.apache.struts.action.ActionServlet.doGet(ActionServlet.java:414)
javax.servlet.http.HttpServlet.service(HttpServlet.java:690)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)

somebody can help me?tnx!
Joe Ess
Bartender

Joined: Oct 29, 2001
Posts: 8971
    
    9

Something in this line must be null:

I'm not sure what the behavior of Integer.parseInt is when one passes it a null. I'm very suspicious of customerMap since you depend on something other than a constructor to initialize it.
It would be a Good Idea to put some logging in your code so you can see what methods are being invoked and what values you are dealing with. Then we wouldn't just be guessing.


[How To Ask Questions On JavaRanch]
 
 
subject: beanpopulate NullPointerException