You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openwebbeans.apache.org by "Mark Struberg (Resolved) (JIRA)" <ji...@apache.org> on 2012/04/02 23:07:36 UTC

[jira] [Resolved] (OWB-659) An annotated interface class is being seen as a manage bean.

     [ https://issues.apache.org/jira/browse/OWB-659?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Mark Struberg resolved OWB-659.
-------------------------------

    Resolution: Fixed

Christian, can you please try with the latest owb-snapshot? Should be fixed as we now ignore annotations, interfaces and enums as being subject to injection.
                
> An annotated interface class is being seen as a manage bean.
> ------------------------------------------------------------
>
>                 Key: OWB-659
>                 URL: https://issues.apache.org/jira/browse/OWB-659
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Injection and Lookup
>    Affects Versions: 1.1.3
>         Environment: Linux
>            Reporter: Christian Nuesa
>            Assignee: Mark Struberg
>              Labels: annotation, exception, interface, managedbeans, validation
>             Fix For: 1.1.4
>
>
> 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)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira