You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomee.apache.org by Renato Pereira Back <re...@softplan.com.br> on 2015/05/22 19:14:34 UTC

Error when running MDB (EJB 2.0) defined on ejb-jar.xml

Hello, 

I am trying to run some tests with Open EJB and got the following error when running an application with a MDB (EJB 2.0) declared on ejb-jar.xml as follows: 



<message-driven> 
<display-name>FechamentoMDB</display-name> 
<ejb-name>FechamentoMDB</ejb-name> 
<ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class> 
<transaction-type>Bean</transaction-type> 
<acknowledge-mode>Auto-acknowledge</acknowledge-mode> 
<message-driven-destination> 
<destination-type>javax.jms.Queue</destination-type> 
</message-driven-destination> 
</message-driven> 

Here's the stack trace: 



22/05/2015 11:12:17 org.apache.openejb.util.OpenEJBErrorHandler handleUnknownError 
GRAVE: FATAL ERROR: Unknown error in Assembler. Please send the following stack trace and this message to users@openejb.apache.org : 
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=br.com.softplan.sider.sip.bens.moveis.movimentacoes.movimento.MovimentoMDB interfaces= 
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2603) 
at org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1726) 
at org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:344) 
at org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:379) 
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:884) 
at org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:757) 
at org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:515) 
at org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:373) 
at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:352) 
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147) 
at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:65) 
at org.apache.openejb.OpenEJB.init(OpenEJB.java:292) 
at org.apache.openejb.OpenEJB.init(OpenEJB.java:272) 
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.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:69) 
at org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51) 
at org.apache.openejb.core.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40) 
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:175) 
at br.com.softplan.sider.sip.test.SipEJBCaseTest.getDataSource(SipEJBCaseTest.java:97) 
at br.com.softplan.sider.sip.test.SipEJBCaseTest.runScript(SipEJBCaseTest.java:86) 
at br.com.softplan.sider.sip.test.SipEJBCaseTest.scriptsShutdown(SipEJBCaseTest.java:107) 
at br.com.softplan.sider.sip.test.SipEJBCaseTest.tearDown(SipEJBCaseTest.java:102) 
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:47) 
at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12) 
at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44) 
at org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33) 
at org.junit.runners.ParentRunner.run(ParentRunner.java:309) 
at org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252) 
at org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141) 
at org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112) 
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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189) 
at org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165) 
at org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85) 
at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115) 
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75) 

So far, I can add that no Annotations are being used and my MDB extends a class that implements MessageDrivenBean and MessageListener. 
I tried updating to EJB 2.1 with the following definition: 



<message-driven> 
<display-name>FechamentoMDB</display-name> 
<ejb-name>FechamentoMDB</ejb-name> 
<ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class> 
<messaging-type>javax.jms.MessageListener</messaging-type> 
<transaction-type>Bean</transaction-type> 
<activation-config> 
<activation-config-property> 
<activation-config-property-name>acknowledgeMode</activation-config-property-name> 
<activation-config-property-value>AutoAcknowledge</activation-config-property-value> 
</activation-config-property> 
<activation-config-property> 
<activation-config-property-name>destinationType</activation-config-property-name> 
<activation-config-property-value>javax.jms.Queue</activation-config-property-value> 
</activation-config-property> 
</activation-config> 
</message-driven> 

But that went up to no good, as the same error happened. 

There's no way I can upgrade it to EJB 3, so I was wondering if you could somehow help me. 

Thanks in advance, 

RENATO PEREIRA BACK 
ANALISTA IMPLEMENTADOR 
UNIDADE DE GESTÃO PÚBLICA 
Softplan/Poligraph 
+55 48 3027-8000 
www.softplan.com.br 
twitter.com/softplanonline 


Re: Error when running MDB (EJB 2.0) defined on ejb-jar.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
No here no interface is found otherwise it would be logged. Only javax.ejb
and some technical interfaces are skipped like serializable
Le 22 mai 2015 22:16, "Jean-Louis Monteiro" <jl...@tomitribe.com> a
écrit :

> Hi,
>
> As the error says, make sure your bean implements only one interface.
> Which version are you currently using (openejb I mean)?
>
> Also I've seen this error in the past when running unit tests with some
> coverage tools because they add an extra marker interface.
>
> --
> Jean-Louis Monteiro
> http://twitter.com/jlouismonteiro
> http://www.tomitribe.com
>
> On Fri, May 22, 2015 at 7:14 PM, Renato Pereira Back <
> renatop@softplan.com.br> wrote:
>
> > Hello,
> >
> > I am trying to run some tests with Open EJB and got the following error
> > when running an application with a MDB (EJB 2.0) declared on ejb-jar.xml
> as
> > follows:
> >
> >
> >
> > <message-driven>
> > <display-name>FechamentoMDB</display-name>
> > <ejb-name>FechamentoMDB</ejb-name>
> >
> >
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> > <transaction-type>Bean</transaction-type>
> > <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
> > <message-driven-destination>
> > <destination-type>javax.jms.Queue</destination-type>
> > </message-driven-destination>
> > </message-driven>
> >
> > Here's the stack trace:
> >
> >
> >
> > 22/05/2015 11:12:17 org.apache.openejb.util.OpenEJBErrorHandler
> > handleUnknownError
> > GRAVE: FATAL ERROR: Unknown error in Assembler. Please send the following
> > stack trace and this message to users@openejb.apache.org :
> > 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=br.com.softplan.sider.sip.bens.moveis.movimentacoes.movimento.MovimentoMDB
> > interfaces=
> > at
> >
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2603)
> > at
> >
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1726)
> > at
> >
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:344)
> > at
> >
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:379)
> > at
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:884)
> > at
> >
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:757)
> > at
> >
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:515)
> > at
> >
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:373)
> > at
> org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:352)
> > at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147)
> > at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:65)
> > at org.apache.openejb.OpenEJB.init(OpenEJB.java:292)
> > at org.apache.openejb.OpenEJB.init(OpenEJB.java:272)
> > 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.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:69)
> > at
> >
> org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
> > at
> >
> org.apache.openejb.core.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
> > 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:175)
> > at
> >
> br.com.softplan.sider.sip.test.SipEJBCaseTest.getDataSource(SipEJBCaseTest.java:97)
> > at
> >
> br.com.softplan.sider.sip.test.SipEJBCaseTest.runScript(SipEJBCaseTest.java:86)
> > at
> >
> br.com.softplan.sider.sip.test.SipEJBCaseTest.scriptsShutdown(SipEJBCaseTest.java:107)
> > at
> >
> br.com.softplan.sider.sip.test.SipEJBCaseTest.tearDown(SipEJBCaseTest.java:102)
> > 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:47)
> > at
> >
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> > at
> >
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> > at
> >
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
> > at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> > at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> > at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> > at
> >
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> > 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> > at
> >
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> > at
> >
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> > at
> >
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> > at
> org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
> >
> > So far, I can add that no Annotations are being used and my MDB extends a
> > class that implements MessageDrivenBean and MessageListener.
> > I tried updating to EJB 2.1 with the following definition:
> >
> >
> >
> > <message-driven>
> > <display-name>FechamentoMDB</display-name>
> > <ejb-name>FechamentoMDB</ejb-name>
> >
> >
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> > <messaging-type>javax.jms.MessageListener</messaging-type>
> > <transaction-type>Bean</transaction-type>
> > <activation-config>
> > <activation-config-property>
> >
> >
> <activation-config-property-name>acknowledgeMode</activation-config-property-name>
> >
> >
> <activation-config-property-value>AutoAcknowledge</activation-config-property-value>
> > </activation-config-property>
> > <activation-config-property>
> >
> >
> <activation-config-property-name>destinationType</activation-config-property-name>
> >
> >
> <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
> > </activation-config-property>
> > </activation-config>
> > </message-driven>
> >
> > But that went up to no good, as the same error happened.
> >
> > There's no way I can upgrade it to EJB 3, so I was wondering if you could
> > somehow help me.
> >
> > Thanks in advance,
> >
> > RENATO PEREIRA BACK
> > ANALISTA IMPLEMENTADOR
> > UNIDADE DE GESTÃO PÚBLICA
> > Softplan/Poligraph
> > +55 48 3027-8000
> > www.softplan.com.br
> > twitter.com/softplanonline
> >
> >
>

Re: Error when running MDB (EJB 2.0) defined on ejb-jar.xml

Posted by Jean-Louis Monteiro <jl...@tomitribe.com>.
Hi,

As the error says, make sure your bean implements only one interface.
Which version are you currently using (openejb I mean)?

Also I've seen this error in the past when running unit tests with some
coverage tools because they add an extra marker interface.

--
Jean-Louis Monteiro
http://twitter.com/jlouismonteiro
http://www.tomitribe.com

On Fri, May 22, 2015 at 7:14 PM, Renato Pereira Back <
renatop@softplan.com.br> wrote:

> Hello,
>
> I am trying to run some tests with Open EJB and got the following error
> when running an application with a MDB (EJB 2.0) declared on ejb-jar.xml as
> follows:
>
>
>
> <message-driven>
> <display-name>FechamentoMDB</display-name>
> <ejb-name>FechamentoMDB</ejb-name>
>
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> <transaction-type>Bean</transaction-type>
> <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
> <message-driven-destination>
> <destination-type>javax.jms.Queue</destination-type>
> </message-driven-destination>
> </message-driven>
>
> Here's the stack trace:
>
>
>
> 22/05/2015 11:12:17 org.apache.openejb.util.OpenEJBErrorHandler
> handleUnknownError
> GRAVE: FATAL ERROR: Unknown error in Assembler. Please send the following
> stack trace and this message to users@openejb.apache.org :
> 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=br.com.softplan.sider.sip.bens.moveis.movimentacoes.movimento.MovimentoMDB
> interfaces=
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2603)
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1726)
> at
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:344)
> at
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:379)
> at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:884)
> at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:757)
> at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:515)
> at
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:373)
> at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:352)
> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147)
> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:65)
> at org.apache.openejb.OpenEJB.init(OpenEJB.java:292)
> at org.apache.openejb.OpenEJB.init(OpenEJB.java:272)
> 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.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:69)
> at
> org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
> at
> org.apache.openejb.core.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
> 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:175)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.getDataSource(SipEJBCaseTest.java:97)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.runScript(SipEJBCaseTest.java:86)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.scriptsShutdown(SipEJBCaseTest.java:107)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.tearDown(SipEJBCaseTest.java:102)
> 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:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>
> So far, I can add that no Annotations are being used and my MDB extends a
> class that implements MessageDrivenBean and MessageListener.
> I tried updating to EJB 2.1 with the following definition:
>
>
>
> <message-driven>
> <display-name>FechamentoMDB</display-name>
> <ejb-name>FechamentoMDB</ejb-name>
>
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> <messaging-type>javax.jms.MessageListener</messaging-type>
> <transaction-type>Bean</transaction-type>
> <activation-config>
> <activation-config-property>
>
> <activation-config-property-name>acknowledgeMode</activation-config-property-name>
>
> <activation-config-property-value>AutoAcknowledge</activation-config-property-value>
> </activation-config-property>
> <activation-config-property>
>
> <activation-config-property-name>destinationType</activation-config-property-name>
>
> <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
> </activation-config-property>
> </activation-config>
> </message-driven>
>
> But that went up to no good, as the same error happened.
>
> There's no way I can upgrade it to EJB 3, so I was wondering if you could
> somehow help me.
>
> Thanks in advance,
>
> RENATO PEREIRA BACK
> ANALISTA IMPLEMENTADOR
> UNIDADE DE GESTÃO PÚBLICA
> Softplan/Poligraph
> +55 48 3027-8000
> www.softplan.com.br
> twitter.com/softplanonline
>
>

Re: Error when running MDB (EJB 2.0) defined on ejb-jar.xml

Posted by Romain Manni-Bucau <rm...@gmail.com>.
Hi

the exception means you don't implement javax.jms.MessageListener. Maybe
double check your class. Also ensure you dont use a wrong jms api but the
org.apache.openejb:javaee-api one at runtime.


Romain Manni-Bucau
@rmannibucau <https://twitter.com/rmannibucau> |  Blog
<http://rmannibucau.wordpress.com> | Github <https://github.com/rmannibucau> |
LinkedIn <https://www.linkedin.com/in/rmannibucau> | Tomitriber
<http://www.tomitribe.com>

2015-05-22 19:14 GMT+02:00 Renato Pereira Back <re...@softplan.com.br>:

> Hello,
>
> I am trying to run some tests with Open EJB and got the following error
> when running an application with a MDB (EJB 2.0) declared on ejb-jar.xml as
> follows:
>
>
>
> <message-driven>
> <display-name>FechamentoMDB</display-name>
> <ejb-name>FechamentoMDB</ejb-name>
>
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> <transaction-type>Bean</transaction-type>
> <acknowledge-mode>Auto-acknowledge</acknowledge-mode>
> <message-driven-destination>
> <destination-type>javax.jms.Queue</destination-type>
> </message-driven-destination>
> </message-driven>
>
> Here's the stack trace:
>
>
>
> 22/05/2015 11:12:17 org.apache.openejb.util.OpenEJBErrorHandler
> handleUnknownError
> GRAVE: FATAL ERROR: Unknown error in Assembler. Please send the following
> stack trace and this message to users@openejb.apache.org :
> 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=br.com.softplan.sider.sip.bens.moveis.movimentacoes.movimento.MovimentoMDB
> interfaces=
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:2603)
> at
> org.apache.openejb.config.AnnotationDeployer$ProcessAnnotatedBeans.deploy(AnnotationDeployer.java:1726)
> at
> org.apache.openejb.config.AnnotationDeployer.deploy(AnnotationDeployer.java:344)
> at
> org.apache.openejb.config.ConfigurationFactory$Chain.deploy(ConfigurationFactory.java:379)
> at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:884)
> at
> org.apache.openejb.config.ConfigurationFactory.configureApplication(ConfigurationFactory.java:757)
> at
> org.apache.openejb.config.ConfigurationFactory.getOpenEjbConfiguration(ConfigurationFactory.java:515)
> at
> org.apache.openejb.assembler.classic.Assembler.getOpenEjbConfiguration(Assembler.java:373)
> at org.apache.openejb.assembler.classic.Assembler.build(Assembler.java:352)
> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:147)
> at org.apache.openejb.OpenEJB$Instance.<init>(OpenEJB.java:65)
> at org.apache.openejb.OpenEJB.init(OpenEJB.java:292)
> at org.apache.openejb.OpenEJB.init(OpenEJB.java:272)
> 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.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:69)
> at
> org.apache.openejb.core.LocalInitialContextFactory.init(LocalInitialContextFactory.java:51)
> at
> org.apache.openejb.core.LocalInitialContextFactory.getInitialContext(LocalInitialContextFactory.java:40)
> 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:175)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.getDataSource(SipEJBCaseTest.java:97)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.runScript(SipEJBCaseTest.java:86)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.scriptsShutdown(SipEJBCaseTest.java:107)
> at
> br.com.softplan.sider.sip.test.SipEJBCaseTest.tearDown(SipEJBCaseTest.java:102)
> 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:47)
> at
> org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
> at
> org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:44)
> at
> org.junit.internal.runners.statements.RunAfters.evaluate(RunAfters.java:33)
> at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.execute(JUnit4Provider.java:252)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.executeTestSet(JUnit4Provider.java:141)
> at
> org.apache.maven.surefire.junit4.JUnit4Provider.invoke(JUnit4Provider.java:112)
> 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.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
> at
> org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
> at
> org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
> at
> org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
> at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)
>
> So far, I can add that no Annotations are being used and my MDB extends a
> class that implements MessageDrivenBean and MessageListener.
> I tried updating to EJB 2.1 with the following definition:
>
>
>
> <message-driven>
> <display-name>FechamentoMDB</display-name>
> <ejb-name>FechamentoMDB</ejb-name>
>
> <ejb-class>br.com.softplan.sider.sip.bens.moveis.contabilidade.fechamento.FechamentoMDB</ejb-class>
> <messaging-type>javax.jms.MessageListener</messaging-type>
> <transaction-type>Bean</transaction-type>
> <activation-config>
> <activation-config-property>
>
> <activation-config-property-name>acknowledgeMode</activation-config-property-name>
>
> <activation-config-property-value>AutoAcknowledge</activation-config-property-value>
> </activation-config-property>
> <activation-config-property>
>
> <activation-config-property-name>destinationType</activation-config-property-name>
>
> <activation-config-property-value>javax.jms.Queue</activation-config-property-value>
> </activation-config-property>
> </activation-config>
> </message-driven>
>
> But that went up to no good, as the same error happened.
>
> There's no way I can upgrade it to EJB 3, so I was wondering if you could
> somehow help me.
>
> Thanks in advance,
>
> RENATO PEREIRA BACK
> ANALISTA IMPLEMENTADOR
> UNIDADE DE GESTÃO PÚBLICA
> Softplan/Poligraph
> +55 48 3027-8000
> www.softplan.com.br
> twitter.com/softplanonline
>
>