Error Reason : When deploying the application, the server error, caused by:java.lang.ClassNotFoundException: Org.quartz.impl.JobDetailImpl, a class can not find, find the corresponding package found clearly a jar has been introduced, in a careful look found there are three similar jars, Com.alibaba.external:opensymphony.quartz,opensymphony:quartz,org.quartz-scheduler:quartz. Actually I want the package that Is Org.quartz-scheduler:quartz, there is I hope in the Org.quartz.impl.JobDetailImpl class, but found a problem opensymphony.quartz,opensymphony:quartz inside also have org . Quartz.impl package But there is no Jobdetailimpl class, but the JVM does not specify which jar to use when loading the class, such as the Org.quartz.impl package loaded into Opensymphony:quartz, but does not find Jobdetailimpl, and then An error has been made.
workaround : Use MVN dependency:tree to get the dependency tree, find out which packages are indirectly referenced, Com.alibaba.external:opensymphony.quartz,opensymphony:quartz exclusions
<Exclusions> <exclusion> <groupId>Com.alibaba.external</groupId> <Artifactid>Opensymphony.quartz</Artifactid> </exclusion> <exclusion> <groupId>Opensymphony</groupId> <Artifactid>Quartz</Artifactid> </exclusion> </Exclusions>
View Code
The Org.quartz-scheduler:quartz can then be introduced.
The class cannot find an exception caused by:java.lang.NoClassDefFoundError