This week's book giveaway is in the Spring forum.
We're giving away four copies of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 and have Marten Deinum & Iuliana Cosmina on-line!
See this thread for details.
Win a copy of Pro Spring MVC with WebFlux: Web Development in Spring Framework 5 and Spring Boot 2 this week in the Spring forum!

Premkumar Mudaliar

Greenhorn
+ Follow
since Jul 30, 2003
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Premkumar Mudaliar

The following code is a simple JMS Sender that works fine when executed in command prompt locally
i.e in the system where the server is installed. However the same code doesnt work when executed from
inside a jsp in the server itself.
Context jndiContext = null;
QueueConnectionFactory queueConnectionFactory = null;
QueueConnection queueConnection = null;
QueueSession queueSession = null;
Queue queue = null;
QueueSender queueSender = null;
ObjectMessagemessage = null;
String queueName = "jms/PaymentsQueue_Queue";
java.util.Hashtable env = new java.util.Hashtable();
env.put(javax.naming.Context.INITIAL_CONTEXT_FACTORY, "com.sun.enterprise.naming.SerialInitContextFactory");
env.put(javax.naming.Context.PROVIDER_URL,"orb://cspl-pc-75:1050");
env.put(javax.naming.Context.SECURITY_PRINCIPAL, "");
env.put(javax.naming.Context.SECURITY_CREDENTIALS, "");
jndiContext = new InitialContext(env);
queueConnectionFactory = (QueueConnectionFactory)jndiContext.lookup("jms/QueueConnectionFactory");
queue = (Queue) jndiContext.lookup(queueName);
queueConnection = queueConnectionFactory.createQueueConnection();
queueSession = queueConnection.createQueueSession(false, Session.AUTO_ACKNOWLEDGE);
queueConnection.start();
queueSender = queueSession.createSender(queue);
message = queueSession.createObjectMessage();
System.out.println("Sending message");
queueSender.send(message);
queueConnection.close();
I tried using iiop and rmi as well. It would give the same InvocationException. I am using j2sdkee1.4. I think something is wrong with the jms settings in the server. Please suggest me if u have already come across a problem similar to this.
Hi,
I have a durable subscriber program which is not able to receive any messages asynchronously. A new topic connection factory was defined in the jms.xml which was used instead of the default one. The server being used is Oracle9iAS (1.0.2.2.1). Following is the code for durable subscriber.
topicConnection = topicConnectionFactory.createTopicConnection();
topicConnection.setClientID("101");
topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
topicSubscriber = topicSession.createDurableSubscriber(topic, "SUB1");
topicConnection.stop();
topicListener = new TextListener();
topicSubscriber.setMessageListener(topicListener);
topicConnection.start();
This works fine if the subscriber is active while the publisher sent the messages but when the subscriber program is stopped and publisher is made to send the message, after restarting the subscriber program, no messages are received. Is something wrong with the code or with the orion server itself. I also tried executing the DurableSubscriberExample program given in the JMS tutorial but that also didnt work. Please let me know the solution.
17 years ago
Hi,
I hava a durable subscriber program which is not able to receive any messages asynchronously. A new topic connection factory was defined in the jms.xml which was used instead of the default one. The server being used is Oracle9iAS (1.0.2.2.1). Following is the code for durable subscriber.
topicConnection = topicConnectionFactory.createTopicConnection();
topicConnection.setClientID("101");
topicSession = topicConnection.createTopicSession(false, Session.AUTO_ACKNOWLEDGE);
topicSubscriber = topicSession.createDurableSubscriber(topic, "SUB1");
topicConnection.stop();
topicListener = new TextListener();
topicSubscriber.setMessageListener(topicListener);
topicConnection.start();
This works fine if the subscriber is active while the publisher sent the messages but when the subscriber program is stopped and publisher is made to send the message, after restarting the subscriber program, no messages are received. Is something wrong with the code or with the orion server itself. I also tried executing the DurableSubscriberExample program given in the JMS tutorial but that also didnt work. Please let me know the solution.