-->
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: Upgraded code to Hibernate 3 and get AssertionFailure errors
PostPosted: Tue Jun 23, 2009 10:33 am 
Newbie

Joined: Tue Jun 23, 2009 9:59 am
Posts: 1
I have a bit of code which was originally developed to work with Hibernate 2. I upgraded the Hibernate jars and the only thing it complained about was the use of getHibernateTemplate().delete() methods I used because the parameters passed weren't compatible.

I made those changes (see code below - shows original and new version with comments to point out where I made the changes), compiled with no errors and I deployed it on the web application and received the following error below.

I'm using hibernate-3.2.6.ga.jar, hibernate-annotations-3.3.1.GA.jar, hibernate-validator-3.0.0.ga.jar

Does anyone have any ideas what might be wrong?


Edit:
I'm not 100% sure the error is related but I don't recall it coming up before and it does come up when I restart the server for the changes to take effect. The webapp won't load when the jar is enabled in the web.xml

Code:
[==== CURRENT ===]
import java.util.List;
import org.springframework.orm.hibernate3.support.HibernateDaoSupport;
import filter.model.ISBN;

public class HibernateISBNDao extends HibernateDaoSupport implements ISBNDao {

   @SuppressWarnings("unchecked")
   public List<ISBN> getAll() {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName());
   }
   public void insertIsbn(ISBN isbn) {
      this.getHibernateTemplate().save(isbn);
   }
   @SuppressWarnings("unchecked")
   public List<ISBN> getById(long id) {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName() + " where id = ?", id);
   }
   @SuppressWarnings("unchecked")
   public List<ISBN> getByIsbn(String isbn) {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName() + " where isbn = ?", isbn);
   }
   public void removeItemByIsbn(String isbn) {
                //--- after change----
      this.getHibernateTemplate().delete(isbn);
   }
   public void removeItemById(String id) {
                //---after change----
      ISBN isbn = (ISBN)getHibernateTemplate().get(ISBN.class, id);
      this.getHibernateTemplate().delete(isbn);
   }
}

[==== ORGINAL ====]
import java.util.List;
import org.springframework.orm.hibernate.support.HibernateDaoSupport;
import net.sf.hibernate.type.StringType;
import filter.model.ISBN;

public class HibernateISBNDao extends HibernateDaoSupport implements ISBNDao {

   @SuppressWarnings("unchecked")
   public List<ISBN> getAll() {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName());
   }
   public void insertIsbn(ISBN isbn) {
      this.getHibernateTemplate().save(isbn);
   }
   @SuppressWarnings("unchecked")
   public List<ISBN> getById(long id) {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName() + " where id = ?", id);
   }
   @SuppressWarnings("unchecked")
   public List<ISBN> getByIsbn(String isbn) {
      return this.getHibernateTemplate().find("from " + ISBN.class.getSimpleName() + " where isbn = ?", isbn);
   }
   public int removeItemByIsbn(String isbn) {
                //---before change----
      return this.getHibernateTemplate().delete("from " + ISBN.class.getSimpleName() + " where isbn = ?", isbn, new StringType());
   }
   public int removeItemById(String id) {
                //---before change----
      return this.getHibernateTemplate().delete("from " + ISBN.class.getSimpleName() + " where id = ?", id, new StringType());
   }
}


2009-06-23 10:22:38,846 [TP-Processor2] WARN vyre.events.dispatcher.ThreadQueueDispatcher - Dispatcher not accepting any new incoming events
2009-06-23 10:22:38,847 [TP-Processor2] ERROR org.hibernate.AssertionFailure - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
java.lang.IllegalStateException: Dispatcher not accepting any new incoming events
at vyre.events.dispatcher.ThreadQueueDispatcher.dispatch(ThreadQueueDispatcher.java:150)
at vyre.events.service.Hub.sendEvent(Hub.java:83)
at vyre.events.event.EventFactory.toSendOrNotToSendThatIsTheQuestion(EventFactory.java:90)
at vyre.events.event.EventFactory.globalTransientEvent(EventFactory.java:229)
at vyre.core.cache.oscache.CacheBroadcaster.sendNotification(CacheBroadcaster.java:38)
at com.opensymphony.oscache.plugins.clustersupport.AbstractBroadcastingListener.cacheEntryFlushed(AbstractBroadcastingListener.java:49)
at com.opensymphony.oscache.base.Cache.dispatchCacheEntryEvent(Cache.java:856)
at com.opensymphony.oscache.base.Cache.flushEntry(Cache.java:982)
at com.opensymphony.oscache.base.Cache.flushEntry(Cache.java:491)
at com.opensymphony.oscache.base.Cache.flushEntry(Cache.java:478)
at com.opensymphony.oscache.general.GeneralCacheAdministrator.flushEntry(GeneralCacheAdministrator.java:216)
at vyre.core.cache.oscache.OSCache.remove(OSCache.java:91)
at org.hibernate.cache.NonstrictReadWriteCache.release(NonstrictReadWriteCache.java:145)
at org.hibernate.action.EntityUpdateAction.afterTransactionCompletion(EntityUpdateAction.java:248)
at org.hibernate.engine.ActionQueue.afterTransactionCompletion(ActionQueue.java:198)
at org.hibernate.impl.SessionImpl.afterTransactionCompletion(SessionImpl.java:424)
at org.hibernate.jdbc.JDBCContext.afterTransactionCompletion(JDBCContext.java:229)
at org.hibernate.jdbc.JDBCContext.connectionCleanedUp(JDBCContext.java:97)
at org.hibernate.jdbc.ConnectionManager.cleanup(ConnectionManager.java:394)
at org.hibernate.jdbc.ConnectionManager.manualDisconnect(ConnectionManager.java:339)
at org.hibernate.impl.SessionImpl.disconnect(SessionImpl.java:375)
at org.springframework.orm.hibernate3.HibernateTransactionManager.doCleanupAfterCompletion(HibernateTransactionManager.java:744)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.cleanupAfterCompletion(AbstractPlatformTransactionManager.java:966)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:759)
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:678)
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:321)
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:116)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
at $Proxy74.update(Unknown Source)
at vyre.realms.RealmWorker.prepareLogin(RealmWorker.java:357)
at vyre.realms.RealmWorker.prepareLogin(RealmWorker.java:243)
at vyre.realms.RealmWorker.authenticate(RealmWorker.java:198)
at vyre.realms.gui.SessionController.execute(SessionController.java:86)
at vyre.interstate.Dispatcher.executeController(Dispatcher.java:208)
at vyre.interstate.Dispatcher.processState(Dispatcher.java:110)
at vyre.interstate.Dispatcher.service(Dispatcher.java:72)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.publishing.PathFilter.doFilter(PathFilter.java:147)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.content.search.permissions.ViewPermissionFilter.doFilter(ViewPermissionFilter.java:27)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.springframework.orm.hibernate3.support.OpenSessionInViewFilter.doFilterInternal(OpenSessionInViewFilter.java:198)
at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:76)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at vyre.realms.GateKeeper.doFilter(GateKeeper.java:136)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:286)
at org.apache.jk.server.JkCoyoteHandler.invoke(JkCoyoteHandler.java:190)
at org.apache.jk.common.HandlerRequest.invoke(HandlerRequest.java:283)
at org.apache.jk.common.ChannelSocket.invoke(ChannelSocket.java:767)
at org.apache.jk.common.ChannelSocket.processConnection(ChannelSocket.java:697)
at org.apache.jk.common.ChannelSocket$SocketConnection.runIt(ChannelSocket.java:889)
at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:690)
at java.lang.Thread.run(Thread.java:595)


Top
 Profile  
 
 Post subject: Re: Upgraded code to Hibernate 3 and get AssertionFailure errors
PostPosted: Wed Jun 24, 2009 9:31 am 
Newbie

Joined: Fri Jul 30, 2004 5:35 am
Posts: 9
Location: Iceland
This issue has nothing to do with hibernate, the exception occurs because you are using a hibernate instance that is configured to use oscache and VYRE Unify CacheBroadcaster. I assume you are writing some sort of extension or portlet for Unify.

The dispatcher has either been stopped, or never started. If it never started there should be an exception sooner in the log (this can happen in due to port conflicts in versions 4.4 and 4.4.0.1, version 4.4.0.2+ Unify will not start if there is a port conflict for the event port).

I suggest you post the issue on VYRE's bug tracker: http://tracker.vyre.com

_________________
Sindri Traustason
Senior Software Engineer
VYRE Ltd. http://www.vyre.com


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.