在jboss jboss-eap-7中使用oracle AQ的Mdb

时间:2017-09-27 10:12:11

标签: jboss-eap-7 jboss-mdb

我们正在将一些基于ejb的应用程序从Oc4j升级到jboss eap 7,并且需要连接到在oracle数据库中创建但无法部署mdb的oracle AQ。我一直关注this link并使用通用jms ra但无法连接到队列。 我的队列名称是AD_AMP_QUEUE,我不知道我使用的正确连接工厂myQCF在Oc4j中使用了什么。

这是我的代码:

@MessageDriven(
activationConfig = {
@ActivationConfigProperty(propertyName ="destinationType", propertyValue = "javax.jms.Queue") ,
@ActivationConfigProperty(propertyName="destination", propertyValue="java:/AD_AMP_QUEUE"),
@ActivationConfigProperty(propertyName="jndiParameters", propertyValue="java.naming.factory.url.pkgs=org.jboss.ejb.client.naming"),
@ActivationConfigProperty(propertyName="connectionFactory", propertyValue="myQCF"),
@ActivationConfigProperty(propertyName="connectionFactoryJndiName",propertyValue="myQCF"),
@ActivationConfigProperty(propertyName="connectionFactoryProperties", propertyValue="jdbc_connect_string=jdbc:oracle:thin:@//cdcld600n-NA-vip.adr.alcoa.com:1571/u601.adr.alcoa.com,host=cdcld600n-NA-vip.adr.alcoa.com,user=xxebz_admin,password=******,port=1571,driver=oracle.jdbc.driver.OracleDriver"),
@ActivationConfigProperty(propertyName="destinationProperties", propertyValue="owner=xxebz_admin,name=AD_AMP_QUEUE"),
@ActivationConfigProperty(propertyName="user", propertyValue="xxebz_admin"),
@ActivationConfigProperty(propertyName="password", propertyValue="********"),
@ActivationConfigProperty(propertyName="ConnectionFactoryClassName", propertyValue="oracle.jms.AQjmsConnectionFactory"),
@ActivationConfigProperty(propertyName="QueueConnectionFactoryClassName", propertyValue="oracle.jms.AQjmsQueueConnectionFactory")
}
)
@ResourceAdapter("generic-jms-ra-2.0.0.Alpha3-SNAPSHOT.rar")

public class MessageReceiverEBSNABean implements MessageDrivenBean, MessageListener {  

    static Log log = LogFactory.getLog(MessageReceiverEBSNABean.class.getName());

    private MessageDrivenContext mdc = null;
    public static final String MODIFY = "UPDATE";
    public static final String ERRORS = "ERRORS";
    public static final String CREATE = "CREATE";

    /**
    * Constructor, which is public and takes no arguments.
    */
    public MessageReceiverEBSNABean() {
        log.debug("Constructor invoked");
    }


public void onMessage(Message inMessage) {

        TextMessage msg = null;

        try {

            if (inMessage instanceof TextMessage) 
//logic goes here

}
}

}
and after deploymentwhen jboss tries to connect to destination as defined in mdb am getting below error:
Unable to reconnect org.jboss.resource.adapter.jms.inflow.JmsActivationSpec@271a856c(ra=org.jboss.resource.adapter.jms.JmsResourceAdapter@6250529f destination=java:/AD_AMP_QUEUE destinationType=javax.jms.Queue acknowledgeMode=Auto-acknowledge subscriptionDurability=false reconnectInterval=10 reconnectAttempts=-1 user=xxebz_admin password=<not shown> maxMessages=1 minSession=1 maxSession=15 connectionFactory myQcf jndiParameters={java.naming.factory.url.pkgs=org.jboss.ejb.client.naming}): javax.naming.NameNotFoundException: AD_AMP_QUEUE -- service jboss.naming.context.java.AD_AMP_QUEUE
        at org.jboss.as.naming.ServiceBasedNamingStore.lookup(ServiceBasedNamingStore.java:106)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:207)
        at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:235)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:193)
        at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:189)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at javax.naming.InitialContext.lookup(InitialContext.java:417)
        at org.jboss.resource.adapter.jms.inflow.JmsActivation.lookup(JmsActivation.java:562)
        at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupDestination(JmsActivation.java:385)
        at org.jboss.resource.adapter.jms.inflow.JmsActivation.setupActivation(JmsActivation.java:312)
        at org.jboss.resource.adapter.jms.inflow.JmsActivation.handleFailure(JmsActivation.java:258)
        at org.jboss.resource.adapter.jms.inflow.JmsActivation$SetupActivation.run(JmsAc

0 个答案:

没有答案