mybites实体类存在任然报错not find class

mybites报错not find class (该类存在)

  1. 原因:在mybites中的resultMap写成了resultType
  2. 解决办法:将mybite的配置文件中的返回类型改为resultMap即可
  3. 说明:resultMap表示应用外部实体类型用于返回自定义的一些类型
    resultType表示返回一些内置类型

mybites查询时报错

07-26

java.lang.RuntimeException: 判断是否需要创建订单异常:org.apache.ibatis.exceptions.PersistenceException: rn### Error querying database. Cause: java.sql.SQLException: No database selectedrn### The error may exist in file [D:\IDE\workspace\pms\cm\cm-svc\target\classes\com\paas\cm\maper\ContractInfo.map.xml]rn### The error may involve defaultParameterMaprn### The error occurred while setting parametersrn### SQL: select contract_id, parent_id, name, major_type, detail_type, code, rela_contract_code, rela_contract_name, ccs_trans_type, source, important_contract_flag, total_outsourcing_flag, pay_type, start_date, end_date, estimated_sign_date, agent_unit_id, agent_man_id, area_id, remark, amount, orignal_currency_id, orignal_currency_amount, tax_type, tax_rate, amount_without_tax, biz_status, create_id, modify_id, modify_date, status, create_date, spec_type, maintenance_month, save_date, proc_stage, version, base_currency_id, base_currency_amount, base_currency_name, exc_rate, comp_id, source_id, source_name, vat_Deduction, usr_def_code, usr_def_name, flg_init_data, ccs_id, ccs_code, custom_code, qr_code, signatory, agent_phone from cm_basic_info where contract_id = ?rn### Cause: java.sql.SQLException: No database selectedrn at com.paas.service.cm.impl.ExternalServiceImpl.contractDrafCrtPO(ExternalServiceImpl.java:2026)rn at com.paas.service.cm.impl.ExternalServiceImpl$$FastClassByCGLIB$$cd0a2949.invoke()rn at org.springframework.cglib.proxy.MethodProxy.invoke(MethodProxy.java:204)rn at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.invokeJoinpoint(CglibAopProxy.java:698)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150)rn at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96)rn at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260)rn at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:91)rn at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172)rn at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:631)rn at com.paas.service.cm.impl.ExternalServiceImpl$$EnhancerByCGLIB$$14ef30a4.contractDrafCrtPO()rn at junit.projectInfoExternalInterfaceTest(junit.java:57)rn at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)rn at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)rn at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)rn at java.lang.reflect.Method.invoke(Method.java:606)rn at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)rn at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)rn at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)rn at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:20)rn at org.springframework.test.context.junit4.statements.RunBeforeTestMethodCallbacks.evaluate(RunBeforeTestMethodCallbacks.java:74)rn at org.springframework.test.context.junit4.statements.RunAfterTestMethodCallbacks.evaluate(RunAfterTestMethodCallbacks.java:83)rn at org.springframework.test.context.junit4.statements.SpringRepeat.evaluate(SpringRepeat.java:72)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:231)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:88)rn at org.junit.runners.ParentRunner$3.run(ParentRunner.java:193)rn at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:52)rn at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:191)rn at org.junit.runners.ParentRunner.access$000(ParentRunner.java:42)rn at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:184)rn at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:61)rn at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:71)rn at org.junit.runners.ParentRunner.run(ParentRunner.java:236)rn at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:174)rn at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)rn at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)rn at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)rnrn 论坛

没有更多推荐了,返回首页