vendredi 13 mars 2015

Spring MVC + SpringJPA - runtime error

I'm having runtime problem with Spring JAP appliciation. I have defined the data source. The error message is as follow:



Info: [EL Info]: 2015-03-13 21:31:40.932--ServerSession(1884324141)--EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b
Info: [EL Info]: connection: 2015-03-13 21:31:41.339--ServerSession(1884324141)--file:/C:/Users/smoczyna/glassfish4/glassfish/domains/domain1/lib/classes/_default login successful
Info: [EL Warning]: metamodel: 2015-03-13 21:31:41.371--The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element
Info: [EL Warning]: metamodel: 2015-03-13 21:31:41.809--The collection of metamodel [ManagedType] types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element. The lookup on [class org.squadd.sampledb.entities.Customer] will return null.
Info: [EL Info]: connection: 2015-03-13 21:31:41.825--ServerSession(1884324141)--file:/C:/Users/smoczyna/glassfish4/glassfish/domains/domain1/lib/classes/_default logout successful
Severe: Startup of context /SampleDb-WEB failed due to previous errors


The problem is I'm not using Persistence.xml at all, I have data source defined in applicationContext.xml this way:



...
<context:property-placeholder location="classpath:/META-INF/sample-db.properties"/>

<bean class="org.apache.commons.dbcp2.BasicDataSource" destroy-method="close" id="dataSource">
<property name="driverClassName" value="${database.driverClassName}"/>
<property name="url" value="${database.url}"/>
<property name="username" value="${database.username}"/>
<property name="password" value="${database.password}"/>
<property name="testOnBorrow" value="true"/>
<property name="testOnReturn" value="true"/>
<property name="testWhileIdle" value="true"/>
<property name="timeBetweenEvictionRunsMillis" value="1800000"/>
<property name="numTestsPerEvictionRun" value="3"/>
<property name="minEvictableIdleTimeMillis" value="1800000"/>
</bean>
...

Aucun commentaire:

Enregistrer un commentaire