JBoss Messaging access from a WAR deployed application
jbibby May 15, 2006 11:59 AMI am upgrading from JBossMQ on 4.0.1sp1 to JBossMessaging 1.0.1CR1 on 4.4CR2 and attepting to access the queue from some (JBPM) code deployed in a war on the same server. This is a jnlp installation on a windows xp pro machine.
When I try to lookup my queue via the initialContext I get a ClassNotFound JBossConnectionFactory exception.
The server is located at %JBOSS_HOME%\server\integration and is using an Oracle9i data source. The deploy folder contains both the jboss-messaging SAR and my application deployed as a WAR.
I have tried including the jboss-messaging-client-jar in the server/myserver/lib folder but just get some strange FieldNotFoundError's on field dcl.
If anyone has any suggestions, it would be much apprectiated. Also if there are configuration files that would be useful to post, please let me know and I will get them up here.
Exception follows:
Caused by: java.lang.ClassNotFoundException: org.jboss.jms.client.JBossConnectionFactory (no security manager: RMI class loader disabled) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:371) at sun.rmi.server.LoaderHandler.loadClass(LoaderHandler.java:165) at java.rmi.server.RMIClassLoader$2.loadClass(RMIClassLoader.java:620) at org.jboss.system.JBossRMIClassLoader.loadClass(JBossRMIClassLoader.java:91) at java.rmi.server.RMIClassLoader.loadClass(RMIClassLoader.java:247) at sun.rmi.server.MarshalInputStream.resolveClass(MarshalInputStream.java:197) at java.io.ObjectInputStream.readNonProxyDesc(ObjectInputStream.java:1538) at java.io.ObjectInputStream.readClassDesc(ObjectInputStream.java:1460) at java.io.ObjectInputStream.readOrdinaryObject(ObjectInputStream.java:1693) at java.io.ObjectInputStream.readObject0(ObjectInputStream.java:1299) at java.io.ObjectInputStream.readObject(ObjectInputStream.java:339) at java.rmi.MarshalledObject.get(MarshalledObject.java:135) at org.jnp.interfaces.MarshalledValuePair.get(MarshalledValuePair.java:72) at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:652) ... 48 more
The following is a code except from where the exception starts:
Properties env = new Properties( ); env.setProperty("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory" ); env.setProperty("java.naming.provider.url", "localhost:1099" ); env.setProperty("java.naming.factory.url.pkgs", "org.jboss.naming" ); InitialContext iniCtx = new InitialContext(env); Object tmp = iniCtx.lookup("ConnectionFactory"); // <---------- exception happens here QueueConnectionFactory qcf = (QueueConnectionFactory) tmp; conn = qcf.createQueueConnection(); que = (Queue) iniCtx.lookup( getQueueName() ); session = conn.createQueueSession(false,QueueSession.AUTO_ACKNOWLEDGE); conn.start();
Cheers..jb