json对象生不成功

发布于 2021-11-06 01:23:00 字数 435 浏览 919 评论 5

  1. Class org.apache.struts2.json.JSONWriter can not access a member of class org.apache.commons.dbcp.PoolingDataSource$PoolGuardConnectionWrapper with modifiers "public"
  2. 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

柳若烟 2021-11-08 19:05:16

控制台

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=?

很明显形成不了对象是因为执行完最后一句的时候又去查了数据库

勿忘初心 2021-11-08 14:30:03

XML <action name="findAllRoles" class="roleAuthorityAssignAction" method="findAllRoles">

            <result type="json">

            </result> 

        </action>

已下线请稍等 2021-11-08 07:00:21

我的源码是

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;
    }

风透绣罗衣 2021-11-06 23:58:31

说句老实话,我是冲着标题来的···我以为是json难产了……

狼亦尘 2021-11-06 13:33:51

对象的每个属性,都要写上public的set和get方法?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文