json对象生不成功
- Class org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
- java.lang.IllegalAccessException: Class org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
对于这个异常怎么解决啊!!!!!!!!!!!!!!!!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
控制台
Hibernate: select roles0_.roleID as roleID12_, roles0_.version as version12_, roles0_.roleName as roleName12_, roles0_.remark as remark12_ from Roles roles0_
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
Hibernate: select employeero0_.roleID as roleID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.roleID=?
Hibernate: select roleauthor0_.roleID as roleID1_, roleauthor0_.OID as OID1_, roleauthor0_.OID as OID4_0_, roleauthor0_.authorityID as authorit2_4_0_, roleauthor0_.roleID as roleID4_0_, roleauthor0_.roleName as roleName4_0_, roleauthor0_.authorityName as authorit5_4_0_ from RoleAuthoritys roleauthor0_ where roleauthor0_.roleID=?
角色长度为:9
Hibernate: select employeero0_.employeeID as employeeID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.employeeID=?
Hibernate: select employeero0_.employeeID as employeeID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.employeeID=?
Hibernate: select employeero0_.employeeID as employeeID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.employeeID=?
Hibernate: select employeero0_.employeeID as employeeID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.employeeID=?
Hibernate: select employeero0_.employeeID as employeeID1_, employeero0_.OID as OID1_, employeero0_.OID as OID11_0_, employeero0_.employeeID as employeeID11_0_, employeero0_.roleID as roleID11_0_, employeero0_.roleName as roleName11_0_ from EmployeeRoles employeero0_ where employeero0_.employeeID=?
很明显形成不了对象是因为执行完最后一句的时候又去查了数据库
XML <action name="findAllRoles" class="roleAuthorityAssignAction" method="findAllRoles">
<result type="json">
</result>
</action>
我的源码是
private List<Roles> rolesList=new ArrayList<Roles>();//角色列表
public List<Roles> getRolesList() {
return rolesList;
}
public void setRolesList(List<Roles> rolesList) {
this.rolesList = rolesList;
}
public String findAllRoles(){
rolesList = roleManagerFacade.findAll();
System.out.println("角色长度为:"+rolesList.size());
return SUCCESS;
}
说句老实话,我是冲着标题来的···我以为是json难产了……
对象的每个属性,都要写上public的set和get方法?