Error message:
java.lang.IllegalStateException:Failed to load ApplicationContext
caused by:org.springframework.beans.factory.BeanCreationException:Error creating bean with Name ' dataSource ' defined In class path resource [Applicationcontext.xml]: Error setting property values; Nested exception is Org.springframework.beans.NotWritablePropertyException:Invalid property ' Jdbcurl ' of Bean class [ Org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property ' Jdbcurl ' are not writable or have an invalid s Etter method. Does the parameter type of the setter match the return type of the getter?
caused By:org.springframework.beans.NotWritablePropertyException:Invalid property ' Jdbcurl ' of Bean class [ Org.springframework.jdbc.datasource.DriverManagerDataSource]: Bean property ' Jdbcurl ' are not writable or have an invalid s Etter method. Does the parameter type of the setter match the return type of the getter?
Spring built-in data source configuration :
<!--introduce external property profiles--
<context:property-placeholder location= "Classpath:db.properties"/>
<!--Configure the built-in data source bean, using db.properties--
<bean id= "DataSource" class= "Org.springframework.jdbc.datasource.DriverManagerDataSource" >
<property name= "Driverclassname" value= "${jdbc.driverclass}"/>
<property name= "url" value= "${jdbc.url}"/>
<property name= "username" value= "${jdbc.username}"/>
<property name= "Password" value= "${jdbc.password}"/>
</bean>
C3P0 Connection Pool configuration:
<!--c3p0 data source, using db.properties--
<bean id= "DataSource" class= "Com.mchange.v2.c3p0.ComboPooledDataSource" >
<property name= "Driverclass" value= "${jdbc.driverclass}"/>
<property name= "Jdbcurl" value= "${jdbc.url}"/>
<property name= "user" value= "${jdbc.username}"/>
<property name= "Password" value= "${jdbc.password}"/>
</bean>
Error Reason: Note the name attribute in the property name.
java.lang.IllegalStateException:Failed to load ApplicationContext (2)