The following code worked in JBoss 3.2.7
Which now fails using JBoss 4.0.3SP1,JDK1.5,LinuxOS(Intel).
(Client) Properties properties = new Properties(); properties.put(Context.INITIAL_CONTEXT_FACTORY, "org.jnp.interfaces.NamingContextFactory"); properties.put(Context.PROVIDER_URL, "localhost:1099"); InitialContext iniCtx = new InitialContext(properties); Object tmp = iniCtx.lookup("ConnectionFactory"); QueueConnectionFactory connFactory = (QueueConnectionFactory) tmp; logger.info("obtained the queue connection factory.."); QueueConnection conn = connFactory.createQueueConnection(); Queue que = (Queue) iniCtx.lookup(Const.TEST_QUEUE); logger.info("obtained the queue"); QueueSession session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE); QueueSender sender = session.createSender(que); long fileSz = f.length(); BufferedReader reader = new BufferedReader(new FileReader(f)); char[] buf = new char[(int)fileSz]; reader.read(buf); String data = new String(buf); MyMessage msg = null; msg = parser.parse(data); ObjectMessage objMessage = session.createObjectMessage(); objMessage.setObject(msg); sender.send(que,objMessage);
if( repository == null ) { String msg = "Invalid use of destroyed classloader, UCL destroyed at:"; throw new ClassNotFoundException(msg, this.unregisterTrace); }