Quantcast
Channel: Spring Community Forums - Data
Viewing all articles
Browse latest Browse all 297

"Bean must be of type FactoryBean but was actually of type LocalSessionFactoryBean"

$
0
0
Hi,

I need to deploy an application on JBoss AS7. I'm using the version 3.2.3.RELEASE of spring and 3.6.10.Final of hibernate-core. When I run the server I have the following error:

org.springframework.beans.factory.BeanIsNotAFactor yException: Bean named 'frameworkSessionFactory' must be of type [org.springframework.beans.factory.FactoryBean], but was actually of type [org.springframework.orm.hibernate3.LocalSessionFac toryBean]

From reading API results that LocalSessionFactoryBean is in the hierarchy of FactoryBean (in fact the application was working properly on JBoss 4.2 with spring 2.5 and hibernate 3.2). So what could it be the problem?

The bean is so defined:

<bean id="frameworkSessionFactory"
class="org.springframework.orm.hibernate3.LocalSes sionFactoryBean">
<property name="dataSource">
<ref bean="frameworkDataSource" />
</property>

<!-- Must references all OR mapping files. -->
<property name="mappingLocations">
<list>
<value>mappings/framework/PasswordHistory.hbm.xml</value>
<value>mappings/framework/Privilege.hbm.xml</value>
<value>mappings/framework/Role.hbm.xml</value>
<value>mappings/framework/App.hbm.xml</value>
<value>mappings/framework/User.hbm.xml</value>
<value>mappings/framework/Log.hbm.xml</value>
<value>mappings/framework/preference/PreferenceGroup.hbm.xml</value>
<value>mappings/framework/preference/PreferenceTemplate.hbm.xml</value>
<value>mappings/framework/preference/UserPreference.hbm.xml</value>
<value>mappings/framework/preference/UserPreferenceInstance.hbm.xml</value>

</list>
</property>
<property name="typeDefinitions">
<list>
<ref local="nodeEnumType"/>
<ref local="templateEnumType"/>
<ref local="prefTypesEnumType"/>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">
org.hibernate.dialect.Oracle9Dialect
</prop>
<prop key="hibernate.cache.provider_class">
org.hibernate.cache.HashtableCacheProvider
</prop>
<prop key="hibernate.cache.use_second_level_cache">
true
</prop>
<prop key="hibernate.cache.use_query_cache">true</prop>
<prop key="hibernate.show_sql">false</prop>
<prop key="hibernate.format_sql">false</prop>
</props>
</property>
<property name="eventListeners">
<map>
<entry key="merge">
<bean class="org.springframework.orm.hibernate3.support. IdTransferringMergeEventListener"/>
</entry>
</map>
</property>
</bean>


Thank you very much
Filippo

Viewing all articles
Browse latest Browse all 297

Trending Articles