java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/11823288/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-31 06:30:18  来源:igfitidea点击:

java.lang.ArrayStoreException: sun.reflect.annotation.TypeNotPresentExceptionProxy

javaspringjsf-2jboss6.x

提问by Rounak

I am trying to deploy my project on JBoss 6.0. I am using Netbeans 7.0.1, Spring 3.0.2 and JSF2.0. The project is running fine in Tomcat. But when I trying to deploy on JBoss, I am getting the following error:

我正在尝试在 JBoss 6.0 上部署我的项目。我使用的是 Netbeans 7.0.1、Spring 3.0.2 和 JSF2.0。该项目在Tomcat中运行良好。但是当我尝试在 JBoss 上部署时,出现以下错误:

       *** DEPLOYMENTS IN ERROR: Name -> Error

         vfs:///C:/jboss-6.0.0.Final/server/default/deploy/WebApplication3.war ->  
                           org.jboss.deployers.spi.DeploymentException: Error during 
                  deploy: vfs:///C:/jboss-      6.0.0.Final/server/default/deploy/WebApplication3.war


              DEPLOYMENTS IN ERROR:
          Deployment "vfs:///C:/jboss- 
        6.0.0.Final/server/default/deploy/WebApplication3.war" is in error due to the 
     following reason(s): java.lang.ArrayStoreException: 
     sun.reflect.annotation.TypeNotPresentExceptionProxy

at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1370) [:2.2.0.GA]
at org.jboss.deployers.plugins.deployers.DeployersImpl.checkComplete(DeployersImpl.java:1316) [:2.2.0.GA]
at org.jboss.deployers.plugins.main.MainDeployerImpl.checkComplete(MainDeployerImpl.java:968) [:2.2.0.GA]
at org.jboss.system.server.profileservice.deployers.MainDeployerPlugin.checkComplete(MainDeployerPlugin.java:82) [:6.0.0.Final]
at org.jboss.profileservice.dependency.ProfileControllerContext$DelegateDeployer.checkComplete(ProfileControllerContext.java:138) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.deploy(HDScanner.java:246) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner$HDScanAction.complete(HDScanner.java:192) [:0.2.2]
at org.jboss.profileservice.management.TwoPCActionWrapper.doComplete(TwoPCActionWrapper.java:57) [:0.2.2]
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.complete(AbstractTwoPhaseModificationAction.java:74) [:0.2.2]
at org.jboss.profileservice.management.actions.AbstractTwoPhaseModificationAction.prepare(AbstractTwoPhaseModificationAction.java:95) [:0.2.2]
at org.jboss.profileservice.management.ModificationSession.prepare(ModificationSession.java:87) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.internalPerfom(AbstractActionController.java:234) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.performWrite(AbstractActionController.java:213) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:150) [:0.2.2]
at org.jboss.profileservice.management.AbstractActionController.perform(AbstractActionController.java:135) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.scan(HDScanner.java:146) [:0.2.2]
at org.jboss.profileservice.deployment.hotdeploy.HDScanner.run(HDScanner.java:90) [:0.2.2]
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471) [:1.7.0]
at java.util.concurrent.FutureTask$Sync.innerRunAndReset(FutureTask.java:351) [:1.7.0]
at java.util.concurrent.FutureTask.runAndReset(FutureTask.java:178) [:1.7.0]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access1(ScheduledThreadPoolExecutor.java:178) [:1.7.0]
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [:1.7.0]
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110) [:1.7.0]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603) [:1.7.0]
at java.lang.Thread.run(Thread.java:722) [:1.7.0]

Can anyone figure this out? Thanks in advance.

任何人都可以弄清楚吗?提前致谢。

回答by Janning

It happened for me when I used Spring Configuration annotation like this:

当我像这样使用 Spring Configuration 注释时,它发生在我身上:

@Configuration
@Import({ Config.class })
public class WebConfig extends WebMvcConfigurerAdapter
{
   ...
}

When I renamed Config.classto CoreConfig.classthe error occurred when starting jetty. this happened because the CoreConfig.classwas in a different sub module of my maven project, so jetty couldn't see it (as it resolves dependencies through mvn local repository).

当我重命名Config.classCoreConfig.class启动jetty时发生的错误。发生这种情况是因为它CoreConfig.class位于我的 maven 项目的不同子模块中,因此 jetty 无法看到它(因为它通过 mvn 本地存储库解析依赖项)。

After calling 'mvn install' everything was fine again.

调用 'mvn install' 后一切正常。

So this might not exactly your problem but it might help you. As your problem can be a packaging problem. Some class is not on the classpath maybe.

所以这可能不完全是你的问题,但它可能对你有帮助。因为您的问题可能是包装问题。某些类可能不在类路径上。