苦逼 程序员。这个整合我已经弄了两个多星期了!摔!一直有问题!
- -因为我都是复制粘贴再改一改,后来出了问题就找不到哪里错了,毕竟是别人的项目。
今天用myeclipse自动加载的包做的ssh简单登录。
错误一、第一次的错误
错误名称:
HTTP Status 500 - Unable to instantiate Action, userLoginAction, defined for 'login' in namespace '/'userLoginAction
错误内容
java.lang.ClassNotFoundException: userLoginAction
解决办法:
<action name="login" class="userLoginAction" method="login"> 中的
(1)、class值必须和spring配置文件中action对应的bean的id值或者name值一致。
(2)、method值必须和对应的action类中需要被执行的方法名一致。
错误二、
错误名称:
HTTP Status 500 - expecting ''', found '<EOF>' [from entity.Users u where u.name='wang' and u.password=123']; nested exception is org.hibernate.QueryException: expecting ''', found '<EOF>' [from entity.Users u where u.name='wang' and u.password=123']
错误原因:hql语句少写一个‘
String hql="from Users u where u.name='"+username+"' and u.password='"+password+"'";
嘤,错误原因都很小,但是找不到真的很焦急啊!