简体   繁体   English

在JBOSS 7 eap上部署错误,@ EJB问题与在bean中部署有关

[英]Deploy error on JBOSS 7 eap , @EJB issue with deploy in a bean

Good day 美好的一天

I am trying to deploy an existing application to JBOSS EAP 7, But the deploy failed with following error: 我正在尝试将现有应用程序部署到JBOSS EAP 7,但是部署失败并出现以下错误:

Caused by: java.lang.IllegalArgumentException: WFLYWELD0033: interface javax.ejb.EJB annotation not found on InterfaceTest  ClassA \"}}"
at org.jboss.as.weld.services.bootstrap.WeldEjbInjectionServices.registerEjbInjectionPoint(WeldEjbInjectionServices.java:97)
at org.jboss.weld.injection.ResourceInjectionFactory$EjbResourceInjectionProcessor.getResourceReferenceFactory(ResourceInjectionFactory.java:274)
at org.jboss.weld.injection.ResourceInjectionFactory$EjbResourceInjectionProcessor.getResourceReferenceFactory(ResourceInjectionFactory.java:269)
at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createFieldResourceInjection(ResourceInjectionFactory.java:217)
at org.jboss.weld.injection.ResourceInjectionFactory$ResourceInjectionProcessor.createResourceInjections(ResourceInjectionFactory.java:189)
at org.jboss.weld.injection.ResourceInjectionFactory.discoverType(ResourceInjectionFactory.java:449)
at org.jboss.weld.injection.ResourceInjectionFactory.getResourceInjections(ResourceInjectionFactory.java:97)
at org.jboss.weld.injection.producer.ResourceInjector.<init>(ResourceInjector.java:59)
at org.jboss.weld.injection.producer.ResourceInjector.of(ResourceInjector.java:49)
at org.jboss.weld.injection.producer.BeanInjectionTarget.<init>(BeanInjectionTarget.java:63)
at org.jboss.weld.injection.producer.BeanInjectionTarget.createDefault(BeanInjectionTarget.java:47)
at org.jboss.weld.manager.InjectionTargetFactoryImpl.chooseInjectionTarget(InjectionTargetFactoryImpl.java:113)
at org.jboss.weld.manager.InjectionTargetFactoryImpl.createInjectionTarget(InjectionTargetFactoryImpl.java:86)
at org.jboss.weld.bean.ManagedBean.<init>(ManagedBean.java:100)
at org.jboss.weld.bean.ManagedBean.of(ManagedBean.java:80)
at org.jboss.weld.bootstrap.AbstractBeanDeployer.createManagedBean(AbstractBeanDeployer.java:261)
at org.jboss.weld.bootstrap.BeanDeployer.createClassBean(BeanDeployer.java:228)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:78)
at org.jboss.weld.bootstrap.ConcurrentBeanDeployer$2.doWork(ConcurrentBeanDeployer.java:75)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:63)
at org.jboss.weld.executor.IterativeWorkerTaskFactory$1.call(IterativeWorkerTaskFactory.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
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)
at org.jboss.threads.JBossThread.run(JBossThread.java:320)

where ClassA is ClassA在哪里

   @Named(value = "ao007")
   @ViewAccessScoped
   public class classA {

     @EJB
     InterfacTest test;

   }

InterfaceTest is 接口测试

   @Remote
   public interface InterfaceTest {

   }

EJB is EJB

   @Stateless
   @Interceptors(Interceptor.class)
   public class EJBTest implements InterfaceTest {

   }

Every .class is in the same jar , the jar is in the web-inf lib of the war which I am deploying 每个.class都在同一个jar中,该jar在我正在部署的战争的web-inf lib

I searched a lot but seems nobody have had this errors 我进行了很多搜索,但似乎没有人遇到此错误

Thanks in advance 提前致谢

If you are implementing the InterfaceTest you don't need to put the @Remote twice (on EJBTest and InterfaceTest), put only on InterfaceTest. 如果要实现InterfaceTest,则不需要两次(在EJBTest和InterfaceTest上)都使用@Remote,而只需在InterfaceTest上放置两次。

Did you try the injection with @Inject? 您是否尝试使用@Inject进行注射?

What's the context of classA? classA的背景是什么? Don't you have to put @Named on it? 您不必在上面加上@Named吗?

ClassA is not a "managed component", eg. ClassA不是“托管组件”,例如。 EJB. EJB。 Therefore injection into it can not be performed. 因此,无法执行注入。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM