I have just copied a project and when I compile I have an error in my applicationContent.xml, when I put the mouse over the red='dataSource' within the bean 'entity' I got the error "Bean must be of 'javax.sql.DataSource' type, exception " and I am trying to find how to make it work, but I couldn't.
The log error says:
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entity' defined in ServletContext resource [/WEB-INF/applicationContext.xml]: Cannot resolve reference to bean 'dataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'dataSource': Invocation of init method failed; nested exception is javax.naming.NameNotFoundException: El nombre jdbc no este asociado a este contexto
And of course this my applicationContext.xml file:
<?xml version='1.0' encoding='UTF-8'?>
<beans xmlns='http://www.springframework.org/schema/beans'
xmlns:jee='http://www.springframework.org/schema/jee'
xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance'
xmlns:tx='http://www.springframework.org/schema/tx'
xmlns:p='http://www.springframework.org/schema/p'
xmlns:context='http://www.springframework.org/schema/context'
xsi:schemaLocation='http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context.xsd
http://www.springframework.org/schema/jee http://www.springframework.org/schema/jee/spring-jee-3.0.xsd'>
<bean id='velocityEngine' class='org.springframework.ui.velocity.VelocityEngineFactoryBean'>
<property name='velocityProperties'><value>
resource.loader=class
class.resource.loader.class=org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader
</value></property></bean>
<bean id='dataSourceRemote' class='org.springframework.jdbc.datasource.DriverManagerDataSource'
p:driverClassName='com.mysql.jdbc.Driver' p:url='jdbc:mysql://172.23.23.148/SIWP' p:username='webpil' p:password='s2i0w1p0pilandina'/>
<bean id='entity' class='org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean'>
<property name='dataSource' ref='dataSource'/>
<property name="jpaProperties">
<props>
<prop key="hibernate.current_session_context_class">thread</prop>
<prop key="hibernate.connection.autocommit">false</prop>
<prop key="hibernate.jdbc.use_get_generated_keys">true</prop>
<prop key="hibernate.order_updates">true</prop>
<prop key="hibernate.generate_statistics">true</prop>
<prop key="hibernate.connection.release_mode">auto</prop>
</props>
</property>
</bean>
<bean id='transaction' class='org.springframework.orm.jpa.JpaTransactionManager' p:entityManagerFactory-ref='entity'/>
<bean id='appContextAware' class='com.pil.sile.core.view.util.AppContextAware'/>
<tx:annotation-driven transaction-manager='transaction'/>
<jee:jndi-lookup id='dataSource' jndi-name='jdbc/sile'/>
<context:annotation-config/>
</beans>
maybe you can tell me how to define that bean type, or maybe I am doing something else wrong. Any help is welcome