I write a Message Drive Bean.and Jboss show create
message queue successfully.
and I try to write a client to test this MDbean.
Properties props = new Properties();
props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.provider.url","localhost:1099");
props.put("java.naming.factory.url.pkgs","org.jboss.naming:org.jnp.interfaces");
props.put("java.naming.rmi.security.manager", "yes");
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming");
InitialContext ctx = new InitialContext(props);
QueueConnectionFactory qcf=(QueueConnectionFactory)ctx.lookup("QueueConnectionFactory");//this is line 42
and it show exception under:
[java] javax.naming.CommunicationException. Root exception is java.rmi.Unm
or unmarshalling return; nested exception is:
[java] java.lang.ClassNotFoundException: org.jboss.mq.referenceable.Obj
ity manager: RMI class loader disabled)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:169)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:34
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:33
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:42
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:33
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.test.ejb.testClient.setupPTP(testClient.java:42)
[java] at com.test.ejb.testClient.sendRecvAsync(testClient.java:50)
[java] at com.test.ejb.testClient.main(testClient.java:58)
You are missing jbossmq-client.jar from your
classpath. It is in the client directory of the
jboss distribution.
Regards,
Adrian