-->
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.  [ 5 posts ] 
Author Message
 Post subject: FullTextIndexCollectionEventListener cannot be cast to PostI
PostPosted: Mon May 05, 2008 10:33 am 
Newbie

Joined: Wed Apr 30, 2008 12:10 pm
Posts: 6
Hi,

I was testing moving my hibernate code to JSP on Jetty and got the error at the bottom of this message. This error occurs when I run the webapp from a WAR file (which worked before integrating hibernate) but it works fine when just using the JSP files (i.e. pointing Jetty to the src/main/webapp directorty. Any ideas what might be going wrong?

java.lang.ExceptionInInitializerError

java.lang.ExceptionInInitializerError at bla.database.util.HibernateUtil.(HibernateUtil.java:17) at jsp.test_005fhibernate_jsp._jspService(jsp.test_005fhibernate_jsp:48) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450) Caused by: java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexCollectionEventListener cannot be cast to org.hibernate.event.PostInsertEventListener at org.hibernate.cfg.search.SearchConfiguration.enableHibernateSearch(SearchConfiguration.java:81) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:856) at bookmover.database.util.HibernateUtil.(HibernateUtil.java:13) ... 18 more
org.hibernate.search.event.FullTextIndexCollectionEventListener cannot be cast to org.hibernate.event.PostInsertEventListener

java.lang.ClassCastException: org.hibernate.search.event.FullTextIndexCollectionEventListener cannot be cast to org.hibernate.event.PostInsertEventListener at org.hibernate.cfg.search.SearchConfiguration.enableHibernateSearch(SearchConfiguration.java:81) at org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:856) at bla.database.util.HibernateUtil.(HibernateUtil.java:13) at jsp.test_005fhibernate_jsp._jspService(jsp.test_005fhibernate_jsp:48) at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:93) at javax.servlet.http.HttpServlet.service(HttpServlet.java:820) at org.mortbay.jetty.servlet.ServletHolder.handle(ServletHolder.java:487) at org.mortbay.jetty.servlet.ServletHandler.handle(ServletHandler.java:362) at org.mortbay.jetty.security.SecurityHandler.handle(SecurityHandler.java:216) at org.mortbay.jetty.servlet.SessionHandler.handle(SessionHandler.java:181) at org.mortbay.jetty.handler.ContextHandler.handle(ContextHandler.java:726) at org.mortbay.jetty.webapp.WebAppContext.handle(WebAppContext.java:405) at org.mortbay.jetty.handler.HandlerWrapper.handle(HandlerWrapper.java:152) at org.mortbay.jetty.Server.handle(Server.java:324) at org.mortbay.jetty.HttpConnection.handleRequest(HttpConnection.java:505) at org.mortbay.jetty.HttpConnection$RequestHandler.headerComplete(HttpConnection.java:828) at org.mortbay.jetty.HttpParser.parseNext(HttpParser.java:514) at org.mortbay.jetty.HttpParser.parseAvailable(HttpParser.java:211) at org.mortbay.jetty.HttpConnection.handle(HttpConnection.java:380) at org.mortbay.io.nio.SelectChannelEndPoint.run(SelectChannelEndPoint.java:395) at org.mortbay.thread.BoundedThreadPool$PoolThread.run(BoundedThreadPool.java:450)


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 05, 2008 10:57 am 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Hi,

moving from Jetty from which platform? JBoss? Looks like a class loading issue. Are you sure you have all (in the right version) required jars?


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 05, 2008 11:17 am 
Newbie

Joined: Wed Apr 30, 2008 12:10 pm
Posts: 6
hardy.ferentschik wrote:
Hi,

moving from Jetty from which platform? JBoss? Looks like a class loading issue. Are you sure you have all (in the right version) required jars?


No i meant moving from just regular java to a JSP webapp that runs using Jetty. I use maven to package the WAR and that one uses the hibernate plugins. It runs fine when running the JSP uncompiled. When running it from the WAR it gives this error (when creating a session).


Top
 Profile  
 
 Post subject:
PostPosted: Mon May 05, 2008 12:22 pm 
Hibernate Team
Hibernate Team

Joined: Thu Apr 05, 2007 5:52 am
Posts: 1689
Location: Sweden
Can you check the war file to see which hibernate related jar files in which version end up in the war file?

What do you mean with 'regular java'? Running the app via maven jetty:run? Or do you have another way of packaging the artifact? If using jetty:run it could be that the dependencies for hibernate tools are on the classpath as well and somehow make it work.

--Hardy


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 03, 2008 2:45 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
It's either
- some version mismatch, can you list the version of all the elements you use (Core, annotations, em, search)
- or some classpath issue where you left an older version of one of the components

_________________
Emmanuel


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 5 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.