在jboss部署过程中验证错误。如何解决这个问题?

问题描述 投票:0回答:1

当我在Jboss中部署我的应用程序时,我得到了以下的错误信息。

ERROR [org.jboss.msc.service.fail] (MSC service thread 1-6) MSC000001: Failed to start service jboss.deployment.subunit."test.ear"."hello.war".INSTALL: org.jboss.msc.service.StartException in service jboss.deployment.subunit."test.ear"."hello.war".INSTALL: WFLYSRV0153: Failed to process phase INSTALL of subdeployment "hello.war" of deployment "test.ear"
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:172)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.startService(ServiceControllerImpl.java:2032)
    at org.jboss.msc.service.ServiceControllerImpl$StartTask.run(ServiceControllerImpl.java:1955)
    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: org.jboss.as.server.deployment.DeploymentUnitProcessingException: WFLYEE0024: Could not configure component HelloWorld
    at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:106)
    at org.jboss.as.server.deployment.DeploymentUnitPhaseService.start(DeploymentUnitPhaseService.java:165)
    ... 5 more
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
    at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:313)
    at org.jboss.invocation.proxy.AbstractClassFactory.defineClass(AbstractClassFactory.java:160)
    at org.jboss.invocation.proxy.AbstractProxyFactory.getCachedMethods(AbstractProxyFactory.java:146)
    at org.jboss.as.ee.component.ViewDescription$DefaultConfigurator.configure(ViewDescription.java:196)
    at org.jboss.as.ee.component.DefaultComponentViewConfigurator.configure(DefaultComponentViewConfigurator.java:67)
    at org.jboss.as.ee.component.deployers.EEModuleConfigurationProcessor.deploy(EEModuleConfigurationProcessor.java:92)
    ... 6 more
Caused by: java.lang.reflect.InvocationTargetException
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:498)
    at org.jboss.classfilewriter.ClassFile.define(ClassFile.java:308)
    ... 11 more
Caused by: java.lang.VerifyError: class com.test.java.HelloWorldImpl$$$view1 overrides final method getDetails.(Ljava/lang/String;)Ljava/lang/Object;
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:763)
    ... 16 more

注意:类HelloWorldImpl并没有覆盖最终方法getDetails,它只是调用它的超级类最终方法getDetails。

代码。

class HelloWorldImpl extends Hello{
...
public void display() { 
...     
 Foo fooObj = (Foo)getDetails("test");
...
}
}               

class Hello{
public final Object getDetails(String id){
...
}
}
java deployment jboss-eap-7
1个回答
0
投票

HelloWorldImpl是不可代理的,因为它有一个继承自Hello的最终方法。

不可代理的类不能有一个除 @Dependent.

如果你不能使用 @Dependent 范围内,你可以从HelloWorldImpl中提取一个包含你需要的方法的接口,并将注入点改为接口类型。

然后查看WELD文档中提到的这种情况和解决方法。https:/docs.jboss.orgweldreferencelatesten-UShtmlinjection.html#_client_proxies。

© www.soinside.com 2019 - 2024. All rights reserved.