JMS Queue - lookup error
Hi All,
I have created a queue 'JMSTestQueue' through the Visual Administrator/ JMS Provider.
I have also created an MDB in which the ejb-j2ee-engine.xml contains a parameter as
<destination-name>JMSTestQueue</destination-name>
Now, when I try to deploy my MDB I get an exception saying
that
javax.resource.spi.UnavailableException: The destination JMSTestQueue cannot be looked up. Last attempt performed : jms_vendor_queues_global/JMSTestQueue.
Now here I can't understand that why the container is making a lookup in the path jms_vendor_queues_global.
Because the JMS queue I have created has the JNDI path as
jmsqueues/default/JMSTestQueue
Another twist to the tale is that when I use the default JMS queue by the name 'JobQueue', then the MDB is deployed succesfully. This means the 'lookup' is successful.
How do I solve this issue? I want to use a new JMS Queue with my MDB.
I'll be really grateful, if someone can help me out.
Thanks and Regards,
Gagan Parhar.
Hi All,
I have created a queue 'JMSTestQueue' through the Visual Administrator/ JMS Provider.
I have also created an MDB in which the ejb-j2ee-engine.xml contains a parameter as
<destination-name>JMSTestQueue</destination-name>
Now, when I try to deploy my MDB I get an exception saying
that
javax.resource.spi.UnavailableException: The destination JMSTestQueue cannot be looked up. Last attempt performed : jms_vendor_queues_global/JMSTestQueue.
Now here I can't understand that why the container is making a lookup in the path jms_vendor_queues_global.
Because the JMS queue I have created has the JNDI path as
jmsqueues/default/JMSTestQueue
Another twist to the tale is that when I use the default JMS queue by the name 'JobQueue', then the MDB is deployed succesfully. This means the 'lookup' is successful.
How do I solve this issue? I want to use a new JMS Queue with my MDB.
I'll be really grateful, if someone can help me out.
Thanks and Regards,
Gagan Parhar.
Similar Messages
-
Lookup Error from network JMS client
I am using J2EE RI Server
QueueConnectionFactory is created on the server using console.
when I list them asadmin tool I can see them.
The JMS Queue Supplier code
Hashtable env = new Hashtable();
String jndiFactory = "com.sun.jndi.cosnaming.CNCtxFactory";
String providerURL = "iiop://localhost:3700";
env.put(Context.INITIAL_CONTEXT_FACTORY, jndiFactory);
env.put(Context.PROVIDER_URL, providerURL);
InitialFactory con = new InitialContext(env);
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)
context.lookup("QueueConnectionFactory");
The line where lookup is called I get the following error.
I run this with these JVM environments -Dorg.omg.CORBA.ORBInitialHost=localhost -Dorg.omg.CORBA.ORBInitialPort=3700
I get the same error for the non appclients of EJB but works fine if the clients are appclients.
I am trying to solve this for three days, any insight would be helpful.
==================================
Error :javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.
amingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0]
javax.naming.NameNotFoundException. Root exception is org.omg.CosNaming.Naming
ontextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundH
lper.java:72)
at org.omg.CosNaming.NamingContextPackage.NotFoundHelper.read(NotFoundHe
lper.java:72)
at org.omg.CosNaming._NamingContextExtStub.resolve(_NamingContextExtStub
.java:406)
at com.sun.jndi.cosnaming.CNCtx.callResolve(CNCtx.java:440)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:492)
at com.sun.jndi.cosnaming.CNCtx.lookup(CNCtx.java:470)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at ejava.jms.QueueSupplier.<init>(QueueSupplier.java:86)
at ejava.jms.QueueSupplier.createAQueueAndSendOrder(QueueSupplier.java:1
46)
at ejava.jms.QueueSupplier.main(QueueSupplier.java:190)
=========================================================
Regards
Krishnai dont think u need set env and all this in all latest App servers.anyway.
Are u trying to do con.lookup("QueueConnectionFactory");
or
context.lookup("QueueConnectionFactory");
and also make sure the factory ur using is right one and also check the corbaloc is running on 3700
thsanks
hithesh -
I am trying to write to a JMS queue using the following cod:
Hashtable rmiEnvironment = new Hashtable();
rmiEnvironment.put(Context.INITIAL_CONTEXT_FACTORY,"com.evermind.server.rmi.RMIInitialContextFactory");
rmiEnvironment.put(Context.SECURITY_PRINCIPAL, "admin"); // username
rmiEnvironment.put(Context.SECURITY_CREDENTIALS, "welcome"); // pwd
rmiEnvironment.put(Context.PROVIDER_URL,"ormi://10.10.50.50:9127/APP");
Context ctx = new InitialContext(rmiEnvironment);
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory)ctx.lookup("jms/APP_QueueConnectionFactory");
The last line throws this exception:
javax.naming.NamingException: Lookup error: java.io.EOFException: Disconnected; nested exception is:
java.io.EOFException: Disconnected [Root exception is java.io.EOFException: Disconnected]
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:176)
at javax.naming.InitialContext.lookup(InitialContext.java:347)
at tests.TestJms.main(TestJms.java:35)
Caused by: java.io.EOFException: Disconnected
at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2507)
at com.evermind.server.rmi.RMIConnection.connect(RMIConnection.java:2355)
at com.evermind.server.rmi.RMIConnection.lookup(RMIConnection.java:1782)
at com.evermind.server.rmi.RMIServer.lookup(RMIServer.java:686)
at com.evermind.server.rmi.RMIContext.lookup(RMIContext.java:157)
... 2 more
On the server side (OC4J standalone), in jms.log the following is printed:
javax.jms.JMSException: [PROTOCOL ERROR] JMSRequestHandler[5:testsrv:46202]: "JMS protocol" error, expected "-559,038,735", got "-485,684,723".
at com.evermind.server.jms.JMSUtils.toJMSException(JMSUtils.java:1909)
at com.evermind.server.jms.JMSRequestHandler.readCheck(JMSRequestHandler.java:272)
at com.evermind.server.jms.JMSRequestHandler.protocol(JMSRequestHandler.java:282)
at com.evermind.server.jms.JMSRequestHandler.run(JMSRequestHandler.java:124)
at com.evermind.util.ReleasableResourcePooledExecutor$MyWorker.run(ReleasableResourcePooledExecutor.java:192)
at java.lang.Thread.run(Thread.java:534)For the record, if you want to run that sample code:
http://www.oracle.com/technology/sample_code/tech/java/jms/index.html
edit the classpath section of build.xml (provided with sample) as follows:
<!--Set the classpath-->
<path id="classpath">
<pathelement location="${OC4J_HOME}/j2ee/home/lib/jms.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/jndi.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/oc4jclient.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/javax77.jar"/>
<pathelement location="${OC4J_HOME}/lib/dms.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/bcel.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/oc4j-api.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/oc4j.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/oc4j-internal.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/oc4jclient.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/rmic.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/adminclient.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/connector.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/jmxri.jar"/>
<pathelement location="${OC4J_HOME}/j2ee/home/lib/jta.jar"/>
<pathelement location="${OC4J_HOME}/opmn/lib/optic.jar"/>
</path>
(class packaging has changed since this sample was written. Note that the above is really a superset of classes you would need for that simple example). -
Error while sending the messages to JMS Queue
Hi ,
I am trying to pick the file from JMS Queue and send the response xml as outbound message to JMS Queue again using XAI Sender
I Created XAI Sender, Outbound Message Type(DM-RCVRESP) and configured these two with External System.
I am able to pick the file from JMS Queue but unable to send the message through XAI Sender (Real-time)
Plz find below the error trace getting.
[Wed Jun 15 16:12:09 IST 2011] Error while processing sender "UPLOADSTG" : Unable to update response in staging table: Row id not given.
com.splwg.mpl.sending.SameThreadSendingManager$ProcessException
at com.splwg.mpl.sending.SameThreadSendingManager.processDestination(SameThreadSendingManager.java:341)
at com.splwg.mpl.sending.SameThreadSendingManager.sendResponse(SameThreadSendingManager.java:293)
at com.splwg.mpl.sending.SameThreadSendingManager.doSend(SameThreadSendingManager.java:249)
at com.splwg.mpl.server.async.ExecSendRequestProcessor.ProcessRequest(ExecSendRequestProcessor.java:61)
at com.splwg.mpl.server.async.RequestProcessingThreadAdapter.run(RequestProcessingThreadAdapter.java:46)
at com.splwg.mpl.server.PooledThread.run(PooledThread.java:91)
at java.lang.Thread.run(Thread.java:662)
Please guide me in this regard..
Thanks,
sukumarWhat have you configured for the response tab for the sender? Are you using the MPL or the MDB?
Take a look at:
MPL Best Practices (Doc Id 1308165.1)
Oracle WebLogic JMS Integration (Doc Id: 1308181.1) -
Error while passing ODI variable in JNDI Url for JMS Queue XML
Hi,
Facing a weird problem while passing ODI variable in JNDI Url for JMS Queue XML.
Below is the JNDI Url configured under ODI Topology:
JNDI Url: t3://<host_location>?d=#TEST.SCHEMA_FILE&s=<schema_name>&JMS_DESTINATION=jms/<queue_name>
where,
#TEST.SCHEMA_FILE --> ODI variable storing xsd name and location
Issue Description:
If we restart ODI server then for the first run of any ODI interface using JMS Queue XML, it is unable to get the value for ODI variable present in JNDI Url (d=#TEST.SCHEMA_FILE).
It throws error message saying: No XSD found
Temporary Resolution:
As a temporary fix if we hard-code and pass the value in that ODI variable as shown below, it will successfully go through.
eg: JNDI Url: t3://<host_location>?d=C:\XSD\test.xsd&s=<schema_name>&JMS_DESTINATION=jms/<queue_name>
Reverting it back to variable later will have no issues and subsequent run will succeed.
But again anytime later if server is restarted then first run will have this issue.
Want to have permanent fix for it.
Any one having idea on it please share. Appreciate your help!What ODI version are you using? It could be related to the bug in the older version as described in support note Doc ID 1290326.1
-
Error JMS queue cannot be multi-conumer enabled
Hi
I wanted to enqueue using IPmessage type in java but I ended up getting the error
Exception: oracle.jms.AQjmsException: JMS-130: JMS queue cannot be multi-conumer enabled
Below is my java code. Anyone has any ideas.
public static void main (String args [])
throws java.sql.SQLException, ClassNotFoundException, JMSException
try
String ora_sid = "QA620";
String host = "localhost";
String schema = "OSA";
String password = "OSA";
String queueName = "IP_OUT_QUEUE";
int port = 1521;
Enqueue(ora_sid, host, schema, password, queueName, port);
System.out.println("You should see messages in IP_OUT_QUEUE. Should be buffered but they are persistent instead");
catch (Exception ex)
System.out.println("Exception: " + ex);
public static void Enqueue(String ora_sid, String host,
String schema, String password, String queueName, int port) throws Exception
String s5 = generateIdAsString();
String s6 = "";
String s7 = "Acme";
String s8 = "GlobalChips";
String s9 = "ProcessORDERS";
String s10 = null;
String s11 = null;
int i = 1;
String s12 = null;
if(!isNullString(s12))
i = Integer.parseInt(s12);
String s13="D:\\sas.xml";
if(isNullString(s13))
throw new Exception("No payload uri");
String s14 = readFile(s13);
byte abyte0[] = null;
String s15 = "";
if(!isNullString(s15))
abyte0 = readFileInByte(s15);
QueueConnectionFactory qc_fact = null;
QueueConnection q_conn = null;
QueueSession q_sess = null;
java.sql.Connection db_conn = null;
Queue queue = null;
AdtMessage adt_msg = null;
QueueSender q_sender = null;
oracle.xdb.XMLType xtype = null;
String data = null;
try
qc_fact = AQjmsFactory.getQueueConnectionFactory(host,
ora_sid, port, "thin");
q_conn = qc_fact.createQueueConnection(schema, password);
q_sess = q_conn.createQueueSession(true, Session.CLIENT_ACKNOWLEDGE);
q_conn.start();
db_conn = ((AQjmsSession)q_sess).getDBConnection();
queue = ((AQjmsSession)q_sess).getQueue(schema, queueName);
q_sender = q_sess.createSender(queue);
adt_msg = ((AQjmsSession)q_sess).createAdtMessage();
data = "<bolek>olek</bolek>";
///xtype = oracle.xdb.XMLType.createXML(db_conn, data);
//=====================================
//AdtMessage adtmessage = aqjmssession.createAdtMessage();
IPMessageOld ipmessageold = new IPMessageOld(s5, s6, s8, s7, s9, s10, s11, i, s14.toCharArray(), abyte0);
ipmessageold.setPayload(CLOB.empty_lob());
ipmessageold.setAttachment(BLOB.empty_lob());
//=====================================
//adtmessage.setAdtPayload(ipmessageold);
adt_msg.setAdtPayload(ipmessageold); //xtype
//try sending a buffered message, different ways, none of them works!
((AQjmsQueueSender)q_sender).send(queue, adt_msg,
DeliveryMode.PERSISTENT, 1,
AQjmsConstants.EXPIRATION_NEVER);
q_sender.setDeliveryMode(DeliveryMode.PERSISTENT);
((AQjmsQueueSender)q_sender).send(queue, adt_msg,
DeliveryMode.PERSISTENT, 1,
AQjmsConstants.EXPIRATION_NEVER);
adt_msg.setJMSDeliveryMode(DeliveryMode.PERSISTENT);
((AQjmsQueueSender)q_sender).send(queue, adt_msg,
DeliveryMode.PERSISTENT, 1,
AQjmsConstants.EXPIRATION_NEVER);
q_sess.commit();
q_sess.close();
q_conn.close();
catch (Exception e)
System.out.println("Exception: " + e);
}Hi.. i'm trying to put an ADT message created using an ORA Message in the Topic. but i'm getting the conversion error!
below is the code.
* Preparing request Message
try {
requestMessage.setOsmOrderid("OSMOrderID12345");
requestMessage.setOsmEventVersion("OSMEventVersion1.0");
requestMessage.setEventType("SendOrder");
CLOB payload = CLOB.createTemporary(conn, true, CLOB.DURATION_SESSION);
Writer w= payload.setCharacterStream(1);
w.write(xml);
w.flush();
w.close();
//payload.setString(1, xml);
requestMessage.setEventPayload(payload);
} catch (SQLException se) {
System.out.println("SQL Exception Occured :" + se.getMessage());
se.printStackTrace();
} catch (IOException e) {
System.out.println("IO Exception!");
e.printStackTrace();
AdtMessage request=((AQjmsSession)session).createORAMessage(requestMessage);
System.out.println("ORA Message Created.");
request.setJMSCorrelationID("ABG");
request.setJMSMessageID("324324435435");
request.setJMSDeliveryMode(AdtMessage.DEFAULT_DELIVERY_MODE);
* Creating Sender and sending message.
TopicConnection topicConn= AQjmsTopicConnectionFactory.createTopicConnection(conn);
topicConn.start();
TopicSession topicSess= topicConn.createTopicSession(true, TopicSession.CLIENT_ACKNOWLEDGE);
Topic requestopic = ((AQjmsSession)topicSess).getTopic("BG_AQ_USER","BG_REQUEST_Q");
MessageProducer t_sender= topicSess.createProducer(requestopic);
t_sender.send(request, DeliveryMode.PERSISTENT, 1,600000);
and the error is:
java.lang.AbstractMethodError: oracle.jms.AQjmsSession.createProducer(Ljavax/jms/Destination;)Ljavax/jms/MessageProducer;
Instead of a topic connection, I tried using a AQjmsSession and instead of MessageProducer I've tried using AQjmsProducer as well... but the error persists... please help... -
Hello,
I am facing this error when creating the jms queue.
I gave unique names for queue and jndi. This error is because of what reason?
Messages
An error occurred during activation of changes, please see the log for details.
weblogic.application.ModuleException:
The proposed JNDI name eis/Jms/TopicConnectionFactory for destination SOAJMSModule!Topic-0 is already bound by another object of type weblogic.jdbc.common.internal.RmiDataSource
The JMS Queue was created successfully
There is nothing specific in log files to my knowledge.
Please revert ASAP.Hi,
i am also facing the same issue, please help and tell me what you did to resolve this.
meanwhile I am trying my best to get it up...
thanks in advance.
ABHISHEK -
Error when trying to enqueue message on to weblogic JMS queue
Hi,
I have developed a BPEL process to enqueue message on to a JMS queue in weblogic 10.3.1.BPEL process manager version is 10.1.3.4. I have referred the Oracle note 549016.1 for configuring the Jms adapter for BEA Weblogic JMS Provider.
In the invoke activity, I am getting the following error:
"Missing class: weblogic.security.acl.UserInfo
Dependent class: weblogic.jndi.WLInitialContextFactory
Loader: JmsAdapter:0.0.0
Code-Source: /D:/product/10.1.3.1/orasoa/j2ee/oc4j_soa/connectors/JmsAdapter/JmsAdapter/weblogic.jar
Configuration: <code-source> in D:\product\10.1.3.1\orasoa\j2ee\oc4j_soa\connectors\JmsAdapter\JmsAdapter
The missing class is not available from any code-source or loader in the system."
I could not find a resolution. Please provide your inputs.
Thanks.
JohnCould be this, if the above fix was by generating a wlfull client jar:
http://download.oracle.com/docs/cd/E14571_01/web.1111/e13717/jarbuilder.htm#BABCGHFH
Edited by: atheek1 on Jul 28, 2010 9:39 PM -
Hi,
I am trying to read response from JMS Queue hosted on Weblogic server and getting below exception. Any help on this will be appreciable.
weblogic.utils.AssertionError: ***** ASSERTION FAILED *****[ Environment not found on thread ]
at weblogic.jndi.internal.NamingNodeReplicaHandler.<init>(NamingNodeReplicaHandler.java:148)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:274)
at java.lang.Class.newInstance0(Class.java:308)
at java.lang.Class.newInstance(Class.java:261)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:90)
at weblogic.common.internal.ChunkedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:159)
at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:341)
at weblogic.rmi.cluster.ReplicaAwareRemoteRef.readExternal(ReplicaAwareRemoteRef.java:356)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.defaultReadObject(ObjectInputStream.java:452)
at weblogic.rmi.internal.StubInfo.readObject(StubInfo.java:95)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:324)
at java.io.ObjectStreamClass.invokeReadObject(ObjectStreamClass.java:838)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1746)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:111)
at weblogic.common.internal.ChunkedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:159)
at weblogic.common.internal.ChunkedObjectInputStream$NestedObjectInputStream.readObjectWL(ChunkedObjectInputStream.java:341)
at weblogic.jndi.internal.WLContextImpl.readExternal(WLContextImpl.java:425)
at java.io.ObjectInputStream.readExternalData(ObjectInputStream.java:1686)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1644)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.defaultReadFields(ObjectInputStream.java:1845)
at java.io.ObjectInputStream.readSerialData(ObjectInputStream.java:1769)
at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1646)
at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1274)
at java.io.ObjectInputStream.readObject(ObjectInputStream.java:324)
at weblogic.common.internal.ChunkedObjectInputStream.readObject(ChunkedObjectInputStream.java:111)
at weblogic.rjvm.ResponseImpl.getThrowable(ResponseImpl.java:117)
at weblogic.rmi.internal.BasicOutboundRequest.sendReceive(BasicOutboundRequest.java:106)
at weblogic.rmi.internal.BasicRemoteRef.invoke(BasicRemoteRef.java:127)
at weblogic.jms.dispatcher.DispatcherImpl_1035_WLStub.dispatchSyncNoTranFuture(Unknown Source)
at weblogic.jms.dispatcher.DispatcherWrapperState.dispatchSyncNoTran(DispatcherWrapperState.java:341)
at weblogic.jms.client.JMSSession.createDestination(JMSSession.java:1735)
at weblogic.jms.client.JMSSession.createQueue(JMSSession.java:1296)
ThanksHi,
I am trying to read Queue standalone. Please find the code snippet below. code highlighted in where i am getting exception.
public static void main(String[] args) {
String jmsServerUrl = "t3://10.51.245.45:5858";
String jmsUserName = "weblogic";
String jmsPassword = "welcome123";
String jndiFactory = "weblogic.jndi.WLInitialContextFactory";
String jmsFactory = "jms/CBCMReplyConnectionFactory";
String qName = "jms/CBCMOrderReplyQueue";
QueueReceiver qReciever = null;
JMSQueueReader.getQueueSession(jmsServerUrl,jmsUserName,jmsPassword,jndiFactory,jmsFactory);
qReciever = JMSQueueReader.getQueueReceiver(qName);
if (qReciever == null) {
System.out.println("Unable to find JMS Queue Reciever for Queue Name: "
+ qName + " and JMS Server URL:"
+ jmsServerUrl);
//isProcess = false;
private static InitialContext getInitialContext(String url, String userName, String password, String jndiFactory) throws NamingException {
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY, jndiFactory);
env.put(Context.PROVIDER_URL, url);
env.put(Context.SECURITY_PRINCIPAL, userName);
env.put(Context.SECURITY_CREDENTIALS, password);
return new InitialContext(env);
public static QueueReceiver getQueueReceiver(String qName) {
try {
if(qReceiver == null || !qName.equals(queueName))
queueName = qName;
if(qReceiver != null)
qReceiver.close();
qReceiver = null;
javax.jms.Queue queue = qSession.createQueue(queueName);
//qReceiver = qSession.createReceiver(queue);
qReceiver = qSession.createReceiver(queue, "JMSCorrelationID LIKE '"+SOHConstant.CBCM_BSCS_CORRELATION_ID_PREFIX+"%'");
} catch (Throwable e) {
e.printStackTrace();
return qReceiver; -
NoClassDefFoundError while accessing JMS Queue from JDev 10.1.3.3
Hi,
I'm trying to get a handle of a JMS queue, which resides on Oracle App Server 10.1.3.4, from a Java Program which I'm trying to run from JDeveloper 10.1.3.3.
I'm trying to make an RMI connection to the App server from JDeveloper by passing following information to the intialContext:
env.put("java.naming.factory.initial",
"oracle.j2ee.rmi.RMIInitialContextFactory");
env.put(Context.PROVIDER_URL,
"ormi://wafedabpelqa10.corp.weyer.pri:12402");
env.put("java.naming.security.principal","oc4jadmin");
env.put("java.naming.security.credentials","welcome1");
Where the above information is related to our App Server.
I'm successfully able to establish an RMI connection from JDev to Oracle App Server and can lookup datasources created on the App server using their
JNDI names. However if I try to look up a JMS Queue from the App server using its JNDI name, I get an error as:
java.lang.NoClassDefFoundError: oracle/tip/adapter/api/OracleConnectionFactory
I have also tried to use the value "com.evermind.server.rmi.RMIInitialContextFactory" for "java.naming.factory.initial",
however I still get the same error.Hi,
this should work and you need to download the rmi library http://www.oracle.com/technology/software/products/ias/htdocs/utilsoft.html
thanks
# String queueName = "jms/MyJMSQueue";
# String queueConnectionFactoryName = "jms/MyJMSQCF";
# Context ctx;
# try {
# Properties parm = new Properties();
# parm.setProperty("java.naming.factory.initial","com.evermind.server.rmi.RMIInitialContextFactory");
# parm.setProperty("java.naming.provider.url","ormi://localhost:23791/");
# parm.setProperty("java.naming.security.principal","oc4jadmin");
# parm.setProperty("java.naming.security.credentials","welcome");
# ctx = new InitialContext(parm);
# QueueConnectionFactory connectionFactory =
# (QueueConnectionFactory)ctx.lookup(queueConnectionFactoryName);
# connection = connectionFactory.createQueueConnection();
# connection.start();
# session = connection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
# queue = (Queue)ctx.lookup(queueName);
# sender = session.createSender(queue);
# receiver = session.createReceiver(queue);
# } catch (JMSException je) {
# throw new RuntimeException("Fout opgetreden bij het starten ",
# je);
# } catch (Throwable t) {
# throw new RuntimeException("Fout opgetreden bij het starten ",
# t);
# } -
Defining/Creating a JMS Queue in XI
Scenario: Third party system would post messages in XI Jms queue, the messages would ultimately be sent to SAP.
Need to create this JMS queue in XI which receives Jms messages from third party.
Steps done:
1) Defined Sender Communication Channel 'CC_JMS'
JNDILookup name:jmsfactory/default/QueueConnectionFactory
JMSQueue:jmsqueues/default/JMS_queue
initialcontextfactory:com.sap.engine.services.jndi.InitialContextFactoryImpl
JNDIServerAddress:<<serverIP>>:50004
2)Defined sender ID for the outbound interface in SXMSIF
3) Added job(I've given the name, is it right?) in SXMb_Adm and Defined message filter for that job. activated.
4)configured message filter for the above sender ID. Queue name XBT1
5)when checked in adapter monitor for JMS_queue.Shows the following error message
CC_JMS : Sender channel. Details: Object not found in lookup of JMS_Queue.
Questions:
1)Is that the right approach i am following
2)How do i assign CC_JMS to JMS_queue
3)How do i know if JMS_queue is up and running
thnx
sunilHi Sunil,
Please take a look at these..
http://help.sap.com/saphelp_erp2005/helpdata/en/bc/996b908db7485fabbacb9930714d7e/frameset.htm -- Queue sender and reciever
http://help.sap.com/saphelp_erp2005/helpdata/en/f4/2d6189f0e27a4894ad517961762db7/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/90/57849e5e3e45d784afc4e3bfa8136f/frameset.htm
http://help.sap.com/saphelp_erp2005/helpdata/en/c1/739c4186c2a409e10000000a155106/frameset.htm
Hope they help!
cheers,
Prashanth
P.S Please mark helpful answers -
Can anyone help me on this error:
Serverjava.lang.ClassCastException: com.evermind.server.jms.EvermindConnectionFactory
I got the above exception while trying to connect to JMS server (in OC4J 9.0.4) with the following code:
ctx = new InitialContext();
qconFactory = (QueueConnectionFactory) ctx.lookup("jms/ConnectionFactory");
I am using standard jms Queue interfaces and classes.
This is the jms.xml setup in OC4J 9.0.4:
<queue name="Locker"
location="Locker">
<description>Queue for DB Lock</description>
</queue>
<queue-connection-factory
name="jms/QueueConnectionFactory"
location="jms/QueueConnectionFactory" />Sorry. It is my mistake.
I used the wrong name of JMS connection factory:
qconFactory = (QueueConnectionFactory) ctx.lookup("jms/ConnectionFactory");
It should be like this:
qconFactory = (QueueConnectionFactory) ctx.lookup("jms/QueueConnectionFactory");
Because my jms.xml setting is using :
<queue-connection-factory name="QueueConnectionFactory"
location="jms/QueueConnectionFactory"/> -
JMS-204: An error occurred in the AQ JNI layer
Approach 1) works fine but not 2).
Approach 1
=================
// Use the DriverManager to get the DB Connection
DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
java.sql.Connection dbConnection = DriverManager.getConnection("the url" , "the uid", "the pwd");
javax.jms.QueueConnection queueConnection = AQjmsQueueConnectionFactory.createQueueConnection( dbConnection );
Approach 2 (doesn't work)
=================
// Use the JNDI Lookup to get the DB Connection
Context ctx = get the context;
DataSource dataSource = (DataSource)ctx.lookup("datasoruce jndi");
dbConnection = dataSource.getConnection();
queueConnection = AQjmsQueueConnectionFactory.createQueueConnection( dbConnection );
Please note that I'm able to get the Queue Connection. But when I try to send the message, I get the exception.
Exception: JMS-204: An error occurred in the AQ JNI layer
Linked Exception: weblogic.rmi.extensions.RemoteRuntimeException: Unexpected Exception - with nested exception:
[java.rmi.MarshalException: failed to marshal setORAData(ILoracle.sql.ORAData;); nested exception is:
java.io.NotSerializableException: oracle.jms.AQjmsTextMessage_C]
App Server: WebLogic 8.1
Any thougts...
Thanks in advance.It is complaining about the AQjmsTextMessage not being serialized. I have seen errors with not using the actual oracle connection directly. Usually the datasource has some wrapper database connection. However, i would expect a different error. I will have to experiment with this.
-
How to Run a simple program using JMS Queue.!!
Hi All,
I am trying to run simple program on JMS Queue.
Using SOA Suite 10.1.3.2
I created a connection factory and queue using EM.
Connection Factory => Domain : Queue JNDI Location : jms/sidConnectionFactory
Queue Name : SidQueue JNDI Location : jms/SidQueue
Tried running a simple java class to send the messages to queue.[Pls find the file attached].
Getting this error
javax.naming.NamingException: META-INF/application-client.xml not found (see J2EE spec, application-client chapter for requirements and format of the file)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getRequiredClasspathResource(ApplicationClientInitialContextFactory.java:239)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getArchive(ApplicationClientInitialContextFactory.java:161)
at oracle.j2ee.naming.ApplicationClientInitialContextFactory.getInitialContext(ApplicationClientInitialContextFactory.java:111)
at javax.naming.spi.NamingManager.getInitialContext(NamingManager.java:667)
Can some one tell me how i need to create this file and where to place this[i.e is this need to be placed in my project or some directory structure of <SOA-HOME>
Thx,
Siddhardha.
Code:
package demo;
import java.io.IOException;
import java.io.PrintWriter;
import java.util.Properties;
import javax.jms.*;
import javax.naming.*;
import javax.servlet.*;
import javax.servlet.http.*;
public class JMSQueue {
public static void main(String args[])
QueueConnection queueConnection;
QueueSession queueSession;
//private MessageProducer producer;
QueueSender queueSender;
try {
String message = "Test";
String connectionFactoryName = "jms/sidConnectionFactory";
String destinationName = "jms/SidQueue";
/*Do i need to use this .......
* If so where is the error in below statements...
* Properties env = new Properties( );
// ... specify the JNDI properties specific to the vendor
env.put(Context.SECURITY_PRINCIPAL, "admin");
env.put(Context.SECURITY_CREDENTIALS, "welcome");
env.put(Context.INITIAL_CONTEXT_FACTORY,
"com.evermind.server.ApplicationClientInitialContextFactory");
env.put(Context.PROVIDER_URL,
"ormi://localhost:23791");
Context ctx = new InitialContext();
// Get the connection factory.
QueueConnectionFactory cf = (QueueConnectionFactory)ctx.lookup(connectionFactoryName);
// Get the destination.
Queue destination = (Queue) ctx.lookup(destinationName);
// Use the connection factory to create a connection.
queueConnection = cf.createQueueConnection();
// Start the connection.
queueConnection.start();
// Use the connection to create a session.
queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
// Use the session and destination to create a message producer and a message consumer.
//producer = queueSession.createProducer(destination);
queueSender = queueSession.createSender(destination);
TextMessage msg = queueSession.createTextMessage(message);
queueSender.send(msg);
queueSession.close();
queueConnection.close();
catch (Exception ex) {
ex.printStackTrace();
* Attached following libraries to the Project
* jms.jar
* optic.jar
* oc4jclient.jar
*/Hi,
You need to change the INITIAL_CONTEXT_FACTORY to com.evermind.server.RMIInitialContextFactory.
Regards,
Sandeep -
I want to access JMS Queue in websphere from a client application
Hello all
I tried to access a jms queue in the websphere from a client application
my connection factory jndi name is : MyConn
my queue name jndi name is : MyQueue
and here is my code :
Hashtable environment = new Hashtable();
environment.put(Context.INITIAL_CONTEXT_FACTORY,
"com.ibm.websphere.naming.WsnInitialContextFactory");
environment.put(Context.URL_PKG_PREFIXES, "com.ibm.ws.naming");
environment.put(Context.PROVIDER_URL, "corbaloc:iiop:localhost:2809");
return new InitialContext(environment);
then:
q = (Queue) ctx.lookup(QJNDIName);
QueueConnectionFactory connFactory = (QueueConnectionFactory)
ctx.lookup(ConnFactName);
I had the following exception :
javax.naming.NameNotFoundException: Context: networking/nodes/networking/servers/server1, name: MyQueue: First component in name MyQueue not found. Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0
Can i have any help please ....Hi
You are missing some critical jar files in your class path. It should be namingclient.jar, also please or something similar that is missing in classpath.
HTH
VJ
Maybe you are looking for
-
Why can't I use my previous MobileMe email address instead of creating a new one?
Why can't I use my previous MobileMe email address instead of creating a new one? When signing up for iCloud I'm asked to choose an email address [email protected] I am already using an @me address via moblileme. When i input that address it state
-
How to connect iphone's blue tooth wiht Lap Top computer?
I just new;y buy a iPhonr5 I tried to connect the blue tooth with my Lap Top but is unable to paired it
-
I have a form that has two pages: the form itself, and an action page. The form consists of text boxes, radio buttons, and a place to attach a document. On the action page I have used cffile to save the file to the server, which it does correctly, an
-
Package in group base containing systemd?
Hi, I'm building an install CD to install an ArchLinux system with openrc. As a first attempt I just wrote a script removing all the systemd-stuff and installing openrc. However I'm not happy with it, because why install all the stuff just to remove
-
Where is the download for swing documentation
I looked at friends computer once, and he had downloaded some support documentation in regards to all the classes,constructors, methods etc, of the the java swing libraries. The list of these things was in a folder named "doc" after the download was