猿问

INFO: HHH000206: hibernate.properties not found

七月 02, 2016 10:08:31 下午 org.hibernate.Version logVersion

INFO: HHH000412: Hibernate Core {5.1.0.Final}

七月 02, 2016 10:08:31 下午 org.hibernate.cfg.Environment <clinit>

INFO: HHH000206: hibernate.properties not found

七月 02, 2016 10:08:31 下午 org.hibernate.cfg.Environment buildBytecodeProvider

INFO: HHH000021: Bytecode provider name : javassist

七月 02, 2016 10:08:32 下午 org.hibernate.annotations.common.reflection.java.JavaReflectionManager <clinit>

INFO: HCANN000001: Hibernate Commons Annotations {5.0.1.Final}

七月 02, 2016 10:08:33 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl configure

WARN: HHH10001002: Using Hibernate built-in connection pool (not for production use!)

七月 02, 2016 10:08:33 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001005: using driver [com.mysql.jdbc.Driver] at URL [jdbc:mysql:///test?useUnicode=true&charaterEncoding=UTF-8]

七月 02, 2016 10:08:33 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001001: Connection properties: {user=root, password=****}

七月 02, 2016 10:08:33 下午 org.hibernate.engine.jdbc.connections.internal.DriverManagerConnectionProviderImpl buildCreator

INFO: HHH10001003: Autocommit mode: false

七月 02, 2016 10:08:33 下午 org.hibernate.engine.jdbc.connections.internal.PooledConnections <init>

INFO: HHH000115: Hibernate connection pool size: 20 (min=1)

七月 02, 2016 10:08:34 下午 org.hibernate.dialect.Dialect <init>

INFO: HHH000400: Using dialect: org.hibernate.dialect.MySQLDialect

七月 02, 2016 10:08:37 下午 org.hibernate.hql.internal.QueryTranslatorFactoryInitiator initiateService

INFO: HHH000397: Using ASTQueryTranslatorFactory

java.lang.reflect.UndeclaredThrowableException

at com.sun.proxy.$Proxy33.createQuery(Unknown Source)

at service.impl.UsersDAOImpl.uesrsLogin(UsersDAOImpl.java:28)

at action.UsersAction.login(UsersAction.java:20)

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:498)

at com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:452)

at com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:291)

at com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:254)

at 


刃殇
浏览 9339回答 6
6回答

大咪

就是说你的属性文件没有被找到

兮蓅

题主这个问题解决了吗?

刃殇

package service.impl; import java.util.List; import org.hibernate.Query; import org.hibernate.Session; import org.hibernate.Transaction; import db.MyHibernateSessionFactory; import entity.Users; import service.UsersDAO; public class UsersDAOImpl implements UsersDAO{ @Override public boolean uesrsLogin(Users u) { // TODO Auto-generated method stub Transaction tx=null; String hql=""; try { Session session=MyHibernateSessionFactory.getSessionFactory().getCurrentSession(); tx=session.beginTransaction();//开启事务 hql="from Users where username= ? and password= ? "; Query query=session.createQuery(hql);  query.setParameter(0, u.getUsername()); query.setParameter(1, u.getPassword()); List list=query.list(); tx.commit(); if (list.size()>0) { return true; } else { return false; } } catch(Exception ex) { ex.printStackTrace(); return false; } finally { if(tx!=null) { tx=null; } } } }

大咪

这个文件没问题……你用户登录那块的Daoimpl下的userlogin代码能看看吗?我觉得是那的问题
随时随地看视频慕课网APP
我要回答