JBoss 6 deployment of message-driven bean error

Posted by AntonioP on Stack Overflow See other posts from Stack Overflow or by AntonioP
Published on 2010-12-16T14:33:12Z Indexed on 2010/12/21 9:54 UTC
Read the original article Hit count: 584


I have an java EE application which has one message-driven bean and it runs fine on JBoss 4, however when I configure the project for JBoss 6 and deploy on it, I get this error;

WARN  [org.jboss.ejb.deployers.EjbDeployer.verifier] EJB spec violation:


The message driven bean must declare one onMessage() method.


org.jboss.deployers.spi.DeploymentException: Verification of Enterprise Beans failed, see above for error messages.

But my bean HAS the onMessage method! It would not have worked on jboss 4 either then.

Why do I get this error!?


The class in question looks like this

package ...
imports ...

public class MyMDB implements MessageDrivenBean, MessageListener {
AnotherSessionBean a;
OneMoreSessionBean b;

public MyMDB() {}

public void onMessage(Message message) {
    if (message instanceof TextMessage) {
        try {
                //Lookup sessionBeans by jndi, create them
                // check message-type, then invokie
                // else

            } catch (SomeException e) { 
                  //handling it 

public void lookupABean() {
    try {
         // code to lookup session beans and create.
    } catch (CreateException e) { // handling it and catching NamingException too }

Edit 2: And this is the jboss.xml relevant parts


© Stack Overflow or respective owner

Related posts about deployment

Related posts about jboss