为了账号安全,请及时绑定邮箱和手机立即绑定

TestUsersDAOImpl运行失败。

java.lang.ClassCastException: org.hibernate.boot.registry.internal.BootstrapServiceRegistryImpl cannot be cast to org.hibernate.boot.registry.StandardServiceRegistry

at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:655)

at db.MyHibernateSessionFactory.getSessionFactory(MyHibernateSessionFactory.java:20)

at service.impl.UsersDAOImpl.usersLogin(UsersDAOImpl.java:22)

at service.impl.TestUsersDAOImpl.testUsersLogin(TestUsersDAOImpl.java:14)

at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)

at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)

at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)

at java.lang.reflect.Method.invoke(Method.java:497)

at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:45)

at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)

at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:42)

at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)

at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:263)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:68)

at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:47)

at org.junit.runners.ParentRunner$3.run(ParentRunner.java:231)

at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:60)

at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:229)

at org.junit.runners.ParentRunner.access$000(ParentRunner.java:50)

at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:222)

at org.junit.runners.ParentRunner.run(ParentRunner.java:300)

at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:86)

at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)

at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)


正在回答

2 回答

解决了,谢谢。

0 回复 有任何疑惑可以回复我~

你用的是Hibernate5吧,Hibernate5不用这种方式创建SessionFactory了,

0 回复 有任何疑惑可以回复我~

举报

0/150
提交
取消
使用Struts2+Hibernate开发学生信息管理功能
  • 参与学习       80701    人
  • 解答问题       754    个

Strust2+Hibernate整合开发案例,Java Web开发技能更上一层楼

进入课程

TestUsersDAOImpl运行失败。

我要回答 关注问题
意见反馈 帮助中心 APP下载
官方微信