I just upgraded from 1.2.6 to 2.0-M5 and now I'm getting an exception from DriverManagerDataSource becuase it seems that PropertyPlaceholderConfigurer didn't substitute it's values.
Here's the relevent config:
And here's the log output:Code:<beans> <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:/jdbc.properties</value> </list> </property> </bean> <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="url"> <value>${jdbc.url}</value> </property> <property name="driverClassName"> <value>${jdbc.driverClassName}</value> </property> <property name="username"> <value>${jdbc.username}</value> </property> <property name="password"> <value>${jdbc.password}</value> </property> </bean> ... </beans>
org.springframework.beans.factory.support.DefaultL istableBeanFactory: Invoking BeanPostProcessors before instantiation of bean 'dataSource'
org.springframework.beans.CachedIntrospectionResul ts: Getting BeanInfo for class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.CachedIntrospectionResul ts: Caching PropertyDescriptors for class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'class' of type [java.lang.Class]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'connection' of type [java.sql.Connection]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'connectionProperties' of type [java.util.Properties]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'driverClassName' of type [java.lang.String]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'logWriter' of type [java.io.PrintWriter]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'loginTimeout' of type [int]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'password' of type [java.lang.String]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'url' of type [java.lang.String]
org.springframework.beans.CachedIntrospectionResul ts: Found property 'username' of type [java.lang.String]
org.springframework.beans.CachedIntrospectionResul ts: Class [org.springframework.jdbc.datasource.DriverManagerD ataSource] is cache-safe
org.springframework.core.CollectionFactory: Creating [java.util.LinkedHashMap]
org.springframework.beans.factory.support.DefaultL istableBeanFactory: Eagerly caching bean with name 'dataSource' to allow for resolving potential circular references
org.springframework.beans.BeanWrapperImpl: About to invoke write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setUrl(java.lang.String)] on object of class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.BeanWrapperImpl: Invoked write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setUrl(java.lang.String)] with value of type [java.lang.String]
org.springframework.beans.BeanWrapperImpl: About to invoke write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setDriverClassName(java.lang.String) throws org.springframework.jdbc.CannotGetJdbcConnectionEx ception] on object of class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.BeanWrapperImpl: About to invoke write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setUsername(java.lang.String)] on object of class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.BeanWrapperImpl: Invoked write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setUsername(java.lang.String)] with value of type [java.lang.String]
org.springframework.beans.BeanWrapperImpl: About to invoke write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setPassword(java.lang.String)] on object of class [org.springframework.jdbc.datasource.DriverManagerD ataSource]
org.springframework.beans.BeanWrapperImpl: Invoked write method [public void org.springframework.jdbc.datasource.DriverManagerD ataSource.setPassword(java.lang.String)] with value of type [java.lang.String]
org.springframework.beans.factory.support.DefaultL istableBeanFactory: Destroying singletons in factory {org.springframework.beans.factory.support.Default ListableBeanFactory defining beans [...]; root of BeanFactory hierarchy}
org.springframework.web.context.ContextLoader: Context initialization failed
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'dataSource' defined in ServletContext resource [/WEB-INF/classes/persistence.xml]: Error setting property values; nested exception is PropertyAccessExceptionsException (1 errors)
Caused by:
PropertyAccessExceptionsException (1 errors)
org.springframework.beans.MethodInvocationExceptio n: Property 'driverClassName' threw exception; nested exception is org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not load JDBC driver class [${jdbc.driverClassName}]; nested exception is java.lang.ClassNotFoundException: ${jdbc.driverClassName}
Caused by:
org.springframework.jdbc.CannotGetJdbcConnectionEx ception: Could not load JDBC driver class [${jdbc.driverClassName}]; nested exception is java.lang.ClassNotFoundException: ${jdbc.driverClassName}
Caused by:
java.lang.ClassNotFoundException: ${jdbc.driverClassName}


Reply With Quote