A new framework was recently run in the department. The framework is the aggregation project for managing jar packages with Maven.
The following error was reported when running a subproject related to Elastic-job.
Exception in thread "main" Org.springframework.beans.factory.BeanCreationException:Error creating beans with Name ' Com.dangdang.ddframe.job. Spring.schedule.springjobscheduler#0 ': Invocation of Init method failed; Nested exception is Java.lang.IncompatibleClassChangeError:Impleme nting class at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean ( abstractautowirecapablebeanfactory.java:1455) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean ( abstractautowirecapablebeanfactory.java:519) at Org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean ( abstractautowirecapablebeanfactory.java:456) at org.springframework.beans.factory.support.abstractbeanfactory$1. GetObject (abstractbeanfactory.java:294) at Org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton ( defaultsingletonbeanregistry.java:225) at Org.springframework.beans.factory.support.AbstraCtbeanfactory.dogetbean (abstractbeanfactory.java:291) at Org.springframework.beans.factory.support.AbstractBeanFactory.getBean (abstractbeanfactory.java:193) at Org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons ( defaultlistablebeanfactory.java:585) at Org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization ( abstractapplicationcontext.java:913) at Org.springframework.context.support.AbstractApplicationContext.refresh ( abstractapplicationcontext.java:464) at org.springframework.context.support.classpathxmlapplicationcontext.< Init> (classpathxmlapplicationcontext.java:139) at Org.springframework.context.support.classpathxmlapplicationcontext.<init> ( classpathxmlapplicationcontext.java:105) at Com.asiainfo.cboss.biz.esjob.JobLauncher.main (joblauncherhttp:// BLOG.CSDN.NET/GUANGLIHUAN/ARTICLE/DETAILS/50512855.JAVA:29)
It can be known by the error message that the error is caused by class Com.dangdang.ddframe.job.spring.schedule.SpringJobScheduler.
And the error indicates that exception is Java.lang.IncompatibleClassChangeError, this error is caused by incompatibility. Find this error on the web, much because of a jar conflict, or if the version is incorrect.
Because it is an open source framework, it is easy to debug the following statement in the Springjobscheduler parent class Jobscheduler that finds the frame's error point.
Jobdetail Jobdetail = Jobbuilder.newjob (Litejob.class). Withidentity (Jobexecutor.getjobname ()). build ();
An error was raised in the function call of Jobbuilder.newjob (). Jobbuilder This class is the class in the Quartz jar package. So the initial judgment was caused by this jar-packet conflict.
After finding this jar package, we found that the MAVEN local library referenced the 2.2.1 and version 1.6.3. However, the 1.6.3 version does not exist in the local pom file, and it is discovered that the jar package is introduced in the Pom file of another subproject that the subproject relies on.
Workaround:
The lower version of the quartz package in the Pom file was temporarily deleted. No conflict errors occur.
This link describes the use of the MAVEN command to view the dependency tree. You can quickly locate the jar package in those project Pom files.
http://blog.csdn.net/guanglihuan/article/details/50512855