I'm having a problem with the JPA services registry configuration. I keep
getting an error for the factoryBean object when trying to set the
packagesToScan property. For the life of me, I can't figure it out.
The error message makes me think I need a bean, but I haven't seen one online.
Any thoughts?
I'm getting the following error when following the documentation:
org.springframework.beans.factory.BeanCreationException: Error creating bean
with name 'factoryBean' defined in ServletContext resource
[/WEB-INF/deployerConfigContext.xml]: Cannot resolve reference to bean
'packagesToScan' while setting bean property 'packagesToScan'; nested exception
is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean
named 'packagesToScan' is defined
Here's what's in my DeployerConfig.xml:
<bean id="factoryBean"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"
p:dataSource-ref="dataSource"
p:jpaVendorAdapter-ref="jpaVendorAdapter"
p:packagesToScan-ref="packagesToScan">
<property name="jpaProperties">
<props>
<prop
key="hibernate.dialect">${database.dialect}</prop>
<prop
key="hibernate.hbm2ddl.auto">update</prop>
<prop
key="hibernate.jdbc.batch_size">${database.batchSize}</prop>
</props>
</property>
</bean>
<bean id="jpaVendorAdapter"
class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"
p:generateDdl="true"
p:showSql="true" />
<bean id="serviceRegistryDao"
class="org.jasig.cas.services.JpaServiceRegistryDaoImpl" />
<bean id="transactionManager"
class="org.springframework.orm.jpa.JpaTransactionManager"
p:entityManagerFactory-ref="factoryBean" />
<!--
| Injects EntityManager/Factory instances into beans with
| @PersistenceUnit and @PersistenceContext
-->
<bean
class="org.springframework.orm.jpa.support.PersistenceAnnotationBeanPostProcessor"
/>
<!--
Configuration via JNDI
<bean id="dataSource" class="org.springframework.jndi.JndiObjectFactoryBean"
p:jndiName="java:comp/env/jdbc/cas-source" />
-->
<tx:annotation-driven transaction-manager="transactionManager"/>
<bean
id="dataSource"
class="org.apache.commons.dbcp2.BasicDataSource"
p:driverClassName="${database.driverClass}"
p:url="${database.url}"
/>
--
You are currently subscribed to [email protected] as:
[email protected]
To unsubscribe, change settings or access archives, see
http://www.ja-sig.org/wiki/display/JSG/cas-user