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)