如何修复Sonatype Nexus升级失败(NoClassDefFoundError)?
我正在尝试将 Nexus 服务器从版本 1.7.2 升级到最新版本 1.9.2。我在自己的 Tomcat 安装上使用 war 发行版(Linux 上的 Tomcat 6.0.18、Sun Java 1.6.0_14)。
我所做的是取消部署旧版本的 webapp ,然后部署新版本的 nexus.war (通过 Tomcat 的 HTML 管理器)。这一切似乎都很顺利,Web 应用程序已部署,但当我尝试访问它时,出现 500 内部服务器错误。
查看 Nexus 日志,我看到以下消息:
2011-08-10 23:57:42 WARN [http-8080-4 ] - o.s.g.b.r.LoadedCla~ - Error injecting: org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource
java.lang.NoClassDefFoundError: org/sonatype/nexus/index/ArtifactInfoFilter
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
(....)
并且
2011-08-10 23:57:42 ERROR [http-8080-4 ] - o.a.c.c.C.[.[.[/nex~ - nexus: Error during the starting of the Restlet Application
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource
at ClassRealm[org.sonatype.nexus.plugins:nexus-archetype-plugin:1.0.1-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]]
while locating org.sonatype.plexus.rest.resource.PlexusResource annotated with @com.google.inject.name.Named(value=org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource)
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:977)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
(...)
我用 google 搜索了一下,看看这是否是一个已知问题,但找不到任何东西...有没有人在升级 Nexus 时遇到类似的问题,和/或知道该怎么办吗?
I'm trying to upgrade a Nexus server from version 1.7.2 to the latest, 1.9.2. I'm using the war distribution on my own Tomcat installation (Tomcat 6.0.18, Sun Java 1.6.0_14, on Linux).
What I've done is undeployed the old version of the webapp , and then deployed the new version of nexus.war (via Tomcat's HTML manager). This all seems to go fine, the webapp gets deployed, but when I then try to access it I get a 500 Internal Server Error.
Looking in the nexus logs, I see the following messages:
2011-08-10 23:57:42 WARN [http-8080-4 ] - o.s.g.b.r.LoadedCla~ - Error injecting: org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource
java.lang.NoClassDefFoundError: org/sonatype/nexus/index/ArtifactInfoFilter
at java.lang.Class.getDeclaredConstructors0(Native Method)
at java.lang.Class.privateGetDeclaredConstructors(Class.java:2389)
at java.lang.Class.getDeclaredConstructors(Class.java:1836)
at com.google.inject.spi.InjectionPoint.forConstructorOf(InjectionPoint.java:243)
at com.google.inject.internal.ConstructorBindingImpl.create(ConstructorBindingImpl.java:96)
at com.google.inject.internal.InjectorImpl.createUninitializedBinding(InjectorImpl.java:628)
(....)
and
2011-08-10 23:57:42 ERROR [http-8080-4 ] - o.a.c.c.C.[.[.[/nex~ - nexus: Error during the starting of the Restlet Application
com.google.inject.ProvisionException: Guice provision errors:
1) Error injecting: org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource
at ClassRealm[org.sonatype.nexus.plugins:nexus-archetype-plugin:1.0.1-SNAPSHOT, parent: ClassRealm[plexus.core, parent: null]]
while locating org.sonatype.plexus.rest.resource.PlexusResource annotated with @com.google.inject.name.Named(value=org.sonatype.nexus.plugins.mac.api.MacRepositoryPlexusResource)
1 error
at com.google.inject.internal.InjectorImpl$4.get(InjectorImpl.java:977)
at com.google.inject.Scopes$1$1.get(Scopes.java:59)
at org.sonatype.guice.bean.locators.LazyBeanEntry.getValue(LazyBeanEntry.java:79)
at org.sonatype.guice.plexus.locators.LazyPlexusBean.getValue(LazyPlexusBean.java:53)
(...)
I have googled around a bit to see if this is a known problem but couldn't really find anything... Has anyone experienced a similar problem when upgrading Nexus, and/or know what to do about it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
找到了这个问题的答案(通过 Sonatype 社区论坛):我安装了一个旧的 nexus-archetype 插件(位于
sonatype-work/nexus/plugin-repository
中)。显然,这个功能现在已经随 Nexus 一起提供了。删除插件解决了问题。Found the answer to this (via the Sonatype community forum): I had an old nexus-archetype plugin installed (located in
sonatype-work/nexus/plugin-repository
). Apparently this functionality now ships with Nexus itself. Removing the plugin fixed the problem.