Announcement Announcement Module
Collapse
No announcement yet.
failure in mvn test at org.springframework. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • failure in mvn test at org.springframework.

    Hi all
    I have to install mvn to complete a unit test of a project.
    I ha ve installed the mavan and compile and everything build succeesd .
    by running "mvn test" command, I've got the following error.
    Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 0.813 sec <<< FAILURE!
    test_getAllBestellungen(test.BestellungDaoTest) Time elapsed: 0.047 sec <<< ERROR!
    java.lang.IllegalStateException: Failed to load ApplicationContext
    at org.springframework.test.context.TestContext.getAp plicationContext(TestContext.java:201)
    at org.springframework.test.context.support.Dependenc yInjectionTestExecutionListener.injectDependencies (DependencyInjectionTestExecutionListener.java:109 )
    at org.springframework.test.context.support.Dependenc yInjectionTestExecutionListener.prepareTestInstanc e(DependencyInjectionTestExecutionListener.java:75 )
    at org.springframework.test.context.TestContextManage r.prepareTestInstance(TestContextManager.java:255)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.createTest(SpringJUnit4ClassRunner.j ava:111)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.invokeTestMethod(SpringJUnit4ClassRu nner.java:148)
    at org.junit.internal.runners.JUnit4ClassRunner.runMe thods(JUnit4ClassRunner.java:51)
    at org.junit.internal.runners.JUnit4ClassRunner$1.run (JUnit4ClassRunner.java:44)
    at org.junit.internal.runners.ClassRoadie.runUnprotec ted(ClassRoadie.java:27)
    at org.junit.internal.runners.ClassRoadie.runProtecte d(ClassRoadie.java:37)
    at org.junit.internal.runners.JUnit4ClassRunner.run(J Unit4ClassRunner.java:42)
    at org.springframework.test.context.junit4.SpringJUni t4ClassRunner.run(SpringJUnit4ClassRunner.java:97)
    at org.apache.maven.surefire.junit4.JUnit4TestSet.exe cute(JUnit4TestSet.java:62)
    at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.executeTestSet(AbstractDirectoryTestSuite .java:140)
    at org.apache.maven.surefire.suite.AbstractDirectoryT estSuite.execute(AbstractDirectoryTestSuite.java:1 27)
    at org.apache.maven.surefire.Surefire.run(Surefire.ja va:177)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Nativ e Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Native MethodAccessorImpl.java:39)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(De legatingMethodAccessorImpl.java:25)
    at java.lang.reflect.Method.invoke(Method.java:597)
    at org.apache.maven.surefire.booter.SurefireBooter.ru nSuitesInProcess(SurefireBooter.java:345)
    at org.apache.maven.surefire.booter.SurefireBooter.ma in(SurefireBooter.java:1009)
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'TransactionManager' defined in URL [file:/C:/WRITE/WorkSpace/BarOOZE/target/test-classes/TestInfrastructure-configuration.xml]: Cannot resolve reference to bean 'DataSource' while setting bean property 'dataSource'; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'DataSource': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: I/O exception occurred accessing the database schema file
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:275)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveValueIfNecessary(BeanDe finitionValueResolver.java:104)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.applyPropertyValues(Abs tractAutowireCapableBeanFactory.java:1245)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.populateBean(AbstractAu towireCapableBeanFactory.java:1010)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.doCreateBean(AbstractAu towireCapableBeanFactory.java:472)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory$1.run(AbstractAutowireC apableBeanFactory.java:409)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.Abstract AutowireCapableBeanFactory.createBean(AbstractAuto wireCapableBeanFactory.java:380)
    at org.springframework.beans.factory.support.Abstract BeanFactory$1.getObject(AbstractBeanFactory.java:2 64)
    at org.springframework.beans.factory.support.DefaultS ingletonBeanRegistry.getSingleton(DefaultSingleton BeanRegistry.java:222)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:261 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.DefaultL istableBeanFactory.preInstantiateSingletons(Defaul tListableBeanFactory.java:429)
    at org.springframework.context.support.AbstractApplic ationContext.finishBeanFactoryInitialization(Abstr actApplicationContext.java:728)
    at org.springframework.context.support.AbstractApplic ationContext.refresh(AbstractApplicationContext.ja va:380)
    at org.springframework.test.context.support.AbstractG enericContextLoader.loadContext(AbstractGenericCon textLoader.java:84)
    at org.springframework.test.context.support.AbstractG enericContextLoader.loadContext(AbstractGenericCon textLoader.java:42)
    at org.springframework.test.context.TestContext.loadA pplicationContext(TestContext.java:173)
    at org.springframework.test.context.TestContext.getAp plicationContext(TestContext.java:197)
    ... 21 more
    Caused by: org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'DataSource': FactoryBean threw exception on object creation; nested exception is java.lang.RuntimeException: I/O exception occurred accessing the database schema file
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport$1.run(FactoryBeanRegistrySuppor t.java:127)
    at java.security.AccessController.doPrivileged(Native Method)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.doGetObjectFromFactoryBean(Fact oryBeanRegistrySupport.java:116)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport.getObjectFromFactoryBean(Factor yBeanRegistrySupport.java:91)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getObjectForBeanInstance(AbstractBeanF actory.java:1288)
    at org.springframework.beans.factory.support.Abstract BeanFactory.doGetBean(AbstractBeanFactory.java:217 )
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:185)
    at org.springframework.beans.factory.support.Abstract BeanFactory.getBean(AbstractBeanFactory.java:164)
    at org.springframework.beans.factory.support.BeanDefi nitionValueResolver.resolveReference(BeanDefinitio nValueResolver.java:269)
    ... 40 more
    Caused by: java.lang.RuntimeException: I/O exception occurred accessing the database schema file
    at test.TestDataSourceFactory$TestDatabasePopulator.c reateDatabaseSchema(TestDataSourceFactory.java:147 )
    at test.TestDataSourceFactory$TestDatabasePopulator.p opulate(TestDataSourceFactory.java:123)
    at test.TestDataSourceFactory.populateDataSource(Test DataSourceFactory.java:103)
    at test.TestDataSourceFactory.initDataSource(TestData SourceFactory.java:78)
    at test.TestDataSourceFactory.getObject(TestDataSourc eFactory.java:55)
    at org.springframework.beans.factory.support.FactoryB eanRegistrySupport$1.run(FactoryBeanRegistrySuppor t.java:121)
    ... 48 more
    Caused by: java.io.FileNotFoundException: src\test\resources\schema.sql (Das System kann den angegebenen Pfad nicht finden)
    at java.io.FileInputStream.open(Native Method)
    at java.io.FileInputStream.<init>(FileInputStream.jav a:106)
    at org.springframework.core.io.FileSystemResource.get InputStream(FileSystemResource.java:108)
    at test.TestDataSourceFactory$TestDatabasePopulator.p arseSqlIn(TestDataSourceFactory.java:170)
    at test.TestDataSourceFactory$TestDatabasePopulator.c reateDatabaseSchema(TestDataSourceFactory.java:144 )
    ... 53 more
Working...
X