• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

interceptor problem

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 485
Eclipse IDE Firefox Browser Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic