davidwery
Oct 13th, 2004, 11:09 AM
Hi all !
When I try to store a Proxy (created by the ProxyFactoryBean) into Hibernate, I have the following exception :
Exception in thread "main" org.springframework.orm.hibernate.HibernateSystemE xception: No persister for: $Proxy0; nested exception is net.sf.hibernate.MappingException: No persister for: $Proxy0
net.sf.hibernate.MappingException: No persister for: $Proxy0
at net.sf.hibernate.impl.SessionFactoryImpl.getPersis ter(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersiste r(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(Ses sionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.saveWithGenerate dIdentifier(SessionImpl.java:763)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl .java:738)
at product.CompanyDAOImpl.add(CompanyDAOImpl.java:154 )
The code in my DAO is :
public void add(final Company company) throws DAOException {
final Session session;
session = SessionFactoryUtils.getSession(getSessionFactory() , false);
try {
session.save(company);
} catch (HibernateException ex) {
throw SessionFactoryUtils.convertHibernateAccessExceptio n(ex);
}
}
My application-context.xml looks like :
<bean id="companyImpl" class="product.CompanyImpl"/>
<bean id="company" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>product.Company</value>
</property>
<property name="target">
<ref local="companyImpl"/>
</property>
</bean>
<bean id="companyDao" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>product.CompanyDAO</value>
</property>
<property name="interceptorNames">
<list>
<value>myHibernateInterceptor</value>
<value>companyDaoImpl</value>
</list>
</property>
</bean>
Any idea ?
Thanks...
When I try to store a Proxy (created by the ProxyFactoryBean) into Hibernate, I have the following exception :
Exception in thread "main" org.springframework.orm.hibernate.HibernateSystemE xception: No persister for: $Proxy0; nested exception is net.sf.hibernate.MappingException: No persister for: $Proxy0
net.sf.hibernate.MappingException: No persister for: $Proxy0
at net.sf.hibernate.impl.SessionFactoryImpl.getPersis ter(SessionFactoryImpl.java:347)
at net.sf.hibernate.impl.SessionImpl.getClassPersiste r(SessionImpl.java:2690)
at net.sf.hibernate.impl.SessionImpl.getPersister(Ses sionImpl.java:2697)
at net.sf.hibernate.impl.SessionImpl.saveWithGenerate dIdentifier(SessionImpl.java:763)
at net.sf.hibernate.impl.SessionImpl.save(SessionImpl .java:738)
at product.CompanyDAOImpl.add(CompanyDAOImpl.java:154 )
The code in my DAO is :
public void add(final Company company) throws DAOException {
final Session session;
session = SessionFactoryUtils.getSession(getSessionFactory() , false);
try {
session.save(company);
} catch (HibernateException ex) {
throw SessionFactoryUtils.convertHibernateAccessExceptio n(ex);
}
}
My application-context.xml looks like :
<bean id="companyImpl" class="product.CompanyImpl"/>
<bean id="company" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>product.Company</value>
</property>
<property name="target">
<ref local="companyImpl"/>
</property>
</bean>
<bean id="companyDao" class="org.springframework.aop.framework.ProxyFactoryBean">
<property name="proxyInterfaces">
<value>product.CompanyDAO</value>
</property>
<property name="interceptorNames">
<list>
<value>myHibernateInterceptor</value>
<value>companyDaoImpl</value>
</list>
</property>
</bean>
Any idea ?
Thanks...