日期:2014-05-17  浏览次数:20779 次

求助:ServLet中JSON对象的传递问题!
信息: Server startup in 7446 ms
log4j:WARN No appenders could be found for logger (com.dao.impl.TblManageDAO).
log4j:WARN Please initialize the log4j system properly.
Hibernate: select tblmanage0_.manage_id as manage1_1_, tblmanage0_.role_id as role2_1_, tblmanage0_.manage_name as manage3_1_, tblmanage0_.manage_pwd as manage4_1_ from wowbbs.dbo.tbl_manage tblmanage0_
Hibernate: select tblrole0_.role_id as role1_4_0_, tblrole0_.role_name as role2_4_0_ from wowbbs.dbo.tbl_role tblrole0_ where tblrole0_.role_id=?
Hibernate: select tblmanages0_.role_id as role2_1_, tblmanages0_.manage_id as manage1_1_, tblmanages0_.manage_id as manage1_1_0_, tblmanages0_.role_id as role2_1_0_, tblmanages0_.manage_name as manage3_1_0_, tblmanages0_.manage_pwd as manage4_1_0_ from wowbbs.dbo.tbl_manage tblmanages0_ where tblmanages0_.role_id=?
2011-9-3 10:04:02 org.apache.catalina.core.StandardWrapperValve invoke
严重: Servlet.service() for servlet ManagerServlet threw exception
java.lang.IllegalStateException: circular reference error
  Offending field: tblManages

  Offending object: preserveType: true, type: class com.entity.TblManage, obj: com.entity.TblManage@8e753c
at com.google.gson.CircularReferenceException.createDetailedException(CircularReferenceException.java:43)
at com.google.gson.JsonSerializationVisitor.visitFieldUsingCustomHandler(JsonSerializationVisitor.java:212)
at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:158)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:131)
at com.google.gson.JsonSerializationVisitor.getJsonElementForChild(JsonSerializationVisitor.java:147)
at com.google.gson.JsonSerializationVisitor.addAsChildOfObject(JsonSerializationVisitor.java:125)
at com.google.gson.JsonSerializationVisitor.visitObjectField(JsonSerializationVisitor.java:112)
at com.google.gson.ObjectNavigator.navigateClassFields(ObjectNavigator.java:164)
at com.google.gson.ObjectNavigator.accept(ObjectNavigator.java:131)
at com.google.gson.JsonSerializationContextDefault.serialize(JsonSerializationContextDefault.java:56)
at com.google.gson.Gson.toJsonTree(Gson.java:233)
at com.google.gson.Gson.toJson(Gson.java:273)
at com.google.gson.Gson.toJson(Gson.java:253)
at web.ManagerServlet.toUpdate(ManagerServlet.java:109)
at web.ManagerServlet.doPost(ManagerServlet.java:75)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:230)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:104)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:261)
at org.apache.coyote.http11.Http11AprProcessor.process(Http11AprProcessor.java:852)
at org.apache.coyote.http11.Http11AprProtocol$Http11ConnectionHandler.process(Http11AprProtocol.java:584)
at org.apache.tomcat.util.net.AprEndpoint$Worker.run(AprEndpoint.java:1508)
at java.lang.Thread.run(Thread.java:595)
Caused by: com.google.gson.CircularReferenceException: circular reference error
at com.googl