导入spark程序的maven依赖包时,无法导入,报错Unable to import maven project: See logs for details

问题:
导入spark程序的maven依赖包时,无法导入,且报错:
0:23 Unable to import maven project: See logs for details

2019-08-23 00:34:05,140 [ 747292] WARN - #org.jetbrains.idea.maven - Cannot reconnect.
java.lang.RuntimeException: Cannot reconnect.
at org.jetbrains.idea.maven.server.RemoteObjectWrapper.perform(RemoteObjectWrapper.java:111)
at org.jetbrains.idea.maven.server.MavenIndexerWrapper.createIndex(MavenIndexerWrapper.java:61)
at org.jetbrains.idea.maven.indices.MavenIndex.createContext(MavenIndex.java:396)
at org.jetbrains.idea.maven.indices.MavenIndex.access$500(MavenIndex.java:48)
at org.jetbrains.idea.maven.indices.MavenIndex$IndexData.<init>(MavenIndex.java:703)
at org.jetbrains.idea.maven.indices.MavenIndex.doOpen(MavenIndex.java:236)
at org.jetbrains.idea.maven.indices.MavenIndex.open(MavenIndex.java:202)
at org.jetbrains.idea.maven.indices.MavenIndex.<init>(MavenIndex.java:104)
at org.jetbrains.idea.maven.indices.MavenIndices.add(MavenIndices.java:92)
at org.jetbrains.idea.maven.indices.MavenIndicesManager.ensureIndicesExist(MavenIndicesManager.java:174)
at org.jetbrains.idea.maven.indices.MavenProjectIndicesManager$3.run(MavenProjectIndicesManager.java:117)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:337)
at com.intellij.util.ui.update.MergingUpdateQueue.execute(MergingUpdateQueue.java:327)
at com.intellij.util.ui.update.MergingUpdateQueue.lambda$flush$1(MergingUpdateQueue.java:277)
at com.intellij.util.ui.update.MergingUpdateQueue.flush(MergingUpdateQueue.java:291)
at com.intellij.util.ui.update.MergingUpdateQueue.run(MergingUpdateQueue.java:246)
at com.intellij.util.concurrency.QueueProcessor.runSafely(QueueProcessor.java:246)
at com.intellij.util.Alarm$Request.runSafely(Alarm.java:417)
at com.intellij.util.Alarm$Request.access$700(Alarm.java:344)
at com.intellij.util.Alarm$Request$1.run(Alarm.java:384)
at com.intellij.util.Alarm$Request.run(Alarm.java:395)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at com.intellij.util.concurrency.SchedulingWrapper$MyScheduledFutureTask.run(SchedulingWrapper.java:242)
at com.intellij.util.concurrency.BoundedTaskExecutor$2.run(BoundedTaskExecutor.java:212)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
Caused by: java.rmi.UnmarshalException: Error unmarshaling return header; nested exception is:
java.net.SocketException: Connection reset

原因:maven版本问题,我原来使用的是maven3.6.0,不兼容。

我需要导入的maven依赖如下:

<properties>
<scala.version>2.11.8</scala.version>
<hadoop.version>2.7.4</hadoop.version>
<spark.version>2.1.3</spark.version>
</properties>
<dependencies>
<dependency>
<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>${scala.version}</version>
</dependency>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.11</artifactId>
<version>${spark.version}</version>
</dependency>

</dependencies>

<build>
<sourceDirectory>src/main/scala</sourceDirectory>
<testSourceDirectory>src/test/scala</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.alchim31.maven</groupId>
<artifactId>scala-maven-plugin</artifactId>
<version>3.2.2</version>
<executions>
<execution>
<goals>
<goal>compile</goal>
<goal>testCompile</goal>
</goals>
<configuration>
<args>
<arg>-dependencyfile</arg>
<arg>${project.build.directory}/.scala_dependencies</arg>
</args>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.3</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
<transformers>
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass></mainClass>
</transformer>
</transformers>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>

测试步骤:

1.更换仓库为一个空白的repository。同时该仓库的路径比较浅,怀疑是原来的仓库的路径太深了。或者原来仓库内容有问题。没用。

2.pom.xml中删除一些依赖、插件,然后一个个添加,没用。

解决方法:更换maven为idea自带的maven3.3.9.

原文地址:https://www.cnblogs.com/mediocreWorld/p/11426836.html

时间: 2024-10-11 21:56:49

导入spark程序的maven依赖包时,无法导入,报错Unable to import maven project: See logs for details的相关文章

【idea】【maven】报错Unable to import maven project: See logs for details

maven用的是3.6.3版本 idea是2018.1版本 jdk是1.8版本 网上说是maven太高了,高于3.6.2版本就会出现上面这种情况,然后我把maven换成3.3.9版本就可以了 参考文章(https://me.csdn.net/qq_45044162的评论):https://blog.csdn.net/Certain_/article/details/90745360 原文地址:https://www.cnblogs.com/xiaostudy/p/12324378.html

IDEA reimport时报错Unable to import maven project: See logs for details

报错 Unable to import maven project: See logs for details 查找报错原因 Help -> Show Log in Explorer,打开idea.log文件. 报错内容如下: 解决方案 经查找,发现idea版本(2017)不支持这么高的maven(3.6.2),换成idea自带的3.5.0就好了. 原文地址:https://www.cnblogs.com/aeolian/p/12150769.html

使用maven创建springMVC时返回页面报错

这是由于你的 Maven 编译级别是 jdk1.5 或以下,而你导入了 jdk1.6 以上的依赖包 解决办法: <build> <finalName></finalName> <plugins> <!-- define the project compile level --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId

Xcode 中BitCode是什么,怎样配置避免导入不支持BitCode的第三方库时工程编译报错?

Bitcode是什么? 查阅了一下官方文档,在 App Distribution Guide – App Thinning (iOS, watchOS) 一节中,找到了下面这样一个定义: Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the A

Unable to import Maven project

今天下载了最新版的maven(3.6.3),然后导入一个项目的时候,报错Unable to import Maven project 粗略的看了下日志: 感觉是JDK的问题,因此我修改了JDK for importer 结果还是不行,我就又仔细看了下发现: 然后搜了下网上的信息,发现解决方案是退maven的版本到3.6.1 原文地址:https://www.cnblogs.com/zhenhunfan2/p/12680028.html

maven项目pom.xml第一行报错

maven项目pom.xml第一行报错 这是第一行:<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd&q

maven依赖包下载失败解决办法

原文:http://www    .zuidaima.com/question/2535347150441472.htm maven依赖包下载失败 比如:Missing artifact org.codehaus.jackson:jackson-mapper-asl:jar:1.9.9 这种问题即使使用Project=>Clean来重新Buil项目都不行,因为这个操作是属于项目重新编译,而该问题是依赖包问题,所以只有在依赖包正常的情况下操作才会成功,解决办法就是maven clean 操作步骤如

JsonObject没有fromObject、idea引入maven有红线没依赖、JsonObject maven 依赖包

目录: 1.JsonObject maven 依赖包 2.idea引入maven有红线,没依赖 3.JsonObject没有fromObject \\\\\\\\\\\\\\\\\\\\\\\ 1.JsonObject maven 依赖包 一共就用一个,但是功能全就六个,我也是上网查到的. pom.xml如下: <dependencies> <!-- https://mvnrepository.com/artifact/net.sf.json-lib/json-lib --> &l

IDEA找不到程序包 和 request.getServletContext()报错Cannot resolve method &#39;getServletContext()的解决方法

重新装了idea和down了项目却一直报错,在调用request.getServletContext()的方法时一直报Cannot resolve method 'getServletContext()的错误,网上查了好多方法,大多数都是在说是servlet3.0才可以支持此方法,而servlet3.0只有tomcat7以上版本才可以,我检查了我自己的tomcat发现就是3.0,最终找到原因 对于Maven项目要检查pom文件中的servlet引入的是哪个包,我原来写的是这个 <dependen