JAVA/JMS/Tandem
Hi all
This is a question based on JMS that how i can make use of JMS in the below mentioned scenario.
I have a java client(servlet or EJB)talking with tandem server through remote server call packages and .dll's.
Question is the tandem server programs wants to inform java client a status change(asynchronous,i mean with out request from user)
which has occured in tandem
Will this can get done thro JMS technology.Can a native program(here Remote Server package RSC) make use of JMS.
the flow iam assuming is like this
TANDEM ---->RemoteServer Package/DLLS(C language) -->JMS --->JAVA CLIENT ----->Web client(browser).
Environment is iAS 6.0 as app server with jdk1.2.2 .
Can anybody give some suggestions /help.Thanks in advance
Sankaran
Thanks for the response.
Is this what you mentioned.
TANDEM ---->(RSC)RemoteServer Package/DLLS(C language)---->JAVA CLASS WITH JNI method calls(BRIDGE)---->JMS --->JAVA CLIENT ----->Web client(browser).
Assuming that when ever a status change in the tandem server program,the tandem server prog
will talk with RSC(will find out some mechanisam to make available of status change from tandem server to RSC with out user request) and the status will be available on BRIDGE class,which will send the status message to JMS Queue.
This can be accessed by the Java client and shown to the browser.
Will this be okey.Thanks
Regards Sankaran
Similar Messages
-
Dequeuing a Map message from AQ using Java/JMS
I have a queue in Oracle AQ, created from a queue table with queue_payload_type of SYS.AQ$_JMS_MAP_MESSAGE. I can successfully enqueue a Map message using PL/SQL, but when I try to read a message from the queue using the JMS API (with the Oracle AQ JMS provider JARs) in a standalone Java program, the message is not successfully read. However, the RETRY_COUNT in the queue table is incremented each time I try to read from the queue. I do not receive any error messages on the client side.
If I change the queue_payload_type of the queue table to SYS.AQ$_JMS_TEXT_MESSAGE instead and enqueue a text message using PL/SQL, I can read the text message successfully in the standalone Java program using JMS. The message is removed from the queue and everything works fine.
Most Oracle AQ/JMS examples I've found on the web involve text messages. Has anyone been able to read a Map message from an Oracle AQ queue using JMS, or is there a known issue with Map messages?
I'm running Oracle 10g Standard Edition version 10.2.0.1.0 on Windows XP.
Thanks for your help,
MartyWhile you are awaiting an answer you might want to consider applying the 10.2.0.4 patch. Your version is several years old and patches are free.
-
Using Oracle Java JMS to write CLOB into an AQ payload
Does anyone have an example of code in JAVA using Oracle JMS
enqueues a CLOB object into AQ ?i am not sure how this is done for javascript, but for PHP, the code looks like this:
var ldr:URLLoader = new URLLoader();
var req:URLRequest = new URLRequest("http://example.com/example.php");
req.method = URLRequestMethod.POST //or GET, or whatever you want
var tmp_data:URLVariables = new URLVariables();
tmp_data.example_var = "whatever";
req.data=tmp_data;
ldr.load(req);
I suppose it would work kind of the same for JS. -
Hello
Does anyone know any good step by step guide or what ever, to set up Orion 2.0.7 working as a JMS servlet client towards Sun Application Server 9.1?
I've already have developed a code-snippet for placing an retrieving messages from the MQ-box (remote btw), and runs smooth from commandline.
However,,, when trying to apply the code into Orion, I get a whole world of issues.
Tried most adapters I can think off, and everything seems to freeze when calling the InitialContextFactory for setup.
I've tried the following:_
MARK:removed real IP with ???.???.???.???:3700
String useTestNr = "1";
String factory = "";
String providerURL = "";
String pkgs = "";
String state = "";
if(useTestNr.equals("1")){ /*** STATUS = freezes up */
// TEST 1
factory = "com.sun.enterprise.naming.SerialInitContextFactory";
providerURL = "iiop://???.???.???.???:3700;
pkgs = "com.sun.enterprise.naming";
state = "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl";
if(useTestNr.equals("2")){ /*** STATUS =freezes on text: "INFO: sumOfAllWeights = 10" */
// TEST 3
factory = "com.sun.appserv.naming.S1ASCtxFactory";
//providerURL = "iiop://???.???.???.???:3700";
providerURL = "corbaname:iiop:???.???.???.???:3700";
pkgs = "com.sun.enterprise.naming";
state = "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl";
if(useTestNr.equals("3")){ /*** STATUS = javax.naming.NameNotFoundException [Root exception is org.omg.CosNaming.NamingContextPackage.NotFound: IDL:omg.org/CosNaming/NamingContext/NotFound:1.0] */
// TEST 2
factory = "com.sun.jndi.cosnaming.CNCtxFactory";
providerURL = "iiop://???.???.???.???:3700";
pkgs = "com.sun.enterprise.naming";
state = "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl";
if(useTestNr.equals("4")){ /*** STATUS = Server protocol was not ORMI. Sun app server aint got ORMI right??*/
// TEST 4
factory = "com.evermind.server.rmi.RMIInitialContextFactory";
providerURL = "iiop://???.???.???.???:3700";
pkgs = "com.sun.enterprise.naming";
state = "com.sun.corba.ee.impl.presentation.rmi.JNDIStateFactoryImpl";
System.setProperty("java.naming.factory.initial", factory);
System.setProperty("java.naming.factory.url.pkgs",pkgs);
System.setProperty("java.naming.factory.state", state);
System.setProperty("org.omg.CORBA.ORBInitialHost", mqServer);
System.setProperty("org.omg.CORBA.ORBInitialPort", mqServerPort);
System.setProperty(Context.PROVIDER_URL, providerURL);
System.out.println("--Adding System.props to IntialContext()...--");
context = (Context) (new InitialContext()); // ALLWAYS freezes here on Orion
{code}
I've tried the:
{code}
Hashtable env = new Hashtable();
en.put(......)
context = (Context) (new InitialContext(env))
{code}
as well, but gets the same results
Allso tried different versions of iiop, ormi etc, but never seem to get quite "there"
Please please advice,,,been struggling with this the last month
Cincerely PaulHi,
Assuming
- you have got UDQ's
- JMS client also working in a clustered fashion i,e not a singleton JMS client.
-JMS client not connected to specific UDQ instance
- JMS client has got 'all' message selectors on ( and not just a few selectors on..)
As soon as a message arrives on the UDQ instance . you JMS client should be able to apply message selector and read the message from the queue as long as it matches the selection.
have you got your client consuming only specific types on messages or not consuming any messages at all ?
Sri -
Java JMS API vs. RAC FCF features
Hello,
I have a JAVA application with queue consumer using the JMS API (JMS text message is the queue payload). On the other hand, I'd like to take advantage of the FCF: to use UCP with FCF enabled as the data source. When the physical connection to the DB fails, I'd like to reconnect and reestablish the queue consumer functionality. But I don't know, how to invent the JDBC connection is broken? In the JMS API I have only javax.jms.QueueConnection (or oracle.jms.AQjmsConnection actually). From that object, I don't have access to the Connection object. The FCF standard way to verify the connection is:
((oracle.ucp.jdbc.ValidConnection)conn).isValid()
But this may be done with conn as Connection object. How can I do connection validation having AQjmsConnection object only?
Any help appreciated, thanks in advance.Finally I found the answer by myself :)
The db connection object may be obtain from the queue session object: AQjmsSession.getDBConnection()
BR,
Kuba -
Hey there
Been struggeling all day + yesterday on how to store a pdf-message into a (Glassfish) jms queue from a Replier-class, and then to retreive it in a Requestor class.
The scenario:
Requestor---sends file to jms/RequestQueue-->
Replier----processes the file-->
Replier---sends pdffile to jms/ReplyQueue-->
Rquestor---retreives jms/RequestQueue and sends it to a browser->
My issue is.
The Replier
String fil = "C:/PDFTEST/"+pdffile+".PDF";
File file = new File(fil);
ObjectMessage outMessage = session.createObjectMessage();
outMessage.setObject(file);
outMessage.setJMSCorrelationID(message.getJMSCorrelationID());
replyProducer.send(outMessage);Everything seems to work from Requestor send to MQ, The Replier above gets the file to process, and to store the File as a ObjectMessage in MQ...But, when the Replier gets the file from MQ it can't get it out as a java.io.File.
ErrorCode:
java.lang.NullPointerException
at com.edbteamco.common.servlet.OnlineFaktura.invoiceGET(OnlineFaktura.java:273)
at com.edbteamco.common.servlet.OnlineFaktura.doGet(OnlineFaktura.java:108)The RequestorCode:
queueConnection.start();
QueueReceiver queueReceiver = queueSession.createReceiver(repQueue, "JMSCorrelationID = '" + jmsCorrelationID + "'");
msgReceived = (ObjectMessage) queueReceiver.receive(10000);
response.setContentType ("application/pdf");
response.setHeader ("Content-Disposition", "attachment; filename=\"testfilen.txt\"");
response.setHeader("cache-control", "no-cache");
InputStream in = new FileInputStream((File)message.getObject()); the line **InputStream in = new FileInputStream((File)message.getObject()); ** causes the error
Anyone up for helping?:)Yes, he gave me the solution, but not how to implement it. I think the documentation is not verry good when it comes to handling files through jms.
I've now tried the following:
InputStream is = new FileInputStream(new File(".....filelocation....."));
long length = file.length();
byte[] bytes = new byte[(int)length];
int offset = 0;
int numRead = 0;
while (offset < bytes.length && (numRead=is.read(bytes, offset, bytes.length-offset)) >= 0)
offset += numRead;
BytesMessage outMessage = session.createBytesMessage();
outMessage.setJMSCorrelationID(message.getJMSCorrelationID());
outMessage.writeBytes(buffer);
replyProducer.send(outMessage);And when I try to open that file up on my client, I get a nullPointerException:
msgReceived = (BytesMessage) queueReceiver.receive(10000);
// How to read the bytes right???
ServletOutputStream outs = response.getOutputStream();
while (true)
try {
byte b = ((BytesMessage)message).readByte();
outs.write((int)b);
System.out.println("Byte: " + (int)b);
catch (MessageEOFException e) {
break;
Please help
Cincerely Paul -
ReplyTo header field from Java JMS read by C JMS API causes core dump...
Hi,
First step is to add the option -Xcheck:jni to your java command line. It will flag common JNI errors.
If that doesn't identify the problem, then compile your jni code with debugging symbols (-g) and add the following option to the java command line when you run your test: -XX:+ShowMessageBoxOnError. When you hit the problem again, the VM will keep the process alive instead of calling abort(). Then you can use dbx to attach to the live process and should be able to get a better idea of what went wrong. -
Jms java application poin to point
Hi,
I have simple java jms application ,when i execute
queueSender.send(message);
i get following erroe
java.lang.NoSuchMethodError: com.ibm.mq.MQMsg2.resetReplyToQueueName()V
at com.ibm.mq.jms.MQJMSMessage.writeMQMD(MQJMSMessage.java:1202)
at com.ibm.mq.jms.MQJMSMessage.write(MQJMSMessage.java:1008)
at com.ibm.mq.jms.MQQueueSender.sendInternal(MQQueueSender.java:732)
at com.ibm.mq.jms.MQQueueSender.send(MQQueueSender.java:232)
at com.ibm.mq.jms.MQQueueSender.send(MQQueueSender.java:265)
at com.jms.PtpSender.main(PtpSender.java:67)
Exception in thread "main"
could anybody help what does this meanHi,
I am using WEBSPHERE MQSERIES VERSION 5.3 WHICH BUNDLES MA88 WHICH WE USED TO IN EARLIER VERSION -
Error :- while accessing JMS topic messages in Design Studio
Hi,
Am getting this error while clicking update button in Design Studio to populate a dataobject using JMS Topic messages sent by oracle Bpel manager.
IMessageSourceReceiver->messageReceive: javax.naming.NoInitialContextException: Cannot instantiate class: oracle.j2ee.rmi.RMIInitialContextFactory. Root exception is java.lang.ClassNotFoundException: oracle.j2ee.rmi.RMIInitialContextFactory
Can you tell me where to find the class and how to use it to resolve the problem?
P.S:-
If you can provide any document how oracle BPEL process manager use JMS topic to send message to Oracle BAM and display in reports.
Thanks in advance
Cheers,
Praveen G
iSOFT R& D Pvt Ltd.
[email protected]Hi,
We are using BAM 10.1.3 against BPEL 10.1.2 and we cannot get it to work.
We are also getting the error "javax.naming.NoInitialContextException: Cannot instantiate class: oracle.j2ee.rmi.RMIInitialContextFactory...." .
Our startup paramters for Enterprise Source “Oracle (AS JMS and OJMS) looks like this:
JMS*".;C:\OracleBAM\OC4J\j2ee\home\lib\jms.jar;C:\OracleBAM\OC4J\j2ee\home\lib\jndi.jar;C:\OracleBAM\OC4J\j2ee\home\oc4j.jar;C:\OracleBAM\OC4J\j2ee\home\oc4jclient.jar;C:\OracleBAM\OC4J\j2ee\home\lib\oc4j-internal.jar;C:\OracleBAM\OC4J\j2ee\home\lib\ejb.jar;C:\OracleBAM\OC4J\j2ee\home\lib\servlet.jar;C:\OracleBAM\OC4J\j2ee\home\lib\jta.jar;C:\OracleBAM\OC4J\j2ee\home\lib\jms.jar;C:\OracleBAM\OC4J\j2ee\home\lib\javax88.jar;C:\OracleBAM\OC4J\j2ee\home\lib\javax77.jar;C:\OracleBAM\OC4J\j2ee\home\lib\jmxri.jar;C:\OracleBAM\OC4J\j2ee\home\lib\jmx_remote_api.jar;C:\OracleBAM\OC4J\j2ee\home\lib\adminclient.jar;C:\OracleBAM\OC4J\j2ee\home\ojspc.jar;C:\OracleBAM\OC4J\j2ee\home\jazn.jar;C:\OracleBAM\OC4J\opmn\lib\optic.jar;C:\OracleBAM\OC4J\rdbms\jlib\aqapi.jar;"".;c:\TIBCO\JMS\clients\java\tibjms.jar;c:\TIBCO\JMS\clients\java\jms.jar;c:\TIBCO\JMS\clients\java\jndi.jar;c:\TIBCO\JMS\clients\java\jta-spec1_0_1.jar;c:\TIBCO\JMS\clients\java\jcert.jar;c:\TIBCO\JMS\clients\java\jnet.jar;c:\TIBCO\JMS\clients\java\jsse.jar;c:\TIBCO\JMS\clients\java\tibcrypt.jar;"".;C:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mq.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\com.ibm.mqjms.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\connector.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jms.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jndi.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\jta.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\providerutil.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\fscontext.jar;C:\Program Files\IBM\WebSphere MQ\Java\lib\ldap.jar;"".;C:\Program Files\SonicSoftware\SonicMQ\lib\sonic_Client.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\gnu-regexp-1.0.6.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\jaxp.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\xerces.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\tools.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\providerutil.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\fscontext.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\sslj.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\jsafe.jar;C:\Program Files\SonicSoftware\SonicMQ\lib\certj.jar;"".;C:\bea\weblogic700\server\lib\weblogic.jar;"".;C:\eGate\client\classes\stcjms.jar;C:\eGate\client\JRE\1.3\lib\ext\fscontext.jar;C:\eGate\client\JRE\1.3\lib\ext\providerutil.jar;C:\eGate\client\ThirdParty\sun\jms.jar;C:\eGate\client\ThirdParty\sun\jndi.jar;C:\eGate\client\ThirdParty\sun\jta.jar;"".;C:\JNDI-Directory_WebMethods\fscontext.jar;C:\JNDI-Directory_WebMethods\providerutil.jar;C:\JNDI-Directory_WebMethods\javax.jms.jar;C:\Program Files\webMethods6\Broker\lib\BrokerJMS60.jar;C:\Program Files\webMethods6\common\lib\client60.jar;C:\Program Files\webMethods6\Broker\lib\xerces.jar;"
We are trying to get to our oc4j container on our BPEL server. We have the following settings on our created message sourcein BAM architect:
Initial Context Factory: oracle.j2ee.rmi.RMIInitialContextFactory
JNDI Service Provider URL: opmn:ormi://hostname:6003:OC4J_BPEL
TopicConnectionFactory Name: java:comp/resource/ojms_ipl/TopicConnectionFactories/iplerror
Topic Name: java:comp/resource/ojms_ipl/Topics/iplerror
ojms_ipl refers to the datasource on our BPEL server that is defined in application.xml.
Where is the class located?
Best regards -
How to configure for remote JMS client?
I have my own Java JMS test program for performance measurements.
I am using the JNDI and JMS provider functionality of the WebLogic 9.1 app-server but my test program is just pure JMS 1.02 sender/receiver clients - ie it is NOT part of, or deployed as a J2EE application.
SINGLE MACHINE TEST
===================
In a single machine environment I was able to
- configure a JMSServer
- configure a JMSSystemModule
- configure resources for ConnectionFactories and Queue and Topics
I then made what I believe to be a 'standalone' application module copied from some mysystemmodule-jms.xml and with that I somehow worked out how to deploy it using the weblogic.Deployer tool.
The deployment apparently set up the JNDI and my JMS client could gain access to the administered objects and do what it does.
Everything works.
TWO MACHINE TEST
================
I now have a second machine.
I want to put my JMS sender client on this new machine and I want the JMS server and JMS receiver client to be unchanged from the SINGLE MACHINE TEST.
But I really don't know quite how to proceed from here...
Do I need to install the WebLogic app-server on the sender machine or is the weblogic.jar all I need?
What is necessary configuration for JNDI access on the sender machine?
Can I in fact use my original SINGLE MACHINE server unchanged as I am hoping?
I don't think I want a "thin" client because I read that performance is impacted (and these are performance tests)
Remember this is NOT a J2EE application. There is no MDB; no client-container; no descriptors etc. Maybe that makes it more complicated - I don't know.
Sorry for such basic questions but if somebody can just point me to an appropriate example or tutorial it could save me days...
Thankyou.Hi,
My problem is on similar lines. I have an applet based UI working on RMI/t3 protocol.
I am using weblogic 9.2 as my app server.
When my applet is executed on JRE 1.5x it works fine.
But when I use JRE1.4x it gives the following exception
java.lang.NoClassDefFoundError: javax/management/InvalidAttributeValueException
at weblogic.rmi.internal.Stub.<clinit>(Stub.java:21)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:141)
at weblogic.rmi.internal.StubInfo.class$(StubInfo.java:34)
at weblogic.rmi.internal.StubInfo.<clinit>(StubInfo.java:34)
at java.lang.Class.forName0(Native Method)
I have analyzed the reason for this.
the class javax/management/InvalidAttributeValueException was included in java 1.5 and above. So JRE 1.4 does not have it.
In previous versions of weblogic this class was a part of their 'weblogic.jar' file and in weblogic 9.2 it is not a part of weblogic.jar file so when I am using JRE1.4 and weblogic 9.2 then it obviously does not find this class hence the above exception.
I tried to put this all together and made custom made client jar file incliding the necessary classes. I was able to get throght this exception only land up in following exception.
java.lang.VerifyError: class weblogic.utils.classloaders.GenericClassLoader overrides final method .
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(Unknown Source)
at java.security.SecureClassLoader.defineClass(Unknown Source)
at sun.applet.AppletClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at sun.applet.AppletClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClassInternal(Unknown Source)
at weblogic.jndi.WLInitialContextFactoryDelegate.<clinit>(WLInitialContextFactoryDelegate.java:204)
at weblogic.jndi.spi.EnvironmentManager$DefaultFactoryMaker.<clinit>(EnvironmentManager.java:26)
at weblogic.jndi.spi.EnvironmentManager.getInstance(EnvironmentManager.java:48)
at weblogic.jndi.Environment.getContext(Environment.java:307)
at weblogic.jndi.Environment.getContext(Environment.java:277)
at weblogic.jndi.WLInitialContextFactory.getInitialContext(WLInitialContextFactory.java:117)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.InitialContext.<init>(Unknown Source)
I really need to support clients using Jre 1.4 and Jre 1.5
I will really appreciate any help on this one.
Please advise.
Thank you all. -
I'm having a problem using DBMS_AQ package to dequeue a JMS message of type SYS.AQ$_JMS_TEXT_MESSAGE that was put on the queue using Java JMS API.
Both JMS header and payload return empty but if I do "select user_data" from the queue table, I can see the message.
Appreciate any helps or tips.
KimThis has been asked a lot of times - I'm not sure how my initial searching missed all of the other questions/answers related to this topic.
In our case, the solution was to:
1) Leave the queue as a sys.aq$_jms_text_message type
2) Construct a sys.xmltype object with our desired payload
3) Do a getStringVal() on the xmltype object and use that string as the payload for our queue message
- Nathan -
URGENT -- Problem in using JMS with JBOSS
Hi,
My jar file which includes my Java/JMS classes can easily be executed when I use Sun Application server, but I don't know how I can change execute the same jar file in when I switch to JBOSS. Do I need to use ants? or I can use the original jar files?
thanks,It can depends on your application, but basically in order to run JMS JBoss client application you need:
1) Set proper jndi settings, e.g. by placing jndi.properties to the root of your classpath.
2) Add some jars to your classpath from client folder of your jboss AS distribution. My latest application works well with concurrent.jar, jnp-client.jar and jbossall-client.jar on the classpath.
You can read more at http://docs.jboss.org/jbossas/guides/j2eeguide/r2/en/html/ch6.chapt.html It is valid for all the 4.x jboss versions. Check jboss samples also.
Best Regards,
Roman -
JMS adapter :MQ series : sun.io.MalformedInputException
Hi
we are using SAP XI to read file from
MQ Queues.we are getting error in our sender communication channel :
Error converting Message : sun.io.MalformedInputException
failed to get message from MQ queue Code : MQJMS2002.
till now steps taken :-
- content coversion parameters heve been cross checked.
- we have checked the data format utf-8 or 16.
- cache refreshin XI
- checked the source file format from the respective team.
- tested other interface JMS channel, with no issues in JMS driver.
- checked the MQ error code list for code MQJMS2002 type
we have gone some similar threads avaliable in sdn with respective answers... but issue still un resolved...
[JMS Error MalformedInputException]
i had used these following parameters in Module Configuration
Transform.Class
TransformContentType
xml.conversionType
xml.documentName
xml.documentNamespace
xml.fieldNames
xml.fieldSeparator
xml.processFieldNames
xml.structureTitle
xml.endSeparator
and Module Key : PlainToXML
Regards,
Ashutosh RThx Chidambaram
I am working on the point which , you have given, but one thing
we discovered that some time the file from MQ queue is readed
sucessfully,but later it is failing with the same error......
and this is random...
we are putting the same file both readed/failed ....
we activated the OS level traces and found out the error details...
#1.5#00145E9C5A91028D00000000000CC0D200044B85AFFE21CB#1208937462243#com.sap.aii.af.service.jms.WorkerImpl##com.sap.aii.af.service.jms.WorkerImpl.onException(JMSException jmsException)#J2EE_GUEST#0####f36e7330110a11dd8eb600145e9c5a91#Thread[Thread-585,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Path##Java###Entering method with ()#1#javax.jms.JMSException: MQJMS2002: failed to get message from MQ queue#
#1.5#00145E9C5A91028D00000001000CC0D200044B85AFFE2261#1208937462243#com.sap.aii.af.service.jms.WorkerImpl##com.sap.aii.af.service.jms.WorkerImpl.onException(JMSException jmsException)#J2EE_GUEST#0####f36e7330110a11dd8eb600145e9c5a91#Thread[Thread-585,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Debug#1#/Applications/ExchangeInfrastructure/AdapterFramework/Services/JMS_ROOT#Plain###onException() was called in this worker instance: com.sap.aii.af.service.jms.WorkerJMSReceiver@735cdff5#
#1.5#00145E9C5A91028D00000002000CC0D200044B85AFFE22C9#1208937462244#com.sap.aii.af.service.jms.WorkerImpl##com.sap.aii.af.service.jms.WorkerImpl.onException(JMSException jmsException)#J2EE_GUEST#0####f36e7330110a11dd8eb600145e9c5a91#Thread[Thread-585,5,SAPEngine_Application_Thread[impl:3]_Group* ##0#0#Warning#1#/Applications/ExchangeInfrastructure/AdapterFramework/Services/JMS_ROOT#Java###JMS Connection Error (Provider ErrorCode: )#1#MQJMS2002 #1.5#00145E9C5A91028D00000004000CC0D200044B85AFFE2395#1208937462244#com.sap.aii.af.service.jms.WorkerImpl##com.sap.aii.af.service.jms.WorkerImpl.onException(JMSException jmsException)#J2EE_GUEST#0####f36e7330110a11dd8eb600145e9c5a91#Thread[Thread-585,5,SAPEngine_Application_Thread[impl:3]_Group]##0#0#Debug#1#/Applications/ExchangeInfrastructure/AdapterFramework/Services/JMS_ROOT#Java###Reconnect delay is set to milliseconds (-1 = switched off)#1#1000#
Any clue from the trace..
Regards,
Ashutosh
Edited by: ashutosh rawat on Apr 25, 2008 8:19 AM -
How to read messages from mqseries continuously by java?
Hi,
I'm sending messages to the queue of MQSeries.
Here my requirement is i have to write a java/jms program that should run at the back side and check the queue for every 5 minutes for messages.If any message exists in the queue the java/jms program should read the message and display it on the console.
If anybody has idea please reply it.
thanks in advanceHi!
You have many ways. You could define a cron on a UNIX box to make sure a simple command line app connects to the queue every 5 min and uses JMS API to read the queue and do whatever you need with the messages.
http://java.sun.com/products/jms/javadoc-102a/index.html
On the other hand, unless its critical to recover messages just every 5 min., you could create an MDB. Actually this is the best solution: a Message Driven Enterprise Java Bean is just a listener over the queue reacting instantly to every message received. The way to create and configure them depends strongly on your appserver and development process: an IDE as WSAD or something like that creates them very easily. The actual problem with these ones is to properly configure them on your appserver. However, all appservers will allow you to define a 'Foreign JMS Provider' or something like that pointing to the actual MQ implementation you have and define an activation specification on which to sit your MDB.
Regards
Jorge -
Messages are not being dequed by a different connection in JMS
Scenario
There are 2 queues - Q_A and Q_B and There are 2 applications - App_1 and App_2
I am using point 2 point and java JMS
This is what I want to accomplish
App_1 queues messages to Q_A
App_2 dequeues messages from Q_A
App_2 queues messages to Q_B
App_1 dequeues messages from Q_B
But the problem I am having is that neither application can see the messages that have been queued by the other.
So even though I see the messages in the database in Q_A,
When I use QueueBrowser from App_B on Q_A to view the messages ... it is empty
But if I use QueueBrowser from App_A on the same queue Q_ A I can see the messages.
The same is true the other way round.
The queueconnection is being created usng the same db user in both apps, and the queues are owned by the same user.
please help me.
user489532Dear DAMORGAN,
Thank you for your reply and I apologise for the insufficient information. I am providing the details now. I am aware that JMS is supposed to handle my situation. And I am ableto queue and dequeue messages without problems from the same app. Its only when I am using different apps that I am having a problem. I am pasting relevant pieces of code,Please let me know if more info is needed. Thank for your help.
Oracle 10g
Weblogic 10
DDL to create Queue
BEGIN
DBMS_AQADM.CREATE_QUEUE_TABLE (
QUEUE_TABLE => 'AQ_A_QUEUE'
,QUEUE_PAYLOAD_TYPE => 'SYS.AQ$_JMS_OBJECT_MESSAGE'
,COMPATIBLE => '8.1.3'
,MULTIPLE_CONSUMERS => FALSE
DBMS_AQADM.CREATE_QUEUE(QUEUE_NAME => 'A_QUEUE',
QUEUE_TABLE => 'AQ_A_QUEUE',
MAX_RETRIES => 10,
RETRY_DELAY => 60);
DBMS_AQADM.START_QUEUE(QUEUE_NAME => 'A_QUEUE');
END;
Application A sends messages to A_QUEUE like this
//This is how I get a connection
QueueConnectionFactory queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory(getDatabaseServer(), getDatabaseSid(), getDatabasePort(), "thin");
QueueConnection qc = queueConnectionFactory.createQueueConnection(getDatabaseUser(), getDatabaseUserPassword());
qc.start();
//This is how I get the Queue
QueueSession q_sess = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
Queue aQueue= ((AQjmsSession)q_sess).getQueue(getDatabaseUser(), "A_QUEUE");
TestMsgObject jmsObj = new TestMsgObject();
//populate Test object
QueueSender qs = q_sess.createSender(aQueue )
ObjectMessage msg = q_sess.createObjectMessage(jmsObj);
msg.setStringProperty("MESSAGESOURCE", "APP_A");
qs.send(msg);
qs.close();
q_sess.commit();
//Application B has a message listener like this - TestListener
public void initialize() throws JMSException, NamingException {
QueueConnectionFactory queueConnectionFactory = AQjmsFactory.getQueueConnectionFactory(getDatabaseServer(), getDatabaseSid(), getDatabasePort(), "thin");
qc = queueConnectionFactory.createQueueConnection(getDatabaseUser(), getDatabaseUserPassword());
q_session = qc.createQueueSession(true, Session.AUTO_ACKNOWLEDGE);
aQueue = ((AQjmsSession)q_session).getQueue(getDatabaseUser(), "A_QUEUE");
qr = q_session.createReceiver(aQueue);
qr.setMessageListener(this);
qc.start();
public void onMessage(Message message) {
try {
System.out.println("Received Message XFS=" + message.getJMSMessageID());
//more processing
}catch(Exception e) {
e.printStackTrace();
The message listener is created and initialized from the init() method of a servlet that is loaded on startup.
The onMessage of the TestListener is never called.
I can see the messages in the database.
Also when I call the following code snippet from Application A - the messages are retrieved, but the same code called from application B does not give any messages.
browser = q_sess.createBrowser(MyUtil.getQueue(q_sess));
for (Enumeration messages = browser.getEnumeration(); messages.hasMoreElements() ;){
obj_message = (ObjectMessage)messages.nextElement();
System.out.println(obj_message.getJMSMessageID());
I can bounce the app server and still app B does not see the messages.
However if app B publishes messages to the queue itself, it can see those, without any problem.
As mentioned before the database user is the same for both the apps and owns the queue, and deques and enque are both enabled.
Maybe you are looking for
-
How to get a parameter from BPC and use it in ABAP program
Hello gurus! I got a problem... SAP BPC will send parameters such as year, division, category, company code and so on via script logic to SAP BW. I need to get these parameters from BPC and use them in a ABAP program as a filter. This ABAP program wi
-
well i was listening to music on my iphone and then it just stopped and now it won't come back on. i tried resetting it alot and nothing i mean nothing comes on! i tried recharging too and nothing and tried connecting it to itunes and nothing! Help
-
Conforming and Indexing Errors, Media Pending, Audio won't play in timeline
I'm working on a desktop PC which is running Windows 7 Professional 64-bit and Adobe Premiere Pro (version CS5.5). It's currently utilizing a second gen. 3.4Ghz i7 2600 processor, 16GB of 1600Mhz RAM, 64GB solid-state drive and a ASUS P8Z68-V Intel Z
-
Error 1 occurred at Invoke Node in openvi.vi
Hello, in openvi.vi, I use Invoke Node to run showchannel2.vi, I met problem about error 1. please see attachment file. This problem have been described below absolutely. Error 1 occurred at Invoke Node in openvi.vi Possible reason(s): LabVIEW:
-
Image Capture does not have a 'Devices' option
I have a new scanner and I installed the drivers. It's showing fine in Photoshop CS3 but the window for it is awkward and small and barely has any features to it (there is no selection to for Advanced either). I figured I should try to use Image Capt