当前位置:编程学习 > JAVA >>

Struts Problem Report的问题!求高手解决 问题异常如下

Struts Problem Report Struts has detected an unhandled exception: Messages: query did not return a unique result: 6 File: org/hibernate/impl/AbstractQueryImpl.java Line number: 820 Stacktraces org.hibernate.NonUniqueResultException: query did not return a unique result: 6 org.hibernate.impl.AbstractQueryImpl.uniqueElement(AbstractQueryImpl.java:820) org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:811) com.crskssec.hib.imp.UsersImp.getOneUser(UsersImp.java:25) com.crskssec.service.UsersServiceImp.getOneUser(UsersServiceImp.java:46) sun.reflect.GeneratedMethodAccessor688.invoke(Unknown Source) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:310) org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:106) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:89) org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) $Proxy67.getOneUser(Unknown Source) com.crskssec.web.action.UserLoginAction.loginIn(UserLoginAction.java:30) sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) java.lang.reflect.Method.invoke(Method.java:597) com.opensymphony.xwork2.DefaultActionInvocation.invokeAction(DefaultActionInvocation.java:440) com.opensymphony.xwork2.DefaultActionInvocation.invokeActionOnly(DefaultActionInvocation.java:279) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:242) com.opensymphony.xwork2.interceptor.DefaultWorkflowInterceptor.doIntercept(DefaultWorkflowInterceptor.java:163) com.opensymphony.xwork2.interceptor.MethodFilterInterceptor.intercept(MethodFilterInterceptor.java:87) com.opensymphony.xwork2.DefaultActionInvocation.invoke(DefaultActionInvocation.java:236) com.opensymphony.xwork2.validator.ValidationInterceptor.doIntercept(ValidationInterceptor.java:249) org.apache.struts2.interceptor.validation.AnnotationValidationInterceptor.doIntercept(AnnotationValidationInterceptor.java:68)
补充:你看到了这个页面,因为发展模式已启用。发展模式,或DEVMODE,使额外的调试行为和报告,以协助开发。要禁用此模式下,设置:

  struts.devMode = FALSE
在您WEB-INF/classes/struts.properties文件。
追问:你看到了这个页面,因为发展模式已启用。发展模式,或DEVMODE,使额外的调试行为和报告,以协助开发。要禁用此模式下,设置struts.devMode = FALSE
在您WEB-INF/classes/struts.properties文件。
这个怎么修改?
答案:user 'root'@'localhost' (using password: YES)

localhost上 user:root 密码:YES 无法连接数据库

检查数据库名称,用户名,密码是否争取
其他:查询语句用了uniqueresult(sql)吧,把这个改了吧 是Hibernate连接数据库失败,抛出异常了。请确认Hibernate连接数据正常。

上一个:android中Activity的跳转问题
下一个:java中 不同的引用变量指向同一变量 首地址为什么不会相同

CopyRight © 2022 站长资源库 编程知识问答 zzzyk.com All Rights Reserved
部分文章来自网络,