-
1. Re: getting OIL error when using JVMServerILService
adrian.brock Apr 22, 2003 3:49 PM (in response to cconnelly)Show the code you use to get the connection
Regards,
Adrian -
2. Re: getting OIL error when using JVMServerILService
cconnelly Apr 22, 2003 4:01 PM (in response to cconnelly)public Object invoke(Object[] args)
throws NamingException, JMSException, Throwable {
log.debug("JMSInvocationConnector.invoke()");
// initialize MethodInvocation
String methodName = "invoke";
MethodInvocation mi = new MethodInvocation();
mi.setMethodName(methodName);
mi.setParams(args);
ObjectMessage msg = null;
int ack = Session.AUTO_ACKNOWLEDGE;
log.debug("JMSInvocationConnector.constructor:queue");
QueueConnectionFactory factory = null;
try {
ctx = new InitialContext();
factory = (QueueConnectionFactory) ctx.lookup("ConnectionFactory");
queue = (Queue) ctx.lookup("queue/primaryMBeanQueue");
} catch (NamingException e) {
log.error("JMSInvocationConnector.constructor: naming exception");
throw e;
}
log.debug("JMSInvocationConnector.looking up queue and send");
try {
connect = factory.createQueueConnection();
queueSession = connect.createQueueSession(false, ack);
sender = queueSession.createSender(queue);
connect.start();
sender = queueSession.createSender(queue);
msg = queueSession.createObjectMessage(mi);
sender.send(msg);
sender.close();
} catch (JMSException e) {
log.error("JMSInvocationConnector.JMSException:" + e.getMessage());
} finally {
if (connect != null) {
try {
connect.close();
} catch (JMSException e) {
log.error("JMSInvocationConnector.JMSException:" + e.getMessage());
}
}
}
return null;
} -
3. Re: getting OIL error when using JVMServerILService
cconnelly Apr 22, 2003 6:02 PM (in response to cconnelly)Figured it out, I was using the wrong JNDI name to connect to the ConnectionFactory. Thanks for leading me in the right direction, I thought that the Invocation Layer was purely a JMS configuration issue.
-
4. Re: getting OIL error when using JVMServerILService
adrian.brock Apr 22, 2003 9:29 PM (in response to cconnelly)For others it should be
factory = (QueueConnectionFactory) ctx.lookup("java:/ConnectionFactory");
Even better is
factory = (QueueConnectionFactory) ctx.lookup("java:/JmsXA");
since that uses JCA to link into the EJB transaction.
Regards,
Adrian -
5. Re: getting OIL error when using JVMServerILService
cconnelly Apr 23, 2003 4:45 PM (in response to cconnelly)"java:/JmsXA" does this help avoid potential deadlock when the queue listener accesses entity beans.
-
6. Re: getting OIL error when using JVMServerILService
adrian.brock Apr 23, 2003 6:33 PM (in response to cconnelly)? Not sure what this has to do with entity
deadlocks.
A deadlock is due to access in different orders.
Thread1
lock A
Thread2
lock B
Thread1
try to lock B and wait
Thread2
try to lock A and wait
Both will timeout unless the deadlock is detected
and broken earlier.
Regards,
Adrian