gpt4 book ai didi

java - 错误注入(inject) : org. jboss.as.plugin.deployment.Deploy

转载 作者:塔克拉玛干 更新时间:2023-11-03 04:26:52 26 4
gpt4 key购买 nike

我在构建我的 maven 项目时遇到以下错误。

[INFO] --- jboss-as-maven-plugin:7.9.Final:deploy (default-cli) @ project-parent ---
[WARNING] Error injecting: org.jboss.as.plugin.deployment.Deploy
java.lang.NoClassDefFoundError: org/jboss/as/controller/client/ModelControllerClient
at java.lang.Class.getDeclaredConstructors0 (Native Method)
at java.lang.Class.privateGetDeclaredConstructors (Class.java:2595)
at java.lang.Class.getDeclaredConstructors (Class.java:1914)
at com.google.inject.spi.InjectionPoint.forConstructorOf (InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create (ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding (InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1006)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1038)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1001)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
Caused by: java.lang.ClassNotFoundException: org.jboss.as.controller.client.ModelControllerClient
at org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy.loadClass (SelfFirstStrategy.java:50)
at org.codehaus.plexus.classworlds.realm.ClassRealm.unsynchronizedLoadClass (ClassRealm.java:271)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:247)
at org.codehaus.plexus.classworlds.realm.ClassRealm.loadClass (ClassRealm.java:239)
at java.lang.Class.getDeclaredConstructors0 (Native Method)
at java.lang.Class.privateGetDeclaredConstructors (Class.java:2595)
at java.lang.Class.getDeclaredConstructors (Class.java:1914)
at com.google.inject.spi.InjectionPoint.forConstructorOf (InjectionPoint.java:245)
at com.google.inject.internal.ConstructorBindingImpl.create (ConstructorBindingImpl.java:99)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding (InjectorImpl.java:658)
at com.google.inject.internal.InjectorImpl.createJustInTimeBinding (InjectorImpl.java:882)
at com.google.inject.internal.InjectorImpl.createJustInTimeBindingRecursive (InjectorImpl.java:805)
at com.google.inject.internal.InjectorImpl.getJustInTimeBinding (InjectorImpl.java:282)
at com.google.inject.internal.InjectorImpl.getBindingOrThrow (InjectorImpl.java:214)
at com.google.inject.internal.InjectorImpl.getProviderOrThrow (InjectorImpl.java:1006)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1038)
at com.google.inject.internal.InjectorImpl.getProvider (InjectorImpl.java:1001)
at com.google.inject.internal.InjectorImpl.getInstance (InjectorImpl.java:1051)
at org.eclipse.sisu.space.AbstractDeferredClass.get (AbstractDeferredClass.java:48)
at com.google.inject.internal.ProviderInternalFactory.provision (ProviderInternalFactory.java:81)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.provision (InternalFactoryToInitializableAdapter.java:53)
at com.google.inject.internal.ProviderInternalFactory$1.call (ProviderInternalFactory.java:65)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:115)
at com.google.inject.internal.ProvisionListenerStackCallback$Provision.provision (ProvisionListenerStackCallback.java:133)
at com.google.inject.internal.ProvisionListenerStackCallback.provision (ProvisionListenerStackCallback.java:68)
at com.google.inject.internal.ProviderInternalFactory.circularGet (ProviderInternalFactory.java:63)
at com.google.inject.internal.InternalFactoryToInitializableAdapter.get (InternalFactoryToInitializableAdapter.java:45)
at com.google.inject.internal.InjectorImpl$2$1.call (InjectorImpl.java:1016)
at com.google.inject.internal.InjectorImpl.callInContext (InjectorImpl.java:1092)
at com.google.inject.internal.InjectorImpl$2.get (InjectorImpl.java:1012)
at org.eclipse.sisu.inject.Guice4$1.get (Guice4.java:162)
at org.eclipse.sisu.inject.LazyBeanEntry.getValue (LazyBeanEntry.java:81)
at org.eclipse.sisu.plexus.LazyPlexusBean.getValue (LazyPlexusBean.java:51)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:263)
at org.codehaus.plexus.DefaultPlexusContainer.lookup (DefaultPlexusContainer.java:255)
at org.apache.maven.plugin.internal.DefaultMavenPluginManager.getConfiguredMojo (DefaultMavenPluginManager.java:519)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo (DefaultBuildPluginManager.java:121)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute (MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject (LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build (SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute (LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:107)
at org.apache.maven.cli.MavenCli.execute (MavenCli.java:955)
at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:290)
at org.apache.maven.cli.MavenCli.main (MavenCli.java:194)
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:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:356)
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] project-parent .................................... FAILURE [ 0.426 s]
[INFO] project-ejb ....................................... SKIPPED
[INFO] project-web ....................................... SKIPPED
[INFO] project-ear ....................................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 0.899 s
[INFO] Finished at: 2018-06-15T15:30:21+10:00
[INFO] Final Memory: 11M/244M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.jboss.as.plugins:jboss-as-maven-plugin:7.9.Final:deploy (default-cli) on project project-parent: Execution default-cli of goal org.jboss.as.plugins:jboss-as-maven-plugin:7.9.Final:deploy failed: A required class was missing while executing org.jboss.as.plugins:jboss-as-maven-plugin:7.9.Final:deploy: org/jboss/as/controller/client/ModelControllerClient
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>org.jboss.as.plugins:jboss-as-maven-plugin:7.9.Final
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/Users/user1/.m2/repository/org/jboss/as/plugins/jboss-as-maven-plugin/7.9.Final/jboss-as-maven-plugin-7.9.Final.jar
[ERROR] urls[1] = file:/C:/Users/user1/.m2/repository/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------
[ERROR] : org.jboss.as.controller.client.ModelControllerClient
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[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

我的项目结构是

project-parent
-pom.xml
-project-ear
-pom.xml
-project-ejb
-pom.xml
-project-web
-pom.xml

我正在使用私有(private)存储库来为我的项目获取所有相关的 jar。

我已经尝试删除 ~/.m2/repository 文件夹但没有成功。我已经确认我的本地存储库中没有损坏的 jar,而且这在几周前一直运行良好,但刚刚开始抛出此错误。

由于某些奇怪的原因,它现在尝试在下载 jboss-as-maven-plugin-7.9.Final.jar 之后下载 plexus-utils-1.1.jar。此 plexus-utils-1.1.jar 似乎需要 ModelControllerClient 类。几周前我有另一个服务器设置,相同的代码运行得很好,它从不下载 plexus-utils-1.1.jar。所以不确定我当前的设置有什么问题。

我该如何解决这个问题?


编辑

添加父 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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.my.project</groupId>
<artifactId>project-parent</artifactId>
<packaging>pom</packaging>
<version>1.0</version>
<pluginRepositories>
<pluginRepository>
<id>project-repo</id>
<name>project custom repo</name>
<url>http://localhost:8081/repository/my/</url>
</pluginRepository>
</pluginRepositories>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.9.Final</version>
<configuration>
<hostname>${hostname}</hostname>
<port>9999</port>
<username>${jbossuser}</username>
<password>${jbosspassword}</password>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>

<modules>
<module>ear</module>
<module>ejb</module>
<module>web</module>
</modules>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>

最佳答案

因此,在反复处理可能出错的问题之后,我将精力集中在我的私有(private)存储库上。如问题中所述,第一步是验证我的 .m2 文件夹或我的私有(private)仓库中是否有任何损坏的文件,并发现没有损坏的 jar 文件。

接下来,我从我的 .m2 文件夹中删除了 jboss-as-maven-plugin 文件夹,因为这个插件与错误有关。我还从我的私有(private)仓库中删除了这个 Artifact ,并尝试再次运行我的设置。

这次是因为我的私有(private)仓库中不再提供该 Artifact ;它从 Maven 中央仓库下载它,然后继续下载该插件可能需要的其他相关 jar 文件,这次设置工作正常。如果我知道其他相关的 jar 并将它们放在我的私有(private) repo 中,这对私有(private) repo 会很好。

关于为什么它在我的其他服务器之一上工作,当我最初运行 maven deploy 命令时在那个特定的服务器上然后我的私有(private)仓库中没有 jboss-as-maven-plugin Artifact 所以在那个服务器上它从 maven central repo 下载了所有相关的 jar 文件,并且从它的 .m2 文件夹中一直使用这些文件

关于java - 错误注入(inject) : org. jboss.as.plugin.deployment.Deploy,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50869959/

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