This happens because the session becomes a proxy when you make a service of it. I guess you have a thread scope on the hibernate session? well, then tapestry-ioc will wrap the session in a proxy that will give you a new session per request.
Actually its neither a tapestry-hibernate nor hibernate-search issue. the problem is that lucene appears to try to cast the session, which fails because its hidden inside the proxy. Our solution was to wrap the session in a service and make that service per-thread instead. Hope it helps! 2007/11/3, T. Papke <[EMAIL PROTECTED]>: > Hi, > > in my project, i currently use hibernate 3.2.5 (and hibernate-search > 3.0.0) together with tapestry 5.0.6 (and tapestry-hibernate module). The > "normal" Hiberate works as excpeted, but the hibernate fulltext-search > runs against an exception - i think because of wrong init of the > hibernate session inside the tapestry module. > > I do: > .... > FullTextSession fullTextSession = Search.createFullTextSession( > hibernateSession ); > .... > > If i try to get a FullTextSession object, i got: > "java.lang.ClassCastException: Processing of request failed with > uncaught exception: $Session_11606936826 cannot be cast to > org.hibernate.classic.Session" > at > org.hibernate.search.impl.FullTextSessionImpl.<init>(FullTextSessionImpl.java:69) > .... > > If i create the hibernate session by myself, everything thems to be > working. > > Is that a bug of Hibernate-search or a bug of tapestry-hibernate module? > > Thanks a lot, > Thomas > > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [EMAIL PROTECTED] > For additional commands, e-mail: [EMAIL PROTECTED] > > -- /ted --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]