tomee-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jean-Louis MONTEIRO (JIRA)" <j...@apache.org>
Subject [jira] Commented: (OPENEJB-1067) Cobertura intrumentation breaks OpenEJB MDB's
Date Thu, 10 Sep 2009 13:24:57 GMT

    [ https://issues.apache.org/jira/browse/OPENEJB-1067?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753610#action_12753610
] 

Jean-Louis MONTEIRO commented on OPENEJB-1067:
----------------------------------------------

Activating cobertura breaks the Java EE specification that's why OpenEJB fails.
Cobertura make some code enhancements. As you can see from the log, Cobertura makes all classes
implementing net.sourceforge.cobertura.coveragedata.HasBeenInstrumented inerface. 

>From the specification point of view, when the MDB implements more than one interface
other than java.io.Serializable, java.io.Externalizable or any other defined by javax.ejb
package, the message listener interface must be specified by the messageListenerInterface
element of the annotation or the messaging-type element of the message-driver deployment descriptor
element.

So from my point of view, it isn't a bug.
If you change the annotation to @MessageDriven(messageListenerInterface=MessageListener.class)
it will work as expected.

> Cobertura intrumentation breaks OpenEJB MDB's
> ---------------------------------------------
>
>                 Key: OPENEJB-1067
>                 URL: https://issues.apache.org/jira/browse/OPENEJB-1067
>             Project: OpenEJB
>          Issue Type: Bug
>    Affects Versions: 3.1.1
>            Reporter: Francis De Brabandere
>
> {noformat}
> FATAL - OpenEJB has encountered a fatal error and cannot be started: Assembler failed
to build the container system.
> org.apache.openejb.OpenEJBException: java.lang.IllegalStateException: When annotating
a bean class as @MessageDriven without declaring messageListenerInterface, the bean must implement
exactly one interface, no more and no less. beanClass=com.example.EventServiceConsumerMDB
interfaces=javax.jms.MessageListener, net.sourceforge.cobertura.coveragedata.HasBeenInstrumented,
: When annotating a bean class as @MessageDriven without declaring messageListenerInterface,
the bean must implement exactly one interface, no more and no less. beanClass=com.example.EventServiceConsumerMDB
interfaces=javax.jms.MessageListener, net.sourceforge.cobertura.coveragedata.HasBeenInstrumented,

> 	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:285)
> 	at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:137)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:286)
> 	at org.apache.openejb.OpenEJB.init(OpenEJB.java:265)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.openejb.loader.OpenEJBInstance.init(OpenEJBInstance.java:36)
> 	at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:71)
> 	at org.apache.openejb.client.LocalInitialContextFactory.init(LocalInitialContextFactory.java:53)
> 	at org.apache.openejb.client.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:42)
> 	at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
> 	at javax.naming.InitialContext.getDefaultInitCtx(InitialContext.java:288)
> 	at javax.naming.InitialContext.init(InitialContext.java:223)
> 	at javax.naming.InitialContext.<init>(InitialContext.java:197)
> 	at com.example.UnitTestInitialContextFactory.create(UnitTestInitialContextFactory.java:23)
> 	at com.example.EventServiceExampleBeanTest.setUp(EventServiceExampleBeanTest.java:19)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:44)
> 	at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:15)
> 	at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:41)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:27)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:70)
> 	at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:44)
> 	at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:180)
> 	at org.junit.runners.ParentRunner.access$000(ParentRunner.java:41)
> 	at org.junit.runners.ParentRunner$1.evaluate(ParentRunner.java:173)
> 	at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:28)
> 	at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:31)
> 	at org.junit.runners.ParentRunner.run(ParentRunner.java:220)
> 	at org.apache.maven.surefire.junit4.JUnit4TestSet.execute(JUnit4TestSet.java:62)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.executeTestSet(AbstractDirectoryTestSuite.java:140)
> 	at org.apache.maven.surefire.suite.AbstractDirectoryTestSuite.execute(AbstractDirectoryTestSuite.java:127)
> 	at org.apache.maven.surefire.Surefire.run(Surefire.java:177)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> 	at java.lang.reflect.Method.invoke(Method.java:597)
> 	at org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345)
> 	at org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009)
> Caused by: java.lang.IllegalStateException: When annotating a bean class as @MessageDriven
without declaring messageListenerInterface, the bean must implement exactly one interface,
no more and no less. beanClass=com.example.EventServiceConsumerMDB interfaces=javax.jms.MessageListener,
net.sourceforge.cobertura.coveragedata.HasBeenInstrumented, 
> 	at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1317)
> 	at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:616)
> 	at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:186)
> 	at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:247)
> 	at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:601)
> 	at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:551)
> 	at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:380)
> 	at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:292)
> 	at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:271)
> 	... 44 more
> {noformat}

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message