-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 
Author Message
 Post subject: Problems in Registering Event Listeners,Can anyone Help??
PostPosted: Tue Jan 24, 2006 1:59 am 
Newbie

Joined: Fri Nov 18, 2005 5:55 am
Posts: 6
I am having problems when i register event listeners programatically, i have extended the SaveorUpdateListener and i register programatically with the following code:

Configuration configuration = new Configuration();
sessionFactory = configuration.configure().buildSessionFactory();
configuration.getSessionEventListenerConfig().setSaveOrUpdateEventListener(new SaveOrUpdateEventListenerImpl());

Now when the statement saveOrUpdate is called, only the defualt listeners are called, i fail to fathom what am i missing. Can anyone please help me out here.

The Alternate was to add the tag in hibernate.cfg of :
<listener type="SaveOrUpdate" class="SaveOrUpdateEventListenerImpl"/>
but application crashes giving error :

at org.hibernate.cfg.Configuration.doConfigure(Configuration.java:1173)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1112)
at org.hibernate.cfg.Configuration.configure(Configuration.java:1098)
at org.imf.db.HibernateUtil.<clinit>(Unknown Source)
at org.imf.db.UserDAOHibernateImpl.getUser(Unknown Source)
at org.imf.services.UserService.login(Unknown Source)
at org.imf.jsf.UserBean.loginAction(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at org.apache.myfaces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:129)
at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:63)
at javax.faces.component.UICommand.broadcast(UICommand.java:106)
at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:90)
.......................
...............

i would appreciate if anyone could help me out in this problem especially in registering programaticaly as well as through cfg xml file. Thank You.

_________________
Haroon Khan


Top
 Profile  
 
 Post subject: Correction in above TAG
PostPosted: Tue Jan 24, 2006 2:30 am 
Newbie

Joined: Fri Nov 18, 2005 5:55 am
Posts: 6
the crashing problem was resolved by replacing SaveOrUpdate by save-update but the Binding problem still existed, When saveorUpdate was called, again only the default listener was called instead of my custom listeners, please anyone who can help me out that i cant seem to bind my custom built listeners to application, everytime default listeners are being invoked when an event is fired. What problem is in my approach.Thank You

_________________
Haroon Khan


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 2 posts ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.