Hi List, I am sending JMS messages from Oracle 9i java stored procedures to JBoss 3.2.3 message driven beans. The messages are getting sent and received OK, but after each message I get a connection exception. It appears that JBoss is not able to acknowledge the messages successfully.
the actual exception is: [org.jboss.mq.il.oil.OILClientIL] Cannot connect to the ConnectionReceiver/Server java.net.ConnectException: Connection refused: connect ...(stack trace removed) And it's nested inside: [org.jboss.mq.il.oil.OILServerILService] Connection failure (3). org.jboss.mq.SpyJMSException: Could not pong; - nested throwable: (java.rmi.RemoteException: Cannot connect to the ConnectionReceiver/Server) ...(stack trace removed) I did a tcpdump on the conversation, and what appears to happen is that the Oracle box sends a FIN (which is ACKnowledged by the JBoss box) but JBoss attempts to send more data, to which the Oracle box responds - quite reasonably - with RST. In order to get Oracle's Java Stored Procedures to talk JMS to my JBoss server, I had to load the jbossall-client.jar classes into Oracle. Because the Oracle 9i Java environment doesn't completely support J2EE, I had to use a resolver of "((* PUBLIC) (* -))" which means that classes that reference missing classes still load, but throw runtime exceptions if you try to access the missing classes. This hasn't stopped JMS working. My java stored procedure looks like this: public static void troubleTicket(String pk) throws Exception { if (connection == null) { connect(); } try { TextMessage message = session.createTextMessage("INV: " + pk); publisher.publish(message); } catch (JMSException jmse) { try { connection.stop(); } catch (JMSException jmse1) { } try { connection.close(); } catch (JMSException jmse2) { } try { connect(); } catch (Exception e1) { } TextMessage message = session.createTextMessage("INV: " + pk); publisher.publish(message); } } private static synchronized void connect() throws Exception { Hashtable environment = new Hashtable(); environment.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory"); environment.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces"); environment.put("java.naming.provider.url", "jnp://jboss-box:1099"); InitialContext ctx = new InitialContext(environment); Topic topic = (Topic)ctx.lookup("topic/cacheInvalidationTopic"); TopicConnectionFactory tcf = (TopicConnectionFactory)ctx.lookup("ConnectionFactory"); connection = tcf.createTopicConnection(); session = connection.createTopicSession(false, TopicSession.DUPS_OK_ACKNOWLEDGE); publisher = session.createPublisher(topic); connection.start(); } I also had to set some permissions to get everything working currently they are: CALL dbms_java.grant_permission( 'MYUSER', 'SYS:java.net.SocketPermission', 'oracle-box:1024-', 'listen,resolve' ); CALL dbms_java.grant_permission( 'MYUSER', 'SYS:java.net.SocketPermission', 'jboss-box', 'connect,accept,resolve' ); I am wondering if I need to set some other permissions, but what permissions? I also wondered if the issue is different versions of J2SE or J2EE classes between oracle-box and jboss-box. I can write a java application that will send JMS messages to the same topic from oracle-box without the exceptions. so it's only when java is running inside Oracle. Any ideas anyone? Bruce Ashton Senior Developer INTEGRALIS Your Trusted Security Partner Theale House, Brunel Road Theale, Berkshire, RG7 4AQ DDI: +44 (0)118 923 5272 Fax: +44 (0)118 913 0801 [EMAIL PROTECTED] www.integralis.com Certified to BS7799: Part 2: 2002 certificate number IS65890 Please note that: 1. This e-mail may constitute privileged information. If you are not the intended recipient, you have received this confidential email and any attachments transmitted with it in error and you must not disclose, copy, circulate or in any other way use or rely on this information. 2. E-mails to and from the company are monitored for operational reasons and in accordance with lawful business practices. 3. The contents of this email are those of the individual and do not necessarily represent the views of the company. 4. The company does not conclude contracts by email and all negotiations are subject to contract. 5. The company accepts no responsibility once an e-mail and any attachments is sent. http://www.activis.com This annotation was added by the e-scan service. http://www.activis.com ---------------------------------------------------------------------------------- This message has been checked for all known viruses by e:)scan. For further information please contact [EMAIL PROTECTED] ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ JBoss-user mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/jboss-user