You are trying to reference a bean for this property (with *-ref property 
attribute) which does not exist. packagesToScan property setter takes a list of 
strings representing java packages that this factory bean should take into 
consideration for scanning for JPA entity enhanced classes instead of relying 
on the standard JPA provider scanning of jar files machinery with 
persistence.xml markers in them. So if you really want to explicitly tell 
Spring to do this scanning job, change the property definition with a comma 
separated list of packages like so:

p:packagesToScan=“com.example.package1, com.example.package2”

Best,
Dmitriy.

> On Oct 30, 2014, at 2:57 PM, Whittaker, Geoffrey <geoff.whitta...@unf.edu> 
> wrote:
> 
> 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 cas-user@lists.jasig.org 
> <mailto:cas-user@lists.jasig.org> as: dkopyle...@unicon.net 
> <mailto:dkopyle...@unicon.net>
> To unsubscribe, change settings or access archives, see 
> http://www.ja-sig.org/wiki/display/JSG/cas-user 
> <http://www.ja-sig.org/wiki/display/JSG/cas-user>

-- 
You are currently subscribed to cas-user@lists.jasig.org as: 
arch...@mail-archive.com
To unsubscribe, change settings or access archives, see 
http://www.ja-sig.org/wiki/display/JSG/cas-user

Reply via email to