[jboss-user] [JBoss Seam] - HibernateSessionProxy ClassCastException

tangdazhu do-not-reply at jboss.com
Sat Mar 24 08:57:11 EDT 2007

1. i want to inject the hibernate session in seam,so i config the component.xml as follows:
	<core:hibernate-session-factory name="hibernateSessionFactory" />

	<core:managed-hibernate-session name="session" auto-create="true"
		session-factory-jndi-name="java:/HibernateSessionFactory" />

2. Inside managed Bean , i use @in to inject the Hibernate Session,
but when i am using DetachedCriteria in my application

		 DetachedCriteria criteria =

i got the HibernateSessionProxy ClassCastException,i debug the application and found that seam injected HibernateSessionProxy not the real HibernateSession object . So DetachedCriteria can't work.

Does it mean that i can't use DetachedCriteria in my application?

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4031271#4031271

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4031271

More information about the jboss-user mailing list