问题描述
- 求大神!! jsp访问之后就是介个样子,求大神看一下是我的环境什么地方配置错了
- HTTP Status 500 -
type Exception reportmessage
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org.hibernate.exception.GenericJDBCException: could not initialize a collection: [cn.hongsys.web.dp_emp.bean.Employee.group#1]
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
cn.hongsys.web.struts.filter.PrivilegeRequestProcessor.processActionPerform(PrivilegeRequestProcessor.java:43)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.hongsys.web.struts.filter.SetCodeFilter.doFilter(SetCodeFilter.java:27)root cause
org.hibernate.exception.GenericJDBCException: could not initialize a collection: [cn.hongsys.web.dp_emp.bean.Employee.group#1]
org.hibernate.exception.SQLStateConverter.handledNonSpecificException(SQLStateConverter.java:126)
org.hibernate.exception.SQLStateConverter.convert(SQLStateConverter.java:114)
org.hibernate.exception.JDBCExceptionHelper.convert(JDBCExceptionHelper.java:66)
org.hibernate.loader.Loader.loadCollection(Loader.java:2022)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1743)
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:476)
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:867)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:264)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
cn.hongsys.web.dp_emp.service.impl.EmployeeServiceBean.getEmployeeByNameandPass(EmployeeServiceBean.java:53)
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)
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.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
sun.proxy.$Proxy9.getEmployeeByNameandPass(Unknown Source)
cn.hongsys.web.dp_emp.struts.action.LogonOnEmployeeAction.execute(LogonOnEmployeeAction.java:24)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
cn.hongsys.web.struts.filter.PrivilegeRequestProcessor.processActionPerform(PrivilegeRequestProcessor.java:43)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.hongsys.web.struts.filter.SetCodeFilter.doFilter(SetCodeFilter.java:27)root cause
java.sql.SQLException: Illegal mix of collations (gbk_chinese_ciIMPLICIT) and (latin1_swedish_ciIMPLICIT) for operation '='
com.mysql.jdbc.MysqlIO.checkErrorPacket(MysqlIO.java:2921)
com.mysql.jdbc.MysqlIO.sendCommand(MysqlIO.java:1570)
com.mysql.jdbc.MysqlIO.sqlQueryDirect(MysqlIO.java:1665)
com.mysql.jdbc.Connection.execSQL(Connection.java:2978)
com.mysql.jdbc.Connection.execSQL(Connection.java:2902)
com.mysql.jdbc.PreparedStatement.executeInternal(PreparedStatement.java:930)
com.mysql.jdbc.PreparedStatement.executeQuery(PreparedStatement.java:1024)
org.apache.commons.dbcp.DelegatingPreparedStatement.executeQuery(DelegatingPreparedStatement.java:93)
org.hibernate.jdbc.AbstractBatcher.getResultSet(AbstractBatcher.java:208)
org.hibernate.loader.Loader.getResultSet(Loader.java:1808)
org.hibernate.loader.Loader.doQuery(Loader.java:697)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.loadCollection(Loader.java:2015)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1743)
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:476)
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:867)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:264)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
cn.hongsys.web.dp_emp.service.impl.EmployeeServiceBean.getEmployeeByNameandPass(EmployeeServiceBean.java:53)
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)
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.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
sun.proxy.$Proxy9.getEmployeeByNameandPass(Unknown Source)
cn.hongsys.web.dp_emp.struts.action.LogonOnEmployeeAction.execute(LogonOnEmployeeAction.java:24)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
cn.hongsys.web.struts.filter.PrivilegeRequestProcessor.processActionPerform(PrivilegeRequestProcessor.java:43)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.hongsys.web.struts.filter.SetCodeFilter.doFilter(SetCodeFilter.java:27)note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
Apache Tomcat/6.0.29
解决方案
这是 数据的问题你hibernate 实体类中使用了关联但是数据库中关联关系不存在
解决方案二:
报错里面写的很清楚了,
解决方案三:
HTTP Status 500 -
type Exception report
message
description The server encountered an internal error () that prevented it from fulfilling this request.
exception
javax.servlet.ServletException: org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn.hongsys.web.sys_privilege.bean.PrivilegeGroup#402888e54f16217f014f16221dc30001]
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:520)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:427)
cn.hongsys.web.struts.filter.PrivilegeRequestProcessor.processActionPerform(PrivilegeRequestProcessor.java:43)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.hongsys.web.struts.filter.SetCodeFilter.doFilter(SetCodeFilter.java:27)
root cause
org.hibernate.ObjectNotFoundException: No row with the given identifier exists: [cn.hongsys.web.sys_privilege.bean.PrivilegeGroup#402888e54f16217f014f16221dc30001]
org.hibernate.impl.SessionFactoryImpl$2.handleEntityNotFound(SessionFactoryImpl.java:409)
org.hibernate.event.def.DefaultLoadEventListener.load(DefaultLoadEventListener.java:171)
org.hibernate.event.def.DefaultLoadEventListener.proxyOrLoad(DefaultLoadEventListener.java:223)
org.hibernate.event.def.DefaultLoadEventListener.onLoad(DefaultLoadEventListener.java:126)
org.hibernate.impl.SessionImpl.fireLoad(SessionImpl.java:905)
org.hibernate.impl.SessionImpl.internalLoad(SessionImpl.java:873)
org.hibernate.type.EntityType.resolveIdentifier(EntityType.java:590)
org.hibernate.type.EntityType.resolve(EntityType.java:412)
org.hibernate.type.EntityType.nullSafeGet(EntityType.java:227)
org.hibernate.persister.collection.AbstractCollectionPersister.readElement(AbstractCollectionPersister.java:725)
org.hibernate.collection.PersistentSet.readFrom(PersistentSet.java:341)
org.hibernate.loader.Loader.readCollectionElement(Loader.java:1031)
org.hibernate.loader.Loader.readCollectionElements(Loader.java:669)
org.hibernate.loader.Loader.getRowFromResultSet(Loader.java:614)
org.hibernate.loader.Loader.doQuery(Loader.java:724)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:259)
org.hibernate.loader.Loader.loadCollection(Loader.java:2015)
org.hibernate.loader.collection.CollectionLoader.initialize(CollectionLoader.java:59)
org.hibernate.persister.collection.AbstractCollectionPersister.initialize(AbstractCollectionPersister.java:587)
org.hibernate.event.def.DefaultInitializeCollectionEventListener.onInitializeCollection(DefaultInitializeCollectionEventListener.java:83)
org.hibernate.impl.SessionImpl.initializeCollection(SessionImpl.java:1743)
org.hibernate.collection.AbstractPersistentCollection.forceInitialization(AbstractPersistentCollection.java:476)
org.hibernate.engine.StatefulPersistenceContext.initializeNonLazyCollections(StatefulPersistenceContext.java:867)
org.hibernate.loader.Loader.doQueryAndInitializeNonLazyCollections(Loader.java:264)
org.hibernate.loader.Loader.doList(Loader.java:2228)
org.hibernate.loader.Loader.listIgnoreQueryCache(Loader.java:2125)
org.hibernate.loader.Loader.list(Loader.java:2120)
org.hibernate.loader.hql.QueryLoader.list(QueryLoader.java:401)
org.hibernate.hql.ast.QueryTranslatorImpl.list(QueryTranslatorImpl.java:361)
org.hibernate.engine.query.HQLQueryPlan.performList(HQLQueryPlan.java:196)
org.hibernate.impl.SessionImpl.list(SessionImpl.java:1148)
org.hibernate.impl.QueryImpl.list(QueryImpl.java:102)
org.hibernate.impl.AbstractQueryImpl.uniqueResult(AbstractQueryImpl.java:835)
cn.hongsys.web.dp_emp.service.impl.EmployeeServiceBean.getEmployeeByNameandPass(EmployeeServiceBean.java:53)
sun.reflect.GeneratedMethodAccessor48.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.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
sun.proxy.$Proxy9.getEmployeeByNameandPass(Unknown Source)
cn.hongsys.web.dp_emp.struts.action.LogonOnEmployeeAction.execute(LogonOnEmployeeAction.java:24)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:425)
cn.hongsys.web.struts.filter.PrivilegeRequestProcessor.processActionPerform(PrivilegeRequestProcessor.java:43)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:228)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1913)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:462)
javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
cn.hongsys.web.struts.filter.SetCodeFilter.doFilter(SetCodeFilter.java:27)
note The full stack trace of the root cause is available in the Apache Tomcat/6.0.29 logs.
Apache Tomcat/6.0.29
这是更改玩数据库之后的报错,求大神帮忙解决 !! 本人不不是程序员,求大神说的详细一些 应该怎么该,忘情大神不吝赐教 谢谢!!
解决方案四:
大神们 帮帮忙啦 我这上面催的急了 跪求大神啊 救命啊!11
解决方案五:
ID为402888e54f16217f014f16221dc30001的数据不存在