Spring Boot 启动的时候报的错

使用Drools 5.6版本,Spring Boot1.5.8版本,JAVA8版本,Eclipse4.4.2版本。

Google后在Stack上发现一个,中文较少,贴一下。

原因是因为Eclipse不支持Java8编译Drools5.6版本。

解决方案:

给项目添加依赖:

<dependency>
            <groupId>org.eclipse.jdt.core.compiler</groupId>
            <artifactId>ecj</artifactId>
            <version>4.5.1</version>
</dependency>

再次启动,OK

报错内容:

Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'knowledgeBase': Invocation of init method failed; nested exception is java.lang.RuntimeException: wrong class format
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory$.getObject(AbstractBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
... common frames omitted
Caused by: java.lang.RuntimeException: wrong class format
at org.drools.commons.jci.compilers.EclipseJavaCompiler$.findType(EclipseJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.commons.jci.compilers.EclipseJavaCompiler$.findType(EclipseJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromVariantTypeSignature(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeArgumentsFromSignature(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.getTypeFromTypeSignature(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethod(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.createMethods(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.cachePartsFrom(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.createBinaryTypeFrom(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.Compiler.accept(Compiler.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.LookupEnvironment.askForType(LookupEnvironment.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.UnresolvedReferenceBinding.resolve(UnresolvedReferenceBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.resolve(ParameterizedTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveType(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.resolveTypesFor(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.BinaryTypeBinding.getExactMethod(BinaryTypeBinding.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.Scope.findExactMethod(Scope.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.lookup.Scope.getMethod(Scope.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.MessageSend.resolveType(MessageSend.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.Expression.resolve(Expression.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolveStatements(AbstractMethodDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.MethodDeclaration.resolveStatements(MethodDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration.resolve(AbstractMethodDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.resolve(TypeDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.resolve(CompilationUnitDeclaration.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.Compiler.process(Compiler.java:) ~[ecj-3.5..jar:na]
at org.eclipse.jdt.internal.compiler.Compiler.compile(Compiler.java:) ~[ecj-3.5..jar:na]
at org.drools.commons.jci.compilers.EclipseJavaCompiler.compile(EclipseJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.commons.jci.compilers.AbstractJavaCompiler.compile(AbstractJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.rule.builder.dialect.java.JavaDialect.compileAll(JavaDialect.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.DialectCompiletimeRegistry.compileAll(DialectCompiletimeRegistry.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageRegistry.compileAll(PackageRegistry.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageBuilder.compileAll(PackageBuilder.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageBuilder.compileAllRules(PackageBuilder.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageBuilder.addPackage(PackageBuilder.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageBuilder.addPackageFromDecisionTable(PackageBuilder.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.compiler.PackageBuilder.addKnowledgeResource(PackageBuilder.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.builder.impl.KnowledgeBuilderImpl.add(KnowledgeBuilderImpl.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.container.spring.beans.KnowledgeBaseBeanFactory.afterPropertiesSet(KnowledgeBaseBeanFactory.java:) ~[drools-spring-5.6..Final.jar:5.6..Final]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:) ~[spring-beans-4.3..RELEASE.jar:4.3..RELEASE]
... common frames omitted
Caused by: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException: null
at org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>(ClassFileReader.java:) ~[ecj-3.5..jar:na]
at org.drools.commons.jci.compilers.EclipseJavaCompiler$.createNameEnvironmentAnswer(EclipseJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
at org.drools.commons.jci.compilers.EclipseJavaCompiler$.findType(EclipseJavaCompiler.java:) ~[drools-compiler-5.6..Final.jar:5.6..Final]
... common frames omitted

java.lang.RuntimeException: wrong class format Caused by: org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException: null的更多相关文章

  1. Hadoop-1,web页面调用报无hbase.jar包【以解决】 2,报java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.CompilationResult.getProblems()[Lorg/eclipse/jdt/core/compiler/IProblem;【以解决】

    1:web页面调用报无hbase.jar包 本来java文件就没有问题,但是jsp一调用那个java文件里的方法就报错,报的无hadoop/hbase相关报的问题. 主要解决方法是: 复制hbase/ ...

  2. Caused by: java.net.ConnectException: Connection refused/Caused by: java.lang.RuntimeException: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure

    1.使用sqoop技术将mysql的数据导入到Hive出现的错误如下所示: 第一次使用命令如下所示: [hadoop@slaver1 sqoop--cdh5.3.6]$ bin/sqoop impor ...

  3. sqoop导出hive数据到mysql错误: Caused by: java.lang.RuntimeException: Can't parse input data

    Sqoop Export数据到本地数据库时出现错误,命令如下: sqoop export \ --connect 'jdbc:mysql://202.193.60.117/dataweb?useUni ...

  4. hive脚本出现Error: java.lang.RuntimeException: Error in configuring object和Caused by: java.lang.IndexOutOfBoundsException: Index: 9, Size: 9

    是在reduce阶段报的错误,详细错误信息是 朱传豪 19:04:48 Diagnostic Messages for this Task: Error: java.lang.RuntimeExcep ...

  5. Caused by: java.lang.RuntimeException: java.io.IOException: invalid constant type: 18

    工程启动的时候有报下面这个错误的,更新下工程的jar包依赖,然后在工程的pom文件里加上下面的jar包 Caused by: java.lang.RuntimeException: java.io.I ...

  6. hive Caused by: java.lang.RuntimeException: Unable to instantiate org.apache.hadoop.hive.ql.metadata.SessionHiveMetaStoreClient

    Exception in thread "main" java.lang.RuntimeException: org.apache.hadoop.hive.ql.metadata. ...

  7. spring .cloud ------------java.lang.RuntimeException: com.netflix.client.ClientException,Caused by: java.lang.IllegalArgumentException: MIME type may not contain reserved characters

    1.问题的发生 Feign在默认情况下使用的是JDK原生的URLConnection发送HTTP请求,没有连接池,但是对每个地址会保持一个长连接,即利用HTTP的persistence connect ...

  8. ambari-server启动出现Caused by: java.lang.RuntimeException:java.lang.ClassNotFoundEception:com.mysql.jdbc.Driver问题解决办法(图文详解)

    不多说,直接上干货! 问题详解 启动ambari-server出现 Caused by: java.lang.RuntimeException:java.lang.ClassNotFoundEcept ...

  9. RxVolley报错:Caused by: java.lang.RuntimeException: RequestQueue-> DiskBasedCache cache dir error

    Caused by: java.lang.RuntimeException: RequestQueue-> DiskBasedCache cache dir error 这是因为SD卡动态权限导 ...

随机推荐

  1. 赵雅智_Swift(4)_断言

    可选能够让你推断值是否存在.你能够在代码中优雅地处理值缺失的情况.然而,在某些情况下,假设值缺失或者值并不满足特定的条件.你的代码可能并不须要继续执行.这时.你能够在你的代码中触发一个断言(asser ...

  2. MySql 查询银行卡号打码

    ),")) end as card_number from das.staff_base; case 函数 CASE    WHEN 条件1 THEN 结果1    WHEN 条件2 THE ...

  3. GO语言-基础语法:循环

    golang只有for没有while package main import ( "fmt" "os" "bufio" ) func for ...

  4. mysql 计算两点经纬度之间的直线距离(具体sql语句)

    文章转载地址 http://blog.sina.com.cn/s/blog_7bbfd5fd01017d1e.html 新增sql语句具体实现 计算距离(单位 m)并排序 longitude 经度 l ...

  5. STL之template类模板

    #include <iostream> using namespace std; template<class T>//类模板 class Person{ public://构 ...

  6. 四、XML语言学习(3)

    XML编程(CURD) 1.XML解析技术概述XML解析方式分为两种:DOM方式和SAX方式DOM:Document Object Model,文档对象模型.这种方式是W3C推荐的处理XML的一种方式 ...

  7. phjp(ajax)作用知识点

    1.url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. 2.type: 要求为String类型的参数,请求方式(post或get)默认为get.注意其他http请求方法,例如 ...

  8. css的小知识3

    1.补充 margin的margin:0 auto:会解决元素的居中,前提是给这个元素设置width 2.css的层叠问题 css有两个性质 1.继承性 2.层叠性  选择器的一种选择能力,谁的权重大 ...

  9. 图->最短路径->单源最短路径(迪杰斯特拉算法Dijkstra)

    文字描述 引言:如下图一个交通系统,从A城到B城,有些旅客可能关心途中中转次数最少的路线,有些旅客更关心的是节省交通费用,而对于司机,里程和速度则是更感兴趣的信息.上面这些问题,都可以转化为求图中,两 ...

  10. Linux学习8-CentOS部署自己本地的django项目

    前言 自己本地写好的django项目,如何部署到linux服务器上,让其他的小伙伴也能访问呢?本篇以centos系统为例,把本地写好的django项目部署到linux服务器上 环境准备: 环境准备: ...