Spring-boot与Spark不兼容问题:An attempt was made to call the method org.codehaus.commons.compiler.Location

问题场景

spring-boot程加载hdfs上spark训练好的模型,本地起spark-local方式去做预测。

软件版本

   <parent>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-parent</artifactId>
        <version>1.5.16.RELEASE</version>
        <relativePath/> <!-- lookup parent from repository -->
    </parent>

<dependencies>
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-web</artifactId>
        </dependency>
		<dependency>
            <groupId>org.apache.hadoop</groupId>
            <artifactId>hadoop-client</artifactId>
            <version>2.8.4<</version>
		</dependency>
	   <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-mllib_2.11</artifactId>
            <version>2.1.3</version>
	</dependency>
</dependencies>
出现Bug
Error starting ApplicationContext. To display the auto-configuration report re-run your application with 'debug' enabled.
2018-11-09 17:48:40.358 ERROR 21246 --- [           main] o.s.b.d.LoggingFailureAnalysisReporter   : 

***************************
APPLICATION FAILED TO START
***************************

Description:

An attempt was made to call the method org.codehaus.commons.compiler.Location.<init>(Ljava/lang/String;SS)V but it does not exist. Its class, org.codehaus.commons.compiler.Location, is available from the following locations:

    jar:file:/Users/AllenBai/.m2/repository/org/codehaus/janino/commons-compiler/3.0.8/commons-compiler-3.0.8.jar!/org/codehaus/commons/compiler/Location.class

It was loaded from the following location:

    file:/Users/AllenBai/.m2/repository/org/codehaus/janino/commons-compiler/3.0.8/commons-compiler-3.0.8.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.codehaus.commons.compiler.Location

解决方法

添加依赖包

<dependency>
        <groupId>org.codehaus.janino</groupId>
        <artifactId>commons-compiler</artifactId>
        <version>2.7.8</version>
</dependency>
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值