Saturday, December 6, 2008

What to do if Remote JMS Client can not get factory and throw classcastexception?

What to do if Remote JMS Client can not get factory and throw classcastexception?

First: Add the following property to initialcontext like:

props.put("java.naming.factory.initial", "org.jnp.interfaces.NamingContextFactory");
props.put("java.naming.provider.url", "jnp://localhost:1099");
props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");

ctx = new InitialContext(props);

Second: Check the version of jar file: jboss-messaging-client. It has to have the same version with jms in jboss.

That's all

Google