I would check exactly where the NPE is happenning. According to your code and stck trace it happens here:
public String listDomain(Integer dt_oid) { String result= SUCCESS; try { domList=DomainDAO.listDomain(dt_oid); System.out.println("Listing domain"); return result; } catch (Exception e) { // TODO Auto-generated catch block e.printStackTrace(); result=null; return result; } } But since DomainDao.listDomain is static, there is nothing here that would launch the NPE. I suggest to put some traces in the code the follow it and see what's happening. But this has nothing to do with Struts at all. -----Original Message----- From: JavaNoobie [mailto:vivek...@enzentech.com] Sent: Friday, March 11, 2011 7:12 AM To: user@struts.apache.org Subject: Re: Code Help:CRUD example The Jsp file to the same is as follows. http://old.nabble.com/file/p31124495/newjsp.txt newjsp.txt JavaNoobie wrote: > > Hi All, > This is in following to my previous message . > I have developed a small CRUD example using struts 2 . But when I try > to run the same it throws an error (Null pointer exception).. The > exception stack trace is as follows. > Inside AddDomain > java.lang.NullPointerException > at > com.vivek.struts2.action.DomainAction1.listDomain(DomainAction1.java:92) > at > com.vivek.struts2.action.DomainAction1.addupDomain(DomainAction1.java:81 ) > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) > at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) > at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) > at java.lang.reflect.Method.invoke(Unknown Source) > at > com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActi onInvocation.java:404).... > > Could anyone please guide me as to where Im going wrong . Im attaching > the source code of my action , dao class , xml files ad jsp here .Please help. > http://old.nabble.com/file/p31124479/DomainAction1.txt > DomainAction1.txt http://old.nabble.com/file/p31124479/DomainDAO.txt > DomainDAO.txt http://old.nabble.com/file/p31124479/strutsxml.txt > strutsxml.txt > > -- View this message in context: http://old.nabble.com/Code-Help%3ACRUD-example-tp31124479p31124495.html Sent from the Struts - User mailing list archive at Nabble.com. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org Internet communications are not secure and therefore Banco Santander International does not accept legal responsibility for the contents of this message. Any views or opinions presented are solely those of the author and do not necessarily represent those of Banco Santander International unless otherwise specifically stated. Las comunicaciones v'ia Internet no son seguras y, por lo tanto, Banco Santander International no asume responsabilidad legal ni de ning'un otro tipo por el contenido de este mensaje. Cualquier opini'on transmitida pertenece 'unicamente al autor y no necesariamente representa la opini'on de Banco Santander International, a no ser que est'e expresamente detallado. --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@struts.apache.org For additional commands, e-mail: user-h...@struts.apache.org