gpt4 book ai didi

java - Maven Jar插件怪异错误NoClassDefFoundError : javá/nio/fiìe/FileStore

转载 作者:行者123 更新时间:2023-11-29 05:34:17 28 4
gpt4 key购买 nike

尝试安装组件时收到以下错误。

奇怪的是原因似乎是:Caused by: java.lang.NoClassDefFoundError: java/nio/fiìe/FileStore 用这些口音写的。 java -versionjavac -version 都返回版本 7,因此 FileStore 类应该存在,但在没有这些重音的包中。我已经删除了所有 ~/m2 但没有成功。从日志中可以看出,使用的是jar插件的2.3.2版本; pom.xml中没有为这个插件设置任何配置,只有artifactIdgroupIdversion

根据带有 -X 的 Maven 堆栈跟踪的第一部分,区域设置为 en_US,编码为 UTF-8:

Apache Maven 3.0.4
Maven home: /usr/share/maven
Java version: 1.7.0_40, vendor: Oracle Corporation
Java home: /x/s/jdk1.7.0_40/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "3.2.0-54-generic", arch: "amd64", family: "unix"

当使用 -X 调用时,跟踪的最后一部分是:

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 18.515s
[INFO] Finished at: Mon Nov 18 14:17:50 EET 2013
[INFO] Final Memory: 23M/128M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar (default-jar) on project common: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar: javá/nio/fiìe/FileStore
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/home/dev/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.2/maven-jar-plugin-2.3.2.jar
[ERROR] urls[1] = file:/home/dev/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
[ERROR] urls[2] = file:/home/dev/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
[ERROR] urls[3] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
[ERROR] urls[4] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.jar
[ERROR] urls[5] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.jar
[ERROR] urls[6] = file:/home/dev/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
[ERROR] urls[7] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar (default-jar) on project common: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar: javá/nio/fiìe/FileStore
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/dev/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.2/maven-jar-plugin-2.3.2.jar
urls[1] = file:/home/dev/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[2] = file:/home/dev/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
urls[3] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
urls[4] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.jar
urls[5] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.jar
urls[6] = file:/home/dev/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
urls[7] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:225)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBuild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:352)
Caused by: org.apache.maven.plugin.PluginExecutionException: Execution default-jar of goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar failed: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar: javá/nio/fiìe/FileStore
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/dev/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.2/maven-jar-plugin-2.3.2.jar
urls[1] = file:/home/dev/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[2] = file:/home/dev/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
urls[3] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
urls[4] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.jar
urls[5] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.jar
urls[6] = file:/home/dev/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
urls[7] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:127)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:209)
... 19 more
Caused by: org.apache.maven.plugin.PluginContainerException: A required class was missing while executing org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar: javá/nio/fiìe/FileStore
-----------------------------------------------------
realm = plugin>org.apache.maven.plugins:maven-jar-plugin:2.3.2
strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
urls[0] = file:/home/dev/.m2/repository/org/apache/maven/plugins/maven-jar-plugin/2.3.2/maven-jar-plugin-2.3.2.jar
urls[1] = file:/home/dev/.m2/repository/junit/junit/3.8.1/junit-3.8.1.jar
urls[2] = file:/home/dev/.m2/repository/org/apache/maven/maven-archiver/2.4.2/maven-archiver-2.4.2.jar
urls[3] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.13/plexus-interpolation-1.13.jar
urls[4] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-archiver/2.0.1/plexus-archiver-2.0.1.jar
urls[5] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-io/2.0.1/plexus-io-2.0.1.jar
urls[6] = file:/home/dev/.m2/repository/commons-lang/commons-lang/2.1/commons-lang-2.1.jar
urls[7] = file:/home/dev/.m2/repository/org/codehaus/plexus/plexus-utils/3.0/plexus-utils-3.0.jar
Number of foreign imports: 1
import: Entry[import from realm ClassRealm[maven.api, parent: null]]

-----------------------------------------------------

at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:125)
... 20 more
Caused by: java.lang.NoClassDefFoundError: javá/nio/fiìe/FileStore
at java.lang.Class.getDeclaredMethods0(Native Method)
at java.lang.Class.privateGetDeclaredMethods(Class.java:2521)
at java.lang.Class.getMethod0(Class.java:2764)
at java.lang.Class.getMethod(Class.java:1653)
at org.codehaus.plexus.components.io.attributes.Java7Reflector.<clinit>(Java7Reflector.java:86)
at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.getFileAttributesByPath(PlexusIoResourceAttributeUtils.java:222)
at org.codehaus.plexus.components.io.attributes.PlexusIoResourceAttributeUtils.getFileAttributes(PlexusIoResourceAttributeUtils.java:172)
at org.codehaus.plexus.archiver.ArchiveEntry.createFileEntry(ArchiveEntry.java:158)
at org.codehaus.plexus.archiver.AbstractArchiver.addFile(AbstractArchiver.java:382)
at org.codehaus.plexus.archiver.AbstractArchiver.addFile(AbstractArchiver.java:297)
at org.apache.maven.archiver.MavenArchiver.createArchive(MavenArchiver.java:487)
at org.apache.maven.plugin.jar.AbstractJarMojo.createArchive(AbstractJarMojo.java:216)
at org.apache.maven.plugin.jar.AbstractJarMojo.execute(AbstractJarMojo.java:235)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:101)
... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginContainerException

最佳答案

要么你的内存有问题,要么你硬盘上的某个 JAR 文件损坏了。

删除 /home/dev/.m2/repository 并重试。

如果这不能解决问题,请运行内存测试。如果显示有问题,则修复 PC。如果它没有显示任何内容,请更换 PC - 内存测试并不总能找到缺陷。如果他们发现了什么,你可以确定有问题。如果他们什么也没发现,您根本就不知道,因为某种访问模式可能会导致问题。

关于java - Maven Jar插件怪异错误NoClassDefFoundError : javá/nio/fiìe/FileStore,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20048380/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com