MyException - 我的异常网
当前位置:我的异常网» Java Web开发 » hibernate 插入错误

hibernate 插入错误(4)

www.MyException.Cn  网友分享于:2013-11-19  浏览:344次

                //   TODO   Auto-generated   method   stub
                return   null;
        }

        public   Class   returnedClass()   {
                return   String.class;
        }

        public   int[]   sqlTypes()   {
                return   new   int[]   {   Types.CLOB   };
        }

}



------解决方案--------------------
异常信息如下,另外在执行update操作的时候没有出现任何问题
javax.servlet.ServletException: java.lang.Long
org.apache.struts.action.RequestProcessor.processException(RequestProcessor.java:545)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:486)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
com.ffcs.lsoc.util.EncodingProcess.process(EncodingProcess.java:14)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


root cause

java.lang.ClassCastException: java.lang.Long
com.ffcs.lsoc.bo.dao.impl.KnowledgeInfoDaoImpl.add(KnowledgeInfoDaoImpl.java:348)
com.ffcs.lsoc.service.KnowledgeInfoService.add(KnowledgeInfoService.java:52)
com.ffcs.lsoc.struts.action.NewEditKnowledgeAction.dialog(NewEditKnowledgeAction.java:91)
com.ffcs.lsoc.struts.action.BaseAction.execute(BaseAction.java:77)
org.springframework.web.struts.DelegatingActionProxy.execute(DelegatingActionProxy.java:106)
org.apache.struts.action.RequestProcessor.processActionPerform(RequestProcessor.java:484)
org.apache.struts.action.RequestProcessor.process(RequestProcessor.java:274)
com.ffcs.lsoc.util.EncodingProcess.process(EncodingProcess.java:14)
org.apache.struts.action.ActionServlet.process(ActionServlet.java:1482)
org.apache.struts.action.ActionServlet.doPost(ActionServlet.java:525)
javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
javax.servlet.http.HttpServlet.service(HttpServlet.java:803)


------解决方案--------------------
你的相应属性是否声明的是 long
------解决方案--------------------
把映射文件中的type= "java.lang.Long "属性都去掉,hibernate会自动寻找

------解决方案--------------------
UP LS

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有