NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtil

45 views Asked by At

Brief Intro

There is a task trying to interact with a db using Mybatis. However, alarms of failing to execute this task have been keeping raised for the last couple of days, after running smoothly for months.

Code of this task hasn't been modified since a long time ago, the only change is that the machine that executed the task for these days are using the different system image, but project package, Java version and etc. are all the same.

Key info and what I've tried/checked will be elaborated sections below.

Key Info

Below is an example of the task (Purpose of it is not related to this problem, please ignore the meaning of each parameter).

@Select(" SELECT count(DISTINCT uuid) FROM ${tableName} " +
        " WHERE sync_status=#{syncStatus}")
    Integer getCounterByCondition(@Param("tableName") String tableName,
                                         @Param("syncStatus") Integer syncStatus);

Java version

java version "1.8.0_45"
Java(TM) SE Runtime Environment (build 1.8.0_45-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed mode)

Mybatis version

3.5.13

Spring version

org.springframework.boot: 2.5.15

Error Stack (* are some sensitive and unrelated information)

Caused by: java.lang.NoClassDefFoundError: org/apache/ibatis/reflection/ExceptionUtil
at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:88)
at com.sun.proxy.$Proxy127.getCounterByCondition(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:497)
at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:344)
at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:198)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:163)
at com.**.**.dao.datasource.ZebraRoutingAdvice.invoke(ZebraRoutingAdvice.java:26)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at com.**.**.dao.datasource.ZebraRoutingAdvice.invoke(ZebraRoutingAdvice.java:33)
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:220)
at com.sun.proxy.$Proxy128.getCounterByCondition(Unknown Source)
at com.**.**.**.**.InfoSyncService.syncInfo(InfoSyncService.java:75)
at com.**.**.**.task.InfoSyncTask.syncInfo(InfoSyncTask.java:25)

What I tried/checked

  1. Is getCounterByCondition functional ? Yes. I call it in test env, everything is cool.

  2. Is DB received the request && return the result ? Yes. DB log was checked and request form this task is recorded cool

My Question

What could possibly be the reason to this problem, any advice on how to deal with it ? Or is there anything that I missed ?

Can the same project package run differently if the system image is different ?

Thanks a lot :)

0

There are 0 answers