冷夜行客 2015-07-09 01:01 采纳率: 0%
浏览 6206

junit测试报错,求大神救命,控制台输出如下,

0 2015-07-09 09:04:52,182 [main] INFO org.springframework.beans.factory.xml.XmlBeanDefinitionReader - #org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:316)# - Loading XML bean definitions from URL [file:WebRoot/WEB-INF/spring/applicationContext.xml]
695 2015-07-09 09:04:52,877 [main] INFO com.alibaba.dubbo.common.logger.LoggerFactory - ## - using logger: com.alibaba.dubbo.common.logger.log4j.Log4jLoggerAdapter
701 2015-07-09 09:04:52,883 [main] ERROR com.alibaba.dubbo.common.Version - #com.alibaba.dubbo.common.Version.checkDuplicate(Version.java:144)# - [DUBBO] Duplicate class com/alibaba/dubbo/common/Version.class in 3 jar [file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/dubbo-2.8.4.jar!/com/alibaba/dubbo/common/Version.class, file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/original-dubbo-2.8.4.jar!/com/alibaba/dubbo/common/Version.class, file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/dubbo-2.8.4-shaded.jar!/com/alibaba/dubbo/common/Version.class], dubbo version: 2.8.4, current host: 127.0.0.1
702 2015-07-09 09:04:52,884 [main] ERROR com.alibaba.dubbo.common.Version - #com.alibaba.dubbo.common.Version.checkDuplicate(Version.java:144)# - [DUBBO] Duplicate class com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class in 3 jar [file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/dubbo-2.8.4-shaded.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class, file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/original-dubbo-2.8.4.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class, file:/D:/guyatong/shopworkspace/jpa-demo/WebRoot/WEB-INF/lib/dubbo-2.8.4.jar!/com/alibaba/dubbo/config/spring/schema/DubboNamespaceHandler.class], dubbo version: 2.8.4, current host: 127.0.0.1
747 2015-07-09 09:04:52,929 [main] INFO org.springframework.context.support.GenericApplicationContext - #org.springframework.context.support.AbstractApplicationContext.prepareRefresh(AbstractApplicationContext.java:513)# - Refreshing org.springframework.context.support.GenericApplicationContext@cde55ec: startup date [Thu Jul 09 09:04:52 CST 2015]; root of context hierarchy
1043 2015-07-09 09:04:53,225 [main] INFO org.springframework.orm.jpa.LocalEntityManagerFactoryBean - #org.springframework.orm.jpa.LocalEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalEntityManagerFactoryBean.java:79)# - Building JPA EntityManagerFactory for persistence unit 'jpa-demo'
[EL Info]: 2015-07-09 09:04:54.475--ServerSession(335828946)--EclipseLink, version: Eclipse Persistence Services - 2.5.0.v20130507-3faac2b
[EL Severe]: ejb: 2015-07-09 09:04:56.582--ServerSession(335828946)--Exception EclipseLink-4002: org.eclipse.persistence.exceptions.DatabaseException
Internal Exception: org.postgresql.util.PSQLException: Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
Error Code: 0
4576 2015-07-09 09:04:56,758 [main] ERROR org.springframework.test.context.TestContextManager - #org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:334)# - Caught exception while allowing TestExecutionListener [org.springframework.test.context.support.DependencyInjectionTestExecutionListener@6fcbba0c] to prepare test instance [test.TestUser@2823a32b]
java.lang.IllegalStateException: Failed to load ApplicationContext
at org.springframework.test.context.CacheAwareContextLoaderDelegate.loadContext(CacheAwareContextLoaderDelegate.java:99)
at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:101)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:109)
at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:75)
at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:331)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:213)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:290)
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:292)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:233)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:87)
at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)
at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)
at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:176)
at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:467)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:683)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:390)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:197)

  • 写回答

4条回答 默认 最新

  • 大河行脚 2015-07-09 01:12
    关注

    Connection to localhost:5432 refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.//这句话是说连接你本机的5432端口被拒绝,然后让你检查主机名和端口是否正确。

    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog