报错:Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class

D:\Programs\JDK\jdk1.8.0_181\bin\java.exe -Dvisualvm.id=6546097509919 "-javaagent:C:\Programs\JetBrains\IntelliJ IDEA 2019.1.3\lib\idea_rt.jar=8185:C:\Programs\JetBrains\IntelliJ IDEA 2019.1.3\bin" -Dfile.encoding=UTF-8 -classpath D:\Programs\JDK\jdk1.8.0_181\jre\lib\charsets.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\deploy.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\dnsns.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\jaccess.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\localedata.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\nashorn.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\sunec.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\ext\zipfs.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\javaws.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\jce.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\jfr.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\jfxswt.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\jsse.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\management-agent.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\plugin.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\resources.jar;D:\Programs\JDK\jdk1.8.0_181\jre\lib\rt.jar;D:\DataCenter\Intellj\shiro\shirodemo\target\classes;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-all\1.4.1\shiro-all-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-lang\1.4.1\shiro-lang-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-config-core\1.4.1\shiro-config-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-config-ogdl\1.4.1\shiro-config-ogdl-1.4.1.jar;D:\DataCenter\MavenRepository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar;D:\DataCenter\MavenRepository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-core\1.4.1\shiro-crypto-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-hash\1.4.1\shiro-crypto-hash-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-cipher\1.4.1\shiro-crypto-cipher-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-event\1.4.1\shiro-event-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-core\1.4.1\shiro-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-cache\1.4.1\shiro-cache-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-web\1.4.1\shiro-web-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-aspectj\1.4.1\shiro-aspectj-1.4.1.jar;D:\DataCenter\MavenRepository\org\aspectj\aspectjrt\1.8.9\aspectjrt-1.8.9.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-ehcache\1.4.1\shiro-ehcache-1.4.1.jar;D:\DataCenter\MavenRepository\net\sf\ehcache\ehcache-core\2.6.11\ehcache-core-2.6.11.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-guice\1.4.1\shiro-guice-1.4.1.jar;D:\DataCenter\MavenRepository\com\google\inject\guice\3.0\guice-3.0.jar;D:\DataCenter\MavenRepository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\DataCenter\MavenRepository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-hazelcast\1.4.1\shiro-hazelcast-1.4.1.jar;D:\DataCenter\MavenRepository\com\hazelcast\hazelcast\3.7.2\hazelcast-3.7.2.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-quartz\1.4.1\shiro-quartz-1.4.1.jar;D:\DataCenter\MavenRepository\org\opensymphony\quartz\quartz\1.6.1\quartz-1.6.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-spring\1.4.1\shiro-spring-1.4.1.jar;D:\DataCenter\MavenRepository\mysql\mysql-connector-java\8.0.16\mysql-connector-java-8.0.16.jar;D:\DataCenter\MavenRepository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar;D:\DataCenter\MavenRepository\com\alibaba\druid\1.1.17\druid-1.1.17.jar;D:\DataCenter\MavenRepository\org\springframework\spring-context\4.0.2.RELEASE\spring-context-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-aop\4.0.2.RELEASE\spring-aop-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\DataCenter\MavenRepository\org\springframework\spring-core\4.0.2.RELEASE\spring-core-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;D:\DataCenter\MavenRepository\org\springframework\spring-expression\4.0.2.RELEASE\spring-expression-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-beans\4.0.2.RELEASE\spring-beans-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-webmvc\4.0.2.RELEASE\spring-webmvc-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-web\4.0.2.RELEASE\spring-web-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-jdbc\4.0.2.RELEASE\spring-jdbc-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-tx\4.0.2.RELEASE\spring-tx-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-aspects\4.0.2.RELEASE\spring-aspects-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\aspectj\aspectjweaver\1.7.4\aspectjweaver-1.7.4.jar;D:\DataCenter\MavenRepository\org\springframework\spring-jms\4.0.2.RELEASE\spring-jms-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-context-support\4.0.2.RELEASE\spring-context-support-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\seleniumhq\selenium\selenium-java\3.141.59\selenium-java-3.141.59.jar;D:\DataCenter\MavenRepository\org\seleniumhq\selenium\selenium-support\3.141.59\selenium-support-3.141.59.jar;D:\DataCenter\MavenRepository\net\bytebuddy\byte-buddy\1.8.15\byte-buddy-1.8.15.jar;D:\DataCenter\MavenRepository\org\apache\commons\commons-exec\1.3\commons-exec-1.3.jar;D:\DataCenter\MavenRepository\com\google\guava\guava\25.0-jre\guava-25.0-jre.jar;D:\DataCenter\MavenRepository\com\google\code\findbugs\jsr305\1.3.9\jsr305-1.3.9.jar;D:\DataCenter\MavenRepository\org\checkerframework\checker-compat-qual\2.0.0\checker-compat-qual-2.0.0.jar;D:\DataCenter\MavenRepository\com\google\errorprone\error_prone_annotations\2.1.3\error_prone_annotations-2.1.3.jar;D:\DataCenter\MavenRepository\com\google\j2objc\j2objc-annotations\1.1\j2objc-annotations-1.1.jar;D:\DataCenter\MavenRepository\org\codehaus\mojo\animal-sniffer-annotations\1.14\animal-sniffer-annotations-1.14.jar;D:\DataCenter\MavenRepository\com\squareup\okhttp3\okhttp\3.11.0\okhttp-3.11.0.jar;D:\DataCenter\MavenRepository\com\squareup\okio\okio\1.14.0\okio-1.14.0.jar;D:\DataCenter\MavenRepository\org\quartz-scheduler\quartz\2.3.0\quartz-2.3.0.jar;D:\DataCenter\MavenRepository\com\mchange\c3p0\0.9.5.2\c3p0-0.9.5.2.jar;D:\DataCenter\MavenRepository\com\mchange\mchange-commons-java\0.2.11\mchange-commons-java-0.2.11.jar;D:\DataCenter\MavenRepository\com\zaxxer\HikariCP-java6\2.3.13\HikariCP-java6-2.3.13.jar;D:\DataCenter\MavenRepository\org\slf4j\slf4j-api\1.7.7\slf4j-api-1.7.7.jar com.ncepu.test.quartz.HelloScheduler
Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class
	at java.lang.ClassLoader.defineClass1(Native Method)
	at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
	at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
	at java.net.URLClassLoader.defineClass(URLClassLoader.java:467)
	at java.net.URLClassLoader.access$100(URLClassLoader.java:73)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:368)
	at java.net.URLClassLoader$1.run(URLClassLoader.java:362)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.net.URLClassLoader.findClass(URLClassLoader.java:361)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349)
	at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
	at com.ncepu.test.quartz.HelloScheduler.main(HelloScheduler.java:15)

Process finished with exit code 1

Exception in thread "main" java.lang.IncompatibleClassChangeError: Implementing class

这句话中的重点在:IncompatibleClassChangeError  不兼容的类更改错误

JDK 换 11 试下。

C:\Programs\Java\jdk-11.0.3\bin\java.exe -Dvisualvm.id=9055206865857 "-javaagent:C:\Programs\JetBrains\IntelliJ IDEA 2019.1.3\lib\idea_rt.jar=11583:C:\Programs\JetBrains\IntelliJ IDEA 2019.1.3\bin" -Dfile.encoding=UTF-8 -classpath D:\DataCenter\Intellj\shiro\shirodemo\target\classes;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-all\1.4.1\shiro-all-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-lang\1.4.1\shiro-lang-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-config-core\1.4.1\shiro-config-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-config-ogdl\1.4.1\shiro-config-ogdl-1.4.1.jar;D:\DataCenter\MavenRepository\commons-beanutils\commons-beanutils\1.9.3\commons-beanutils-1.9.3.jar;D:\DataCenter\MavenRepository\commons-collections\commons-collections\3.2.2\commons-collections-3.2.2.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-core\1.4.1\shiro-crypto-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-hash\1.4.1\shiro-crypto-hash-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-crypto-cipher\1.4.1\shiro-crypto-cipher-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-event\1.4.1\shiro-event-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-core\1.4.1\shiro-core-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-cache\1.4.1\shiro-cache-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-web\1.4.1\shiro-web-1.4.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-aspectj\1.4.1\shiro-aspectj-1.4.1.jar;D:\DataCenter\MavenRepository\org\aspectj\aspectjrt\1.8.9\aspectjrt-1.8.9.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-ehcache\1.4.1\shiro-ehcache-1.4.1.jar;D:\DataCenter\MavenRepository\net\sf\ehcache\ehcache-core\2.6.11\ehcache-core-2.6.11.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-guice\1.4.1\shiro-guice-1.4.1.jar;D:\DataCenter\MavenRepository\com\google\inject\guice\3.0\guice-3.0.jar;D:\DataCenter\MavenRepository\javax\inject\javax.inject\1\javax.inject-1.jar;D:\DataCenter\MavenRepository\com\google\inject\extensions\guice-multibindings\3.0\guice-multibindings-3.0.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-hazelcast\1.4.1\shiro-hazelcast-1.4.1.jar;D:\DataCenter\MavenRepository\com\hazelcast\hazelcast\3.7.2\hazelcast-3.7.2.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-quartz\1.4.1\shiro-quartz-1.4.1.jar;D:\DataCenter\MavenRepository\org\opensymphony\quartz\quartz\1.6.1\quartz-1.6.1.jar;D:\DataCenter\MavenRepository\org\apache\shiro\shiro-spring\1.4.1\shiro-spring-1.4.1.jar;D:\DataCenter\MavenRepository\mysql\mysql-connector-java\8.0.16\mysql-connector-java-8.0.16.jar;D:\DataCenter\MavenRepository\com\google\protobuf\protobuf-java\3.6.1\protobuf-java-3.6.1.jar;D:\DataCenter\MavenRepository\com\alibaba\druid\1.1.17\druid-1.1.17.jar;D:\DataCenter\MavenRepository\org\springframework\spring-context\4.0.2.RELEASE\spring-context-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-aop\4.0.2.RELEASE\spring-aop-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\aopalliance\aopalliance\1.0\aopalliance-1.0.jar;D:\DataCenter\MavenRepository\org\springframework\spring-core\4.0.2.RELEASE\spring-core-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\commons-logging\commons-logging\1.1.3\commons-logging-1.1.3.jar;D:\DataCenter\MavenRepository\org\springframework\spring-expression\4.0.2.RELEASE\spring-expression-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-beans\4.0.2.RELEASE\spring-beans-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-webmvc\4.0.2.RELEASE\spring-webmvc-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-web\4.0.2.RELEASE\spring-web-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-jdbc\4.0.2.RELEASE\spring-jdbc-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-tx\4.0.2.RELEASE\spring-tx-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-aspects\4.0.2.RELEASE\spring-aspects-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\aspectj\aspectjweaver\1.7.4\aspectjweaver-1.7.4.jar;D:\DataCenter\MavenRepository\org\springframework\spring-jms\4.0.2.RELEASE\spring-jms-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\springframework\spring-context-support\4.0.2.RELEASE\spring-context-support-4.0.2.RELEASE.jar;D:\DataCenter\MavenRepository\org\quartz-scheduler\quartz\2.1.7\quartz-2.1.7.jar;D:\DataCenter\MavenRepository\c3p0\c3p0\0.9.1.1\c3p0-0.9.1.1.jar;D:\DataCenter\MavenRepository\org\slf4j\slf4j-api\1.6.1\slf4j-api-1.6.1.jar com.ncepu.test.quartz.HelloScheduler
Exception in thread "main" java.lang.IncompatibleClassChangeError: class org.quartz.impl.JobDetailImpl can not implement org.quartz.JobDetail, because it is not an interface (org.quartz.JobDetail is in unnamed module of loader 'app')
	at java.base/java.lang.ClassLoader.defineClass1(Native Method)
	at java.base/java.lang.ClassLoader.defineClass(ClassLoader.java:1016)
	at java.base/java.security.SecureClassLoader.defineClass(SecureClassLoader.java:174)
	at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(BuiltinClassLoader.java:802)
	at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(BuiltinClassLoader.java:700)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(BuiltinClassLoader.java:623)
	at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:581)
	at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:178)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	at com.ncepu.test.quartz.HelloScheduler.main(HelloScheduler.java:15)

放弃,不要放太多时间,在这上面了。反正是,不兼容。

尝试的程序员是:quartz的示例代码。

HelloJob.java
package com.ncepu.test.quartz;

import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.text.SimpleDateFormat;
import java.util.Date;


/**
 * @author glp
 * @version 2019.6.5
 */
public class HelloJob implements Job {
    @Override
    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
        Date date = new Date();
        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
        System.out.println("Current time is :" + simpleDateFormat.format(date));
        System.out.println("Hello world!");
    }
}
HelloScheduler.java
package com.ncepu.test.quartz;

import org.quartz.*;
import org.quartz.impl.StdSchedulerFactory;

import static org.quartz.JobBuilder.newJob;

/**
 * @author glp
 */
public class HelloScheduler {
    public static void main(String[] args) {
        try {
          
            JobDetail jobDetail = newJob(HelloJob.class).
                    withIdentity("myJob", "group1")
                    .build();


      
            Trigger trigger = TriggerBuilder.newTrigger()
                    .withIdentity("myTrigger", "group1")
                    .startNow()
                    .withSchedule(SimpleScheduleBuilder.simpleSchedule().withIntervalInSeconds(2).repeatForever())
                    .build();


            Scheduler scheduler = StdSchedulerFactory.getDefaultScheduler();
            scheduler.scheduleJob(jobDetail, trigger);
            scheduler.start();

        } catch (SchedulerException e) {
            e.printStackTrace();
        }


    }
}

 

posted @ 2019-06-05 09:56  glpa  阅读(1129)  评论(0编辑  收藏  举报