Uploaded image for project: 'OpenWebBeans'
  1. OpenWebBeans
  2. OWB-659

An annotated interface class is being seen as a manage bean.

    Details

      Description

      I have an interface class generated by Apache CXF 2.4.3 in my project which comes out to have @WebService annotation in it. This interface causes a runtime exception coming from WebBeansUtil.checkManagedBeanCondition(..) which states "ManagedBean implementation class : <class> may not defined as interface".

      This exception tells me that during the scanning of classes this interface is being mistaken as a managed bean, but it is not, hence the exception. I investigated the code and narrowed my problem with BeansDeployer.java and surely enough its method called defineManagedBean(..) fails to validate if the class is an interface first before processing (so leading to the exception).

      This method must check if the incoming class is an interface so then must return a false value. This way, any interface like this is avoided as managed bean.

      Here is the exception:

      org.apache.webbeans.exception.WebBeansConfigurationException: ManagedBean implementation class : com.mgmmirage.playersclub.definitions.PlayersClubPlayerPortType may not defined as interface
      at org.apache.webbeans.util.WebBeansUtil.checkManagedBeanCondition(WebBeansUtil.java:3042)
      at org.apache.webbeans.component.creation.ManagedBeanCreatorImpl.checkCreateConditions(ManagedBeanCreatorImpl.java:65)
      at org.apache.webbeans.util.WebBeansUtil.defineManagedBean(WebBeansUtil.java:2894)
      at org.apache.webbeans.container.BeanManagerImpl.createInjectionTarget(BeanManagerImpl.java:1143)
      at org.apache.webbeans.util.WebBeansUtil.fireProcessInjectionTargetEventForJavaEeComponents(WebBeansUtil.java:2173)
      at org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:788)
      at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:558)
      at org.apache.webbeans.config.BeansDeployer.defineManagedBean(BeansDeployer.java:788)
      at org.apache.webbeans.config.BeansDeployer.deploySingleAnnotatedType(BeansDeployer.java:558)
      at org.apache.webbeans.config.BeansDeployer.deployFromClassPath(BeansDeployer.java:494)
      at org.apache.webbeans.config.BeansDeployer.deploy(BeansDeployer.java:166)
      at org.apache.webbeans.lifecycle.AbstractLifeCycle.startApplication(AbstractLifeCycle.java:127)
      at org.apache.webbeans.web.lifecycle.WebContainerLifecycle.startApplication(WebContainerLifecycle.java:88)
      at org.apache.webbeans.servlet.WebBeansConfigurationListener.contextInitialized(WebBeansConfigurationListener.java:85)
      at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:4765)
      at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5260)
      at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
      at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:866)
      at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:842)
      at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:615)
      at org.apache.catalina.startup.HostConfig.deployWAR(HostConfig.java:958)
      at org.apache.catalina.startup.HostConfig$DeployWar.run(HostConfig.java:1599)
      at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
      at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
      at java.util.concurrent.FutureTask.run(FutureTask.java:138)
      at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
      at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
      at java.lang.Thread.run(Thread.java:680)

        Attachments

          Activity

            People

            • Assignee:
              struberg Mark Struberg
              Reporter:
              thundersaint Christian Nuesa
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: