samedi 21 février 2015

Spring: not a managed type - separate test project

Initially I built a Maven-Spring application with test cases. It worked well and all tests did pass. But now I have a separate maven project for tests and moved the test classes and the spring xml configuration files that project. I have added the main spring project as dependency.


I suppose the test project doesn't load the list of values defined in "packagesToScan" property in db-context.xml. Could anyone please help me find the error?



<!-- Entity Manager -->
<bean id="entityManagerFactory"
class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean">
<property name="dataSource" ref="dataSource" />
<property name="persistenceUnitName" value="m-entrevista" />
<property name="packagesToScan">
<list>
<value>{com.packagename}</value>
</list>
</property>
</bean>


The project structure looks like this.

Spring test project


enter image description here


Main spring project


enter image description here


When I run a test, it throws an IllegalArgumentException.


enter image description here


Aucun commentaire:

Enregistrer un commentaire