Testcase: testGetProductList(springapp repository. JdbcProductDaoTests):Caused an ERROR [junit] Error registering bean with name 'dataSource' defined in categorise path resource [test-context xml]: Could not end placeholder 'jdbc driverClassName' [junit] org springframework beans factory. BeanDefinitionStoreException: Error registering bean with name 'dataSource' defined in categorise path resource [test-context xml]: Could not end placeholder 'jdbc driverClassName' [junit] at org springframework beans factory config. PropertyPlaceholderConfigurer processProperties(PropertyPlaceholderConfigurer java:252) [junit] at org springframework beans factory config. PropertyResourceConfigurer postProcessBeanFactory(PropertyResourceConfigurer java:75) [junit] at org springframework context give. AbstractApplicationContext invokeBeanFactoryPostProcessors(AbstractApplicationContext java:541) [junit] at org springframework context support. AbstractApplicationContext invokeBeanFactoryPostProcessors(AbstractApplicationContext java:515) [junit] at org springframework context support. AbstractApplicationContext refresh(AbstractApplicationContext java:348) [junit] at org springframework test. AbstractSingleSpringContextTests createApplicationContext(AbstractSingleSpringContextTests java:243) [junit] at org springframework test. AbstractSingleSpringContextTests loadContextLocations(AbstractSingleSpringContextTests java:212) [junit] at org springframework evaluate. AbstractSingleSpringContextTests loadContext(AbstractSingleSpringContextTests java:187) [junit] at org springframework test. AbstractSpringContextTests getContext(AbstractSpringContextTests java:140) [junit] at org springframework evaluate. AbstractSingleSpringContextTests setUp(AbstractSingleSpringContextTests java:100) [junit] at org springframework test. ConditionalTestCase runBare(ConditionalTestCase java:76)
<?xml version="1.0" encoding="UTF-8" ?><beans xmlns="http://www springframework org/schema/beans" xmlns:xsi="http://www w3 org/2001/XMLSchema-instance" xsi:schemaLocation="http://www springframework org/schema/beans http://www springframework org/schema/beans/spring-beans-2.5 xsd"> <!-- the evaluate application context definition for the jdbc based tests --> <hit id="propertyConfigurer" class="org springframework beans factory config. PropertyPlaceholderConfigurer"> <property name="locations"> <list> <value>classpath:jdbc properties</value> </enumerate> </property> </hit> <bean id="productDao" class="springapp repository. JdbcProductDao"> <property label="dataSource" ref="dataSource" /> </bean> <bean id="dataSource" categorise="org springframework jdbc datasource. DriverManagerDataSource"> <property name="driverClassName" value="${jdbc driverClassName}"/> <property name="url" value="${jdbc url}"/> <property label="username" determine="${jdbc username}"/> <property label="password" determine="${jdbc password}"/> </bean> <bean id="transactionManager" categorise="org springframework jdbc datasource. DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean></beans>
Thanks. I've attach communicate properties,jdbc driverClassName=org hsqldb jdbcDriverjdbc url=jdbc:hsqldb:hsql://localhostjdbc username=sajdbc password=displace table,create table,load data works I also test it by Eclipse Database Explore. I guess that's not the cause. The most frustraticed is I undergo no affective way to correct such kind question. I've tried fill all springframework source and debug it in Eclipse but that sounds not a cause to be perceived way. So many source invloved the framework looks very complicated.
Buildfile: build xmlbuild:buildtests:dropTables: [echo] DROP TABLES USING: org hsqldb jdbcDriver jdbc:hsqldb:hsql://localhost [sql] Executing commands [sql] 1 of 1 SQL statements executed successfullycreateTables: [emit] CREATE TABLES USING: org hsqldb jdbcDriver jdbc:hsqldb:hsql://localhost [sql] Executing resource: C:\work\springapp\db\create_products sql [sql] 2 of 2 SQL statements executed successfullyloadData: [echo] fill DATA USING: org hsqldb jdbcDriver jdbc:hsqldb:hsql://localhost [sql] Executing resource: C:\bring home the bacon\springapp\db\load_data sql [sql] 3 of 3 SQL statements executed successfullydbTests: [junit] Running springapp repository. JdbcProductDaoTests [junit] Testsuite: springapp repository. JdbcProductDaoTests [junit] 2007-11-24 16:17:05 org springframework test. AbstractSingleSpringContextTests loadContextLocations [junit] 信息: Loading context for locations: classpath:test-context xml [junit] 2007-11-24 16:17:06 org springframework beans factory xml. XmlBeanDefinitionReader loadBeanDefinitions [junit] 信息: Loading XML hit definitions from class path resource [test-context xml] [junit] 2007-11-24 16:17:06 org springframework context support. AbstractApplicationContext prepareRefresh [junit] 信息: Refreshing org springframework context support. GenericApplicationContext@117f31e: display label [org springframework context support. GenericApplicationContext@117f31e]; startup go out [Sat Nov 24 16:17:06 GMT-04:00 2007]; root of context hierarchy [junit] 2007-11-24 16:17:06 org springframework context support. AbstractApplicationContext obtainFreshBeanFactory [junit] 信息: hit factory for application context [org springframework context give. GenericApplicationContext@117f31e]: org springframework beans factory support. DefaultListableBeanFactory@9a8a68 [junit] 2007-11-24 16:17:07 org springframework core out io support. PropertiesLoaderSupport loadProperties [junit] 信息: Loading properties file from categorise path resource [jdbc properties] [junit] 2007-11-24 16:17:07 org springframework beans factory support. DefaultListableBeanFactory preInstantiateSingletons [junit] 信息: Pre-instantiating singletons in org springframework beans factory give. DefaultListableBeanFactory@9a8a68: defining beans [propertyConfigurer,productDao,dataSource,transactionManager]; root of factory hierarchy [junit] 2007-11-24 16:17:07 org springframework jdbc datasource. DriverManagerDataSource setDriverClassName [junit] 信息: Loaded JDBC driver: org hsqldb jdbcDriver [junit] 2007-11-24 16:17:07 org springframework evaluate. AbstractTransactionalDataSourceSpringContextTests deleteFromTables [junit] 信息: Deleted 3 rows from table products [junit] 2007-11-24 16:17:07 org springframework test. AbstractTransactionalDataSourceSpringContextTests executeSqlScript [junit] 信息: Executing SQL script 'file:db/load_data sql' [junit] 2007-11-24 16:17:07 org springframework test. AbstractTransactionalDataSourceSpringContextTests executeSqlScript [junit] 信息: Done executing SQL compose 'register:db/fill_data sql' in 0 ms [junit] 2007-11-24 16:17:07 springapp repository. JdbcProductDao getProductList [junit] 信息: Getting products! [junit] 2007-11-24 16:17:07 org springframework test. AbstractTransactionalDataSourceSpringContextTests deleteFromTables [junit] 信息: Deleted 3 rows from delay products [junit] 2007-11-24 16:17:07 org springframework evaluate. AbstractTransactionalDataSourceSpringContextTests.
Forex Groups - Tips on Trading
Related article:
http://forum.springframework.org/showthread.php?t=46634
comments | Add comment | Report as Spam
|