您的位置:程序门 -> java -> 框架、开源



ibatis报错,急!!在线等!


[收藏此页] [打印本页]选择字色:背景色:字体:[][][]


[向提问]ibatis报错,急!!在线等!
发表于:2008-01-16 14:49:29 楼主
错误信息:
2008-01-16   12:56:41   standardwrappervalve[action]:   servlet.service()   for   servlet   action   threw   exception
com.ibatis.dao.client.daoexception:   failed   to   queryforlist   -   id   [querycompanylistbycompanyname],   parameterobject   [%%],   skip   [0],   max   [948].     cause:   com.ibatis.common.jdbc.exception.nestedsqlexception:      
---   the   error   occurred   in   com/yadcom/mbs/properties/sql/company.xml.    
---   the   error   occurred   while   applying   a   result   map.    
---   check   the   company.companyresult.    
---   check   the   result   mapping   for   the   'marketer'   property.    
---   cause:   net.sf.cglib.beans.bulkbeanexception
caused   by:   net.sf.cglib.beans.bulkbeanexception
caused   by:   com.ibatis.common.jdbc.exception.nestedsqlexception:      
---   the   error   occurred   in   com/yadcom/mbs/properties/sql/company.xml.    
---   the   error   occurred   while   applying   a   result   map.    
---   check   the   company.companyresult.    
---   check   the   result   mapping   for   the   'marketer'   property.    
---   cause:   net.sf.cglib.beans.bulkbeanexception
caused   by:   net.sf.cglib.beans.bulkbeanexception
at   com.ibatis.dao.client.template.sqlmapdaotemplate.queryforlist(sqlmapdaotemplate.java:216)
at   com.yadcom.mbs.properties.sqlmapdao.companysqlmapdao.querycompanylistbycompanyname(companysqlmapdao.java:43)
at   sun.reflect.nativemethodaccessorimpl.invoke0(native   method)
at   sun.reflect.nativemethodaccessorimpl.invoke(nativemethodaccessorimpl.java:39)
at   sun.reflect.delegatingmethodaccessorimpl.invoke(delegatingmethodaccessorimpl.java:25)
at   java.lang.reflect.method.invoke(method.java:324)
at   com.ibatis.dao.engine.impl.daoproxy.invoke(daoproxy.java:61)
at   $proxy1.querycompanylistbycompanyname(unknown   source)
at   com.yadcom.mbs.properties.service.companyservice.querycompanylistbycompanyname(companyservice.java:56)
at   com.yadcom.mbs.sysadmin.action.fee.queryfeesumaction.EXECute(queryfeesumaction.java:18)
at   org.apache.struts.action.requestprocessor.processactionperform(requestprocessor.java:484)
at   org.apache.struts.action.requestprocessor.process(requestprocessor.java:274)
at   org.apache.struts.action.actionservlet.process(actionservlet.java:1482)
at   org.apache.struts.action.actionservlet.dopost(actionservlet.java:525)
at   javax.servlet.http.httpservlet.service(httpservlet.java:709)
at   javax.servlet.http.httpservlet.service(httpservlet.java:802)
at   org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:252)
at   org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:173)
at   com.yadcom.mbs.mbsfilter.dofilter(mbsfilter.java:138)
at   org.apache.catalina.core.applicationfilterchain.internaldofilter(applicationfilterchain.java:202)
at   org.apache.catalina.core.applicationfilterchain.dofilter(applicationfilterchain.java:173)
at   org.apache.catalina.core.standardwrappervalve.invoke(standardwrappervalve.java:214)
at   org.apache.catalina.core.standardvalvecontext.invokenext(standardvalvecontext.java:104)
at   org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:520)
at   org.apache.catalina.core.standardcontextvalve.invokeinternal(standardcontextvalve.java:198)
at   org.apache.catalina.core.standardcontextvalve.invoke(standardcontextvalve.java:152)
at   org.apache.catalina.core.standardvalvecontext.invokenext(standardvalvecontext.java:104)
at   org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:520)
at   org.apache.catalina.core.standardhostvalve.invoke(standardhostvalve.java:137)
at   org.apache.catalina.core.standardvalvecontext.invokenext(standardvalvecontext.java:104)
at   org.apache.catalina.valves.errorreportvalve.invoke(errorreportvalve.java:118)
at   org.apache.catalina.core.standardvalvecontext.invokenext(standardvalvecontext.java:102)
at   org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:520)
at   org.apache.catalina.core.standardenginevalve.invoke(standardenginevalve.java:109)
at   org.apache.catalina.core.standardvalvecontext.invokenext(standardvalvecontext.java:104)
at   org.apache.catalina.core.standardpipeline.invoke(standardpipeline.java:520)
at   org.apache.catalina.core.containerbase.invoke(containerbase.java:929)
at   org.apache.coyote.tomcat5.coyoteadapter.service(coyoteadapter.java:160)
at   org.apache.coyote.http11.http11processor.process(http11processor.java:799)
at   org.apache.coyote.http11.http11protocol$http11connectionhandler.processconnection(http11protocol.java:705)
at   org.apache.tomcat.util.net.tcpworkerthread.runit(pooltcpendpoint.java:577)
at   org.apache.tomcat.util.threads.threadpool$controlrunnable.run(threadpool.java:684)
at   java.lang.thread.run(thread.java:536)
caused   by:   com.ibatis.common.jdbc.exception.nestedsqlexception:      
---   the   error   occurred   in   com/yadcom/mbs/properties/sql/company.xml.    
---   the   error   occurred   while   applying   a   result   map.    
---   check   the   company.companyresult.    
---   check   the   result   mapping   for   the   'marketer'   property.    
---   cause:   net.sf.cglib.beans.bulkbeanexception
caused   by:   net.sf.cglib.beans.bulkbeanexception
at   com.ibatis.sqlmap.engine.mapping.statement.generalstatement.EXECutequerywithcallback(generalstatement.java:157)
at   com.ibatis.sqlmap.engine.mapping.statement.generalstatement.EXECutequeryforlist(generalstatement.java:99)
at   com.ibatis.sqlmap.engine.impl.sqlmapEXECutordelegate.queryforlist(sqlmapEXECutordelegate.java:341)
at   com.ibatis.sqlmap.engine.impl.sqlmapsessionimpl.queryforlist(sqlmapsessionimpl.java:81)
at   com.ibatis.sqlmap.engine.impl.sqlmapclientimpl.queryforlist(sqlmapclientimpl.java:58)
at   com.ibatis.dao.client.template.sqlmapdaotemplate.queryforlist(sqlmapdaotemplate.java:214)
...   42   more
caused   by:   net.sf.cglib.beans.bulkbeanexception
at   com.yadcom.mbs.properties.bean.company$$bulkbeanbycglib$$9c0cd3f6.setpropertyvalues( <generated> )
at   com.ibatis.sqlmap.engine.accessplan.enhancedpropertyaccessplan.setproperties(enhancedpropertyaccessplan.java:18)
at   com.ibatis.sqlmap.engine.exchange.javabeandataexchange.setdata(javabeandataexchange.java:73)
at   com.ibatis.sqlmap.engine.mapping.result.basicresultmap.setresultobjectvalues(basicresultmap.java:148)
at   com.ibatis.sqlmap.engine.mapping.statement.rowhandlercallback.handleresultobject(rowhandlercallback.java:29)
at   com.ibatis.sqlmap.engine.EXECution.sqlEXECutor.handleresults(sqlEXECutor.java:279)
at   com.ibatis.sqlmap.engine.EXECution.sqlEXECutor.EXECutequery(sqlEXECutor.java:127)
at   com.ibatis.sqlmap.engine.mapping.statement.generalstatement.sqlEXECutequery(generalstatement.java:174)
at   com.ibatis.sqlmap.engine.mapping.statement.generalstatement.EXECutequerywithcallback(generalstatement.java:142)
...   47   more
caused   by:   java.lang.nullpointerexception
...   56   more

发表于:2008-01-16 14:50:151楼 得分:0
xml文件:
<?xml   version="1.0"   encoding="utf-8"   standalone="no"?>
<!doctype   sqlmap   public   "-//ibatis.com//dtd   sql   map   2.0//en"   "http://www.ibatis.com/dtd/sql-map-2.dtd">

<!--   the   sql   in   these   maps   files   has   purposely   been   typed   with   more   verbosity   than   is   actually   required.
  for   example,   many   of   the   selects   could   have   just   used   select   *   from...   instead   of   listing   all   of   the   columns.
  this   is   to   demonstrate   that   even   complex   sql   can   be   handled   and   coded   and   formatted   the   way   sql   was   meant
  to   be   (i.e.   not   a   bunch   of   concatenated   strings   in   a   java   class).   -->

<sqlmap   namespace="company">

    <typealias   alias="company"   type="com.yadcom.mbs.properties.bean.company"/>
    <typealias   alias="qcompany"   type="com.yadcom.mbs.agentadmin.action.bean.qcompany"/>

    <resultmap   id="companyresult"   class="company">
        <result   property="companyid"   column="companyid"/>
        <result   property="companyname"   column="companyname"/>
<result   property="sms"   column="sms"/>
        <result   property="meeting"   column="meeting"/>
        <result   property="mobiledata"   column="mobiledata"/>
        <result   property="mobileoa"   column="mobileoa"/>
        <result   property="banlance"   column="banlance"/>
<result   property="status"   column="status"/>
<result   property="postcode"   column="postcode"/>
        <result   property="address"   column="address"/>
        <result   property="phone_number"   column="phone_number"/>
        <result   property="fax_number"   column="fax_number"/>
        <result   property="contact"   column="contact"/>
        <result   property="contact_number"   column="contact_number"/>
        <result   property="create_date"   column="create_date"/>
        <result   property="fee_date"   column="fee_date"/>
        <result   property="area"   column="area"/>
        <result   property="vocation"   column="vocation"/>
        <result   property="adminname"   column="admin_name"/>
        <result   property="overdraft"   column="overdraft"/>
        <result   property="agentid"   column="agentid"/>
<result   property="monthfee"   column="monthfee"/>
<result   property="marketer"   column="marketer"/>
      </resultmap>
   
    <insert   id="insertcompany"   parameterclass="company">
        insert   into   mb_company   (companyid,companyname,sms,meeting,mobiledata,mobileoa,banlance,area,vocation,status,postcode,address,contact,contact_number,create_date,admin_name,overdraft,agentid,monthfee,marketer,phone_number)   values   (#companyid#,#companyname#,#sms#,#meeting#,#mobiledata#,#mobileoa#,#banlance#,#area#,#vocation#,#status#,#postcode#,#address#,#contact#,#contact_number#,to_date(#create_date#,'yyyy-mm-dd'),#adminname#,#overdraft#,#agentid#,#monthfee#,#marketer#,#phone_number#)
    </insert>

    <insert   id="insertcompanyold"   parameterclass="company">
        insert   into   ei_company   (company_id,company_name,area_name,status,postcode,address,contact,contact_mobile,create_date,admin_name,overdraft,memo)
        values   (#companyid#,#companyname#,#area#,#status#,#postcode#,#address#,#contact#,#contact_number#,to_date(#create_date#,'yyyy-mm-dd'),#adminname#,#overdraft#,#memo#)
    </insert>

    <select   id="getcompanylist"     resultmap="companyresult">
select   *   from   mb_company   where   (status=0   or   status=2)
    </select>

    <select   id="countcompanylist"     resultclass="java.lang.string">
select   count(*)   from   mb_company   where   (status=0   or   status=2)
    </select>
  <select   id="getcompanybycompanyid"     resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company   where   companyid=#value#
    </select>

    <select   id="getcompanybycompanyname"     resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company   where   companyname=#value#   and   (status=0   or   status=2)
    </select>

    <select   id="querycompanylistbycompanyname"     resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company   where   companyname   like   #value#   and   (status=0   or   status=2)   order   by   create_date   desc    
    </select>

    <select   id="countcompanybysmsnumber"     resultclass="java.lang.string"   parameterclass="java.lang.string">
select   count(*)   from   mb_company,ei_company   where   ei_company.sms_number   =   #value#   and   mb_company.companyid=ei_company.company_id
    </select>

    <select   id="getcompanybysms"     resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company,ei_company   where   ei_company.sms_number   =   #value#   and   mb_company.companyid=ei_company.company_id   and   (mb_company.status=0   or   mb_company.status=2)   and   (ei_company.status=0   or   ei_company.status=2)
    </select>

    <select   id="countquerycompanylistbycompanyname"     resultclass="java.lang.string"   parameterclass="java.lang.string">
select   count(*)   from   mb_company   where   companyname   like   #value#   and   (status=0   or   status=2)
    </select>

    <update   id="updatecompanybyid"   parameterclass="company">
update   mb_company   set   address=#address#   ,contact=#contact#,contact_number=#contact_number#,overdraft=#overdraft#,banlance=#banlance#,sms=#sms#,meeting=#meeting#,mobiledata=#mobiledata#,mobileoa=#mobileoa#,area=#area#,status=#status#,postcode=#postcode#,vocation=#vocation#,agentid=#agentid#,monthfee=#monthfee#,marketer=#marketer#,phone_number=#phone_number#   where   companyid=#companyid#  
    </update>
   
    <select   id="querycompanylistbycompanynameagent"     resultmap="companyresult"   parameterclass="qcompany">
select   *   from   mb_company   where   companyname   like   #var_string#   and   agentid=#agentid#   and   (status=0   or   status=2)   order   by   create_date   desc
    </select>
   
    <!--   新增   -->
<select   id="querycompanylistbymarketer"   resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company   where   marketer=#value#   and   (status=0   or   status=2)
</select>
<select   id="countquerycompanylistbymarketer"     resultclass="java.lang.string"   parameterclass="java.lang.string">
select   count(*)   from   mb_company   where   marketer=#value#   and   (status=0   or   status=2)
    </select>
<select   id="querycompanylistbymarketername"   resultmap="companyresult"   parameterclass="java.util.map">
select   *   from   mb_company   where   marketer=#marketer#   and   companyname   like   #companyname#   and   (status=0   or   status=2) </select>
<select   id="countcompanylistbymarketname"   resultclass="java.lang.string"   parameterclass="java.util.map">
select   count(*)   from   mb_company   where   marketer=#marketer#   and   companyname   like   #companyname#   and   (status=0   or   status=2)
</select>
<!--   20071120新增结束   -->
    <select   id="countquerycompanylistbycompanynameagent"     resultclass="java.lang.string"   parameterclass="qcompany">
select   count(*)   from   mb_company   where   companyname   like   #var_string#   and   agentid=#agentid#   and   (status=0   or   status=2)
    </select>

    <select   id="getcompanybycompanynameagent"     resultmap="companyresult"   parameterclass="qcompany">
select   *   from   mb_company   where   companyname=#var_string#   and   agentid=#agentid#     and   (status=0   or   status=2)
    </select>

    <update   id="delcompanybyidofold"   parameterclass="java.lang.string">
update   ei_company   set   status=1   where   company_id=#value#
    </update>

    <update   id="delcompanybyid"   parameterclass="java.lang.string">
update   mb_company   set   status=1   ,   logoutdate=sysdate   where   companyid=#value#
    </update>

    <select   id="getcompanylistbyagentid"     resultmap="companyresult"   parameterclass="java.lang.string">
select   *   from   mb_company   where   agentid=#value#   and   (status=0   or   status=2)
    </select>

    <select   id="countcompanylistbyagentid"   resultclass="java.lang.string"   parameterclass="java.lang.string">
select   count(*)   from   mb_company   where   agentid=#value#   and   (status=0   or   status=2)
    </select>
    <update   id="opensms"   parameterclass="java.lang.string">
update   ei_company   set   status=0   where   company_id=#value#
    </update>

    <select   id="countcompanyqlbycompanyid"     resultclass="java.lang.string"   parameterclass="java.lang.string">
select   count(*)   from   ei_company   where   ei_company.company_id   =   #value#   and   ei_company.memo='ql'
    </select>
</sqlmap>
发表于:2008-01-16 14:50:582楼 得分:0
还需要什么我帖出来
发表于:2008-01-16 14:53:573楼 得分:0
同样的配置在我的本地可以运行
放到服务器上就不行了
服务器环境是jdk1.4,tomcat5,oracle9
本地是jdk1.5,tomcat5,oracle9

根据错误可能是marketer这个有问题
但是拼写什么都没问题
怎么就出错呢
发表于:2008-01-16 14:56:084楼 得分:0
还需要你的数据库表,比如导出的sql
发表于:2008-01-16 14:58:435楼 得分:0
数据库表
create   table   mb_company

    companyid             number(10)   not   null,
    companyname         varchar2(100),
    sms                         number(1),
    meeting                 number(1),
    mobiledata           number(1),
    mobileoa               number(1),
    banlance               number(11,3)   default   0,
    status                   char(1),
    postcode               char(10),
    address                 varchar2(100),
    phone_number       varchar2(30),
    fax_number           varchar2(30),
    contact                 varchar2(30),
    contact_number   varchar2(30),
    create_date         date   default   sysdate,
    fee_date               varchar2(30),
    banktype               varchar2(20),
    bankaccount         varchar2(30),
    area                       varchar2(4),
    vocation               number(4),
    overdraft             number(11,3)   default   0,
    admin_name           varchar2(20),
    agentid                 number(10),
    logoutdate           date,
    monthfee               number(11,3)   default   0,
    marketer               varchar2(30),
    memo                       varchar2(100)
)
这样可以了吗
发表于:2008-01-16 15:00:316楼 得分:0
还有,建议本地换1.4编译看看
发表于:2008-01-16 15:03:427楼 得分:0
在eclipse里已经设置成1.4了
还是在本地是可以运行的没错
发表于:2008-01-16 15:08:478楼 得分:0
      <select       id="querycompanylistbycompanyname"           resultmap="companyresult"       parameterclass="java.lang.string">  
select       *       from       mb_company       where       companyname       like       #value#       and       (status=0       or       status=2)       order       by       create_date       desc          
        </select>  
这条语句在数据库种执行正确
select       *       from       mb_company       where       companyname       like       '%%'       and       (status=0       or       status=2)       order       by       create_date       desc          
发表于:2008-01-16 15:12:069楼 得分:0
我猜想还是运行环境与编译环境的差异问题!

没有想过经验,只能帮顶了!
发表于:2008-01-16 16:15:0310楼 得分:0
现在测试是查询部分能成功,就是加入查询条件,也就是companyname
发表于:2008-01-16 16:42:3311楼 得分:0
按有几个群,你不妨加进去,可以和大家一起讨论啊.........46986340,28039577,4804620                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              
在那里看看有无能回答你的,谢谢,lz,甭忘了给俺分哦,谢谢lz


快速检索

最新资讯
热门点击