[ 
https://issues.apache.org/jira/browse/OWB-871?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13680271#comment-13680271
 ] 

Reinis Vicups commented on OWB-871:
-----------------------------------

Ok I will find it in spec, just one more remark

- as I understand, Strub says: "It might be because method with @Observes is 
not valid EJB Business Method", but
- the @javax.enterprise.event.Observes comes from CDI and not EJB, so the 
method is a "CDI method"?
- same apply for a method with @Inject annotation - it is CDI method and thus I 
get NO error if I declare @Inject method in implementation WITHOUT respective 
declaration in interface.
- and do I understand correctly that @PreDestroy method is not Business Method 
but rather bean life cycle method and thus does not have to be declared in 
interface?

P.S. Will post spec reference as soon as I have found it, this case really 
puzzles me.
                
> WebbeansConfigurationException unless method is also declared in interface
> --------------------------------------------------------------------------
>
>                 Key: OWB-871
>                 URL: https://issues.apache.org/jira/browse/OWB-871
>             Project: OpenWebBeans
>          Issue Type: Bug
>          Components: Events
>    Affects Versions: 1.2.1
>            Reporter: Reinis Vicups
>         Attachments: observerininterface.zip
>
>
> In this scenario I receive WebbeansConfigurationException like this:
> SEVERE - CDI Beans module deployment failed
> org.apache.webbeans.exception.WebBeansConfigurationException: @Observes 
> public void 
> de.orbitx.observerininterface.BasicSchedulerWorkerManager.observerMethod(de.orbitx.observerininterface.SchedulerWorker)
>  neither in the ejb view of ejb BasicSchedulerWorkerManager nor static
>       at 
> org.apache.openejb.cdi.CdiPlugin.validateObserverMethods(CdiPlugin.java:423)
>       at 
> org.apache.openejb.cdi.CdiPlugin.defineSessionBean(CdiPlugin.java:368)
> This happens ONLY if following is true (see attached foobar project):
> - Bean (BasicSchedulerWorkerManager) implements interface 
> (SchedulerWorkerManager);
> - Bean is annotated as @javax.ejb.Singleton;
> - The observer method is not declared in the interface;
> If I remove @Singleton from BasicSchedulerWorkerManager, testcase passes.
> If I declare observerMethod in interface, testcase passes.
> Pay attention that Singleton is from javax.ejb (yes I need ejb singleton!)
> br
> reinis

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to