I have been trying to connect using the JMS Output node in Message Broker
to AQ for several weeks and have not been successful.
If anyone knows how to do this, please let me know.
I am using Oracle OID LDAP to define the JNDI. According to the
instructions in the help it should work:
1. Complete the following steps in Oracle AQ, referring to Oracle
documentation for the specific details of each step.
a. You must install the Oracle Internet Directory Server (OID) to
host the JNDI administered objects for Oracle AQ.
You can configure Oracle AQ to register JMS connection
factories and destinations (queues and topics)
automatically with the OID server when these JMS
connection factories and destinations are created in the
Oracle database.
b. Create the database tables to hold the JMS queues and topics.
c. Create the JMS queues and topics and associate them with the
tables created in step 1b.
OID is installed and configured:And here is the program that was able
to register it:
****************************************************************************************************************
import java.util.Hashtable;
import java.util.Properties;
import javax.jms.JMSException;
import javax.naming.Context;
import oracle.jms.AQjmsConstants;
import oracle.jms.AQjmsFactory;
public class registerOracleAQ {
public static void main(String[] args) {
createCF();
}
private static void createCF() {
String url;
Hashtable env = new Hashtable(5, 0.75f);
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.sun.jndi.ldap.LdapCtxFactory");
env.put(Context.PROVIDER_URL, "ldap://orappsrv01:389");
env.put("searchbase",
"cn=oretail,cn=OracleContext,dc=orappsrv01,dc=com");
env.put
("server_dn","cn=oretail,cn=OracleContext,dc=orappsrv01,dc=com");
env.put(Context.SECURITY_AUTHENTICATION, "simple");
env.put(Context.SECURITY_PRINCIPAL, "cn=orcladmin");
env.put(Context.SECURITY_CREDENTIALS, "oracle10g");
Properties properties = new Properties();
properties.setProperty("user","ribaq");
properties.setProperty("password","ribaq");
url = "jdbc:oracle:thin:@ordbsrv:1521:oretail";
try {
AQjmsFactory.registerConnectionFactory(env, "ribaq", url,
properties, "queue");
} catch ( JMSException e) {
e.printStackTrace();
}
}
}
**************************************************************************************************************
This is the ldif I used to create these 3 leaves in those branches:
****************************************************************************************************
dn: cn=RIBAQ.ETXITEM,cn=OracleDBQueues,cn=oretail,cn=OracleContext,
dc=orappsrv01,dc=com
orcldbaqpointerattr:
cn=RIBAQ.ETXITEMTABLE,cn=OracleDBQueueTables,cn=oretail,cn=OracleContext,dc=orappsrv01,dc=com
javaClassName: oracle.jms.AQjmsDestination
orcldbaqobjname: ETXITEM
javaFactory: oracle.jms.AQjmsDestinationFactory
objectClass: top
objectClass: javaContainer
objectClass: javaObject
objectClass: javaNamingReference
objectClass: orclDBAQObject
orcldbaqobjtype: Queue
cn: RIBAQ.ETXITEM
orcldbaqgeneric: maxretries=3
orcldbaqobjowner: RIBAQ
dn:
cn=RIBAQ.ETXITEMTABLE,cn=OracleDBQueueTables,cn=oretail,cn=OracleContext,
dc=orappsrv01,dc=com
orcldbaqobjname: ETXITEMTABLE
orcldbaqobjtype: QueueTable
objectClass: top
objectClass: javaContainer
objectClass: javaObject
objectClass: javaNamingReference
objectClass: orclDBAQObject
javaClassName: oracle.AQ.AQOracleQueueTable
javaFactory: oracle.AQ.AQOracleQueueTableFactory
orcldbaqobjowner: RIBAQ
orcldbaqgeneric: PayloadType=SYS.AQ$_JMS_MESSAGE
cn: RIBAQ.ETXITEMTABLE
dn: cn=RIBAQ,cn=OracleDBConnections,cn=oretail,cn=OracleContext,
dc=orappsrv01,dc=com
objectClass: top
objectClass: javaContainer
objectClass: javaObject
objectClass: javaNamingReference
objectClass: orclDBAQConnection
javaFactory: oracle.jms.AQjmsConnectionFactory
javaClassName: oracle.jms.AQjmsQueueConnectionFactory
cn: RIBAQ
orcldbaqgeneric: JDBC_connect_string=jdbc:oracle:thin:@ordbsrv:1521:oretail
orcldbaqgeneric: Username=ribaq
orcldbaqgeneric: Password=xxxxxxx
*******************************************************************************************************
I then uploaded it by using:
ldapadd -h orappsrv01 -p 389 -D "cn=orcladmin" -w oracle10g -c -v -f
cleanqueue.ldif
==========================================================================
mqsichangeproperties IB9NODE -c JMSProviders -o Oracle_AQ -n jarsURL
-v \Winapp\Oracle\jdbc\lib
mqsichangeproperties IB9NODE -c JMSProviders -o Oracle_AQ -n
nativeLibs -v \Winapp\Oracle\jdbc\lib
mqsichangeproperties IB9NODE -c JMSProviders âo Oracle_AQ -n
connectionFactoryName -v
cn=ribaq,cn=OracleDBConnections,cn=oretail,cn=OracleContext,dc=orappsrv01,dc=com
mqsichangeproperties IB9NODE -c JMSProviders âo Oracle_AQ -n
initialContextFactory -v com.sun.jndi.ldap.LdapCtxFactory
mqsichangeproperties IB9NODE âc JMSProviders âo Oracle_AQ -n
jndiBindingsLocation -v ldap://orappsrv01:389
mqsichangeproperties IB9NODE -c JMSProviders âo Oracle_AQ -n
jarsURL,InitialContextFactory -v \Winapps\Oracle\jdbc
\lib,com.sun.jndi.ldap.LdapCtxFactory
mqsireportproperties IB9NODE -o Oracle_AQ -r -c JMSProviders
JMSProviders
Oracle_AQ
clientAckBatchSize='0'
clientAckBatchTime='0'
connectionFactoryName=''
initialContextFactory='com.sun.jndi.ldap.LdapCtxFactory'
jarsURL='\Winapp\Oracle\jdbc\lib'
jmsAsyncExceptionHandling='false'
jmsProviderXASupport='true'
jndiBindingsLocation='ldap://orappsrv01:389'
jndiEnvironmentParms='default_none'
nativeLibs='default_Path'
proprietaryAPIAttr1='default_none'
proprietaryAPIAttr2='default_none'
proprietaryAPIAttr3='default_none'
proprietaryAPIAttr4='default_none'
proprietaryAPIAttr5='default_none'
proprietaryAPIHandler='default_none'
================================================================================================================
========================================================================================================================
================================================================================================================================
Result:
2014-04-02 11:07:29.232224 9980 UserTrace BIP12036E: Failed to find
JNDI definition for destination queue
''cn=RIBAQ.ETXITEM,cn=OracleDBQueues,cn=oretail,cn=OracleContext,
dc=orappsrv01,dc=com''.
The node cannot obtain a JNDI
Administered Object, because some of the values specified are incorrect.
The JMS Exception text is: ''javax.naming.Reference incompatible with
javax.jms.Destination''.
Check the JNDI Administered
configuration for the JMS provider used by the node.
Either:
Modify the JNDI Administered
objects and rebuild the bindings
or
Change the Configurable Service
attributes associated with this JMS Provider and restart the execution
group
or
Change the node attributes and
redeploy the message flow.
2014-04-02 11:07:29.740386 9980 UserTrace BIP2231E: Error detected
whilst processing a message in node
'ESB_RIB_ItemMaintenance.ESB_RIB_RibMessages.PublishToRIB_JMSOutput'.
The message broker detected an error
whilst processing a message in node
'ESB_RIB_ItemMaintenance.ESB_RIB_RibMessages.PublishToRIB_JMSOutput'. The
message has been augmented with an exception list and has been propagated
to the node's failure terminal for further processing.
See the following messages for
details of the error.
2014-04-02 11:07:29.740456 9980 RecoverableException BIP4640E: IIB
JMSClient. ''Broker 'IB9NODE'; Execution Group 'default'; Message Flow
'ESB_RIB_ItemMaintenance'; Node
'ESB_RIB_RibMessages.PublishToRIB_JMSOutput::ComIbmJMSClientOutputNode' ''
There is a configuration problem with the JNDI Administered objects where:
Initial Context Factory = ''com.sun.jndi.ldap.LdapCtxFactory''. Location
of the bindings = ''ldap://orappsrv01:389''. ConnectionFactory Name =
''oracle.jms.AQjmsDestinationFactory''. JMS destination = ''''. The
exception text is : ''javax.naming.Reference incompatible with
javax.jms.Destination''.
The node cannot obtain a JNDI
Administered Object, because some of the values specified are incorrect.
Check the JNDI Administered
configuration for the JMS provider used by the node.
Either:
Modify the JNDI Administered
objects and rebuild the bindings
or
Change the Configurable Service
attributes associated with this JMS Provider and restart the execution
group
or
Change the node attributes and
redeploy the message flow.
2014-04-02 11:07:29.740552 9980 UserTrace BIP2539I: Node
'ESB_RIB_ItemMaintenance.ESB_RIB_RibMessages.Trace2': Evaluating expression
''ExceptionList'' at ('', '1.3'). This resolved to ''ExceptionList''. The
result was ''ROW... Root Element Type=16777216 NameSpace='' Name='Root'
Value=NULL''.
2014-04-02 11:07:29.740850 9980 UserTrace BIP4060I: Data
''( ['MQROOT' : 0x27b5cbb0]
(0x01000000:Name):RecoverableException = (
(0x03000000:NameValue):File
= 'F:\build\slot2\S000_P\src\DataFlowEngine\MessageServices
\ImbDataFlowNode.cpp' (CHARACTER)
(0x03000000:NameValue):Line
= 1153 (INTEGER)
(0x03000000:NameValue):Function
= 'ImbDataFlowNode::createExceptionList' (CHARACTER)
(0x03000000:NameValue):Type
= 'ComIbmJMSClientOutputNode' (CHARACTER)
(0x03000000:NameValue):Name
=
'ESB_RIB_ItemMaintenance#FCMComposite_1_4.ESB_RIB_RibMessages#FCMComposite_1_7' (CHARACTER)
(0x03000000:NameValue):Label
=
'ESB_RIB_ItemMaintenance.ESB_RIB_RibMessages.PublishToRIB_JMSOutput' (CHARACTER)
(0x03000000:NameValue):Catalog
= 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity
= 3 (INTEGER)
(0x03000000:NameValue):Number
= 2230 (INTEGER)
(0x03000000:NameValue):Text
= 'Node throwing exception' (CHARACTER)
(0x01000000:Name ):RecoverableException = (
(0x03000000:NameValue):File
= 'JMSClientErrors.java' (CHARACTER)
(0x03000000:NameValue):Line
= 694 (INTEGER)
(0x03000000:NameValue):Function = 'JMSClientHelper::lookUpJMSDestinations
()' (CHARACTER)
(0x03000000:NameValue):Type
= '' (CHARACTER)
(0x03000000:NameValue):Name
= '' (CHARACTER)
(0x03000000:NameValue):Label
= '' (CHARACTER)
(0x03000000:NameValue):Catalog
= 'BIPmsgs' (CHARACTER)
(0x03000000:NameValue):Severity = 3 (INTEGER)
(0x03000000:NameValue):Number
= 4640 (INTEGER)
(0x03000000:NameValue):Text
= 'Unable to find JMS Destination in JNDI' (CHARACTER)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= 'Broker 'IB9NODE'; Execution Group 'default'; Message Flow
'ESB_RIB_ItemMaintenance'; Node
'ESB_RIB_RibMessages.PublishToRIB_JMSOutput::ComIbmJMSClientOutputNode'
' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= 'com.sun.jndi.ldap.LdapCtxFactory' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= 'ldap://orappsrv01:389' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= 'oracle.jms.AQjmsDestinationFactory' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= '' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= 'javax.naming.Reference incompatible with
javax.jms.Destination' (CHARACTER)
)
(0x01000000:Name ):Insert
= (
(0x03000000:NameValue):Type
= 5 (INTEGER)
(0x03000000:NameValue):Text
= ' java.lang.ClassCastException : javax.naming.Reference incompatible with
javax.jms.Destination' (CHARACTER)
)
)
)
)
'' from trace node
'ESB_RIB_ItemMaintenance.ESB_RIB_RibMessages.Trace2'.
===============================================================================================================================
I have run out of ideas.
Respectfully,
Raúl L. Acevedo
Senior IT Architect
Smarter Commerce - AIS Retail
IBM Global Business Service
818 599 6626 mobile
***@us.ibm.com email