• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

HttpSessionAtivationListener Configuring gets severe exception

 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is my listener class

web.xml


Why I am getting following exception , I have no idea ,I tried to figure it out like a hell but got frustrated ,please help.


best regards,
omi
 
S Sravs
Ranch Hand
Posts: 85
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
try this:
public Bear(String name)
{
this.name=name;
}
i havent tried but the "instantiation exception" is foo.bar

Regards
Sravanthi
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It did not help as I already knew because the problem is not access modifiers
as I already declared class as a public so the constructor is public.

When I remove the HttpSessionActivationListener ,there is no exception
but HFSJ book and specs suggests that I have to configure it in DD.

so why it throws shit of problems when I implement HttpSessionActivationListener ,configuring it in DD?


best regards,
omi
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
http://www.coderanch.com/t/174728/java-Web-Component-SCWCD/certification/Listeners-No-configure-DD

This may help you out.

we no need to register HttpSessionBindingListener and HttpSessionActivationListener in DD

for more info, you can check at point [254] in below link:

http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed

Hope this helps you.
[ May 16, 2008: Message edited by: Garla Ravi ]
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although you don't need to configure a HttpSessionActivationListener, the main problem here is that the container cannot instanciate your class because you have no default constructor. There must be a public Bear() in your class. The constructor is not going to call your Bear(String) constructor because it doesn't know what parameter to pass.
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Garla Ravi:
http://www.coderanch.com/t/174728/java-Web-Component-SCWCD/certification/Listeners-No-configure-DD

we no need to register HttpSessionBindingListener and HttpSessionActivationListener in DD


[ May 16, 2008: Message edited by: Garla Ravi ]


According to HFSJ 1.4 you need to register HttpSessionAttributeListener,
HttpSessionListener and HttpSessionActivationListener in DD.

Only HttpSessionBindingListener is exempted of this rule.

but thanks to you I know the truth.

best regards,
omi
[ May 17, 2008: Message edited by: omi sharma ]
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Christophe Verre:
There must be a public Bear() in your class. The constructor is not going to call your Bear(String) constructor because it doesn't know what parameter to pass.


Yea true,I did what you told me and it's fine.You know how to hit the goal.

best regards,
omi
 
Garlapati Ravi
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


]http://www.oreilly.com/catalog/headservletsjsp/errata/headservletsjsp.confirmed

have you referred 254th point in the link above ?
[ May 17, 2008: Message edited by: Garla Ravi ]
 
Bobby Sharma
Ranch Hand
Posts: 598
3
Google App Engine jQuery Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Garla Ravi:
[CODE]
have you referred 254th point in the link above ?



Have you noticed that I already have thanked you?

best regards,
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic