添加时是报一下错:
[org.codehaus.xfire.handler.DefaultFaultHandler] - Fault occurred!
java.lang.IllegalArgumentException: attempt to create saveOrUpdate event with null entity具体情况是:这个表的id是自动增长,我在Action里也实例化了这个对象且setXxx()和getXxx()了,也实现了ModelDriven,使用对象形式接收值,在点击添加后报Null的错误,现在用字符串的形式接收值就报上面的那个错了。有知道的帮忙解答,再次谢谢!

解决方案 »

  1.   

    应该是页面传值到action的时候出了问题
    把你页面和action贴出来看看
      

  2.   

      jsp部分:
         <form action="authen!add.action" method="post">
    <td><table width="550" border="0" cellspacing="0" cellpadding="2">
                    <tr>
                      <td width="85" class="text_black_12" align="right">权限名称:</td>
                      <td width="117" class="text_black_12"><input name="description" type="text" class="fo-rm" size="23" /></td>
                    </tr>
                    <tr>
                      <td>&nbsp;</td>
                      <td><input type="image"   src="<%=request.getContextPath() %>/admin/admin/img/add_button.gif" /></td>
                      <td>&nbsp;</td>
                      <td align="left"><input type="image" name="imageField2" src="<%=request.getContextPath() %>/admin/admin/img/replacement_button.gif" /></td>
                    </tr>
                </table></td>
    </form>action部分:
     private Authenticationaction auth;

    private AuthenticationactionDAO authendao;

    private AdmingroupAuthDAO groupdao;

    private Admingroupauth groupauth;

     
    private String description;

      public void setDescription(String description) {
    this.description = description;
    }
     
    public AuthenticationactionDAO getAuthendao() {
    return authendao;
    }
    public AdmingroupAuthDAO getGroupdao() {
    return groupdao;
    }
     
    public Admingroupauth getGroupauth() {
    return groupauth;
    }
    public void setGroupauth(Admingroupauth groupauth) {
    this.groupauth = groupauth;
    }
    public void setGroupdao(AdmingroupAuthDAO groupdao) {
    this.groupdao = groupdao;
    }
    public String add(){
    //System.out.print(this.ataid);
    HttpServletRequest request = (HttpServletRequest) ActionContext.getContext().get(ServletActionContext.HTTP_REQUEST);
    AdmingroupauthId groupauthid = new AdmingroupauthId();
    try {
    Admin admin = (Admin) request.getSession().getAttribute("admin");
     System.out.print(this.description+"*****");
    //向权限表中添加
    authendao.doCreateauth(auth);
      } catch (Exception e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    }
    return SUCCESS;
    }
      public Authenticationaction getAuth() {
    return auth;
    }
    public void setAuth(Authenticationaction auth) {
    this.auth = auth;
    }
    public void setAuthendao(AuthenticationactionDAO authendao) {
    this.authendao = authendao;
    }
    public Authenticationaction getModel() {
    // TODO Auto-generated method stub
    return auth;
    }}
      

  3.   

    你用modelDriven来传值
    auth得实例化
    private Authenticationaction auth = new Authenticationaction();
      

  4.   

    建议放弃使用xfrie  , 我们项目刚遇到一个问题,打开的 Socket 连接不能关闭,一直close_wait状态,最终导致linux服务器 too many open files 。。目前改用Axis2  以上异常为大访问量下 linux 服务器。