0

我是 EJB3 开发人员的新人。当我编写 EJB3 mdb 并且想将其部署到我的 jboss (jboss-4.2.3.GA) 时,这里有一些错误信息:

--- MBeans 等待其他 MBeans --- ObjectName: jboss.j2ee:jar=HelloWorldEjb.jar,name=QueneMDB01,service=EJB3 状态: FAILED 原因: org.jboss.deployment.DeploymentException: 必需的配置属性RequiredConfigPropertyM etaData@12c08c7 [name=destination descriptions=[DescriptionMetaData@1941dc9[language=zh]]] 用于在激活配置 [ActivationConfigProperty(destinationType=javax.jms.Queue)、ActivationConfigProperty(acknowledgeMode=Auto -acknowledge)] ra=jboss.jca: service=RARDeployment,name='jms-ra.rar'

--- MBean 是问题的根本原因 --- ObjectName:jboss.j2ee:jar=HelloWorldEjb.jar,name=QueneMDB01,service=EJB3 状态:失败原因:org.jboss.deployment.DeploymentException:必需的配置属性RequiredConfigPropertyM etaData@12c08c7[name=destination descriptions=[DescriptionMetaData@1941dc9[language=zh]]] 在激活配置 [ActivationConfigProperty(destinationType=javax.jms.Queue)、ActivationConfigProperty 中找不到消息类型“javax.jms.MessageListener” (acknowledgeMode=Auto-acknowledge)] ra=jboss.jca: service=RARDeployment,name='jms-ra.rar'

我的 mdb 是:

@MessageDriven(activationConfig = {
    @ActivationConfigProperty(propertyName = "acknowledgeMode", propertyValue = "Auto-acknowledge"),
    @ActivationConfigProperty(propertyName = "destinationType", propertyValue = "javax.jms.Queue") })

public class QueneMDB01 implements MessageListener 
{
    public void onMessage(Message msg) {
        // TODO Auto-generated method stub
        try {
            TextMessage textMessage = (TextMessage) msg;
            System.out.println("MyQueneMDBBean is called "
                    + textMessage.getText() + " ");
        } catch (JMSException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
    }
}
4

1 回答 1

0

根据您的错误,我会说您忘记添加目标名称(可能是队列名称)。

FAILED Reason: org.jboss.deployment.DeploymentException: Required config property RequiredConfigPropertyM etaData@12c08c7[name=destination descriptions=[DescriptionMetaData@1941dc9[language=zh]]

示例: http ://www.javaissues.com/2011/06/ejb3-message-driven-bean-hello-world.html

顺便说一句,您已经在 J​​Boss 中设置了队列/主题,对吗?

希望这会有所帮助,戴夫

于 2012-07-30T14:25:33.063 回答