java.lang.AbstractMethodError: Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.isClosed()Z

Copyright: please indicate the source https://blog.csdn.net/EdwardDrew/article/details/85230822

Foreword

Come back in the morning to view the log and found that job project has an error, we found c3p0jar package conflicts and solve problems as follows

text

See error log, RazCourseOpenJob being given, this is the code I wrote last week, not being given locally, how after being given at the line? A look Unknown Source, began to speculate reference methods do not? Then open the package lib path line items, one can see there are two c3p0 the jar package, ah? This is strange, why did not the error before? . It should not be used before mybatis, this project is the first time mybatis on the error. The problem comes up, I used idea when local testing did not being given ah. I guess it should be in time with the machine running the latest version of the jar package, while online with an old jar package. Why did not the new version does not overwrite older versions? (Not the same path as the jar package)

[2018-12-24 02:00:00][pool-54-thread-1][ERROR] com.i61.job.component.JobService.runJob(JobService.java:59) - runJob error,jobId=20181224021829
java.lang.AbstractMethodError: Method com/mchange/v2/c3p0/impl/NewProxyPreparedStatement.isClosed()Z is abstract
	at com.mchange.v2.c3p0.impl.NewProxyPreparedStatement.isClosed(NewProxyPreparedStatement.java)
	at org.apache.ibatis.executor.BaseExecutor.closeStatement(BaseExecutor.java:285)
	at org.apache.ibatis.executor.SimpleExecutor.doUpdate(SimpleExecutor.java:52)
	at org.apache.ibatis.executor.BaseExecutor.update(BaseExecutor.java:117)
	at org.apache.ibatis.executor.CachingExecutor.update(CachingExecutor.java:76)
	at org.apache.ibatis.session.defaults.DefaultSqlSession.update(DefaultSqlSession.java:198)
	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:498)
	at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:433)
	at com.sun.proxy.$Proxy33.update(Unknown Source)
	at org.mybatis.spring.SqlSessionTemplate.update(SqlSessionTemplate.java:294)
	at org.apache.ibatis.binding.MapperMethod.execute(MapperMethod.java:63)
	at org.apache.ibatis.binding.MapperProxy.invoke(MapperProxy.java:59)
	at com.sun.proxy.$Proxy43.updateNextCourseOrder(Unknown Source)
	at com.i61.job.service.raz.RazCourseOpenJob.run(RazCourseOpenJob.java:32)
	at com.i61.job.component.JobService.runJob(JobService.java:49)
	at com.i61.job.component.JobInit$1.run(JobInit.java:62)
	at org.springframework.scheduling.support.DelegatingErrorHandlingRunnable.run(DelegatingErrorHandlingRunnable.java:54)
	at org.springframework.scheduling.concurrent.ReschedulingRunnable.run(ReschedulingRunnable.java:81)
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
	at java.util.concurrent.FutureTask.run(FutureTask.java:266)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180)
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
	at java.lang.Thread.run(Thread.java:748)

Since it is a jar package conflicts, then to solve it
idea to open maven project window, select the right projects selected show dependencies (or show dependencies popup), will come out of all of the module dependency graph, as
Find idea maven package conflicts 0.png
then ctrl + f search c3p0, out two, as in FIG.
Find idea maven package conflicts 1.png

Found that quartz is more than this package, select it and choose Exclude right away, corresponding pom.xml has been successfully modified, as shown below
Exclude.png
pom.xml.png

Into the project root directory open a command window, type maven command: mvn clean package -Dskiptests(delete, packaging, compile, test, skip the test file) to test, as shown below
Find idea maven jar package view Package Command .png

Into the target directory, open war, into the lib, found that only a c3p0jar package
Find idea maven package conflicts 4.png

If there are two instructions may not completely clean, joined warSourceExcludes in pom.xml, ignored under WEB-INF files

  • warSourceExcludes when the war is to ignore the folder copy files off the specified file or folder (but before command if war is not clean command, and the next war when the folder already contains the specified file or folder, the last generation of war will still bag these files or folders contain, even if they are not copied to the folder war).
  • packagingExcludes is generated when war package does not contain the specified file or folder to the war file, folder regardless of whether they are located in war file.
    As shown below:
    idea pom configuration .png

to sum up

The need to strengthen the understanding under maven


Please pay attention to more exciting articles

Guess you like

Origin blog.csdn.net/EdwardDrew/article/details/85230822