我们正在将一些基于 ejb 的应用程序从 Oc4j 升级到 jboss eap 7,并且需要连接到在 oracle 数据库中创建的 oracle AQ,但无法部署 mdb。我一直在关注此链接 并使用通用 jms ra 但无法连接到队列。我的队列名称是 AD_AMP_QUEUE,我不知道我在 Oc4j 中使用的正确连接工厂 myQCF 是什么。
这是我的代码:
@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