• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

interceptor problem

 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I got a problem with interceptor implementation in my application. and the following is my struts.xml file



What happens here is when I reference my interceptor to listcustomer action, I got NullPointerException. And if I do NOT reference it, the whole thing is working fine.

and again, then I realize (after reading some websites) in my stack(mystack), there is no defaultStack and it might be the reason I got error. So, I change it as follow



and then I reference the stack (mystack) to the action listcustomer. Again, nullpointerexception.

So, I took the that out, and put it in the action tag. as follow





and again null pointer exception.

I am really lost now. can someone lift me up please? thanks.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Friend, There is no problem in struts configuration please provide more details when you are posting here we couldn't understand what you are doing without details. You should provide complete stack trace as well. In Struts2 one thing you should remember when you are overriding interceptor stack you have to configure the default interceptor-stack in you want or else it wouldn't be called. You have problem in custom Interceptor. Post here if you feel something that wouldn't be shared share a sample code similar to that. If so we can help you.
 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am sorry, it is ok to share

the following is my CustomerListAction. Basically, what it does is getting the list of customer from my table in database.




and this is my DAO implementation which implement a CustomerListDAOImpl method from its interface.



this is my custom interceptor which is going to check whether a user is logged in or not.



The following is the jar that I used


that is and I DO want to understand it please. Thanks.
 
Mohana Rao Sv
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In which line you are getting NullPointerException and provide ExceptionStackTrace.
 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks by the way..

the error is when I modified my struts.xml file as follow ..


the related Action Class is as follow



and the related DAO is as follow



the error report is as follow ..



by the way as soon as I run the project I used to get the following error and I am not quite sure whether it is related or not


thanks Mohana
 
tyte kyat
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, Mohana

I got it running. the reason I got error is in my struts.xml file. As I am using full-hibernate-plugin, my custom stack should inherit from defaultStackHibernate or basicStackHibernate.

Thanks.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic