I get an error when trying to retrieve a remote connection:
Properties prop = new Properties();
prop.put(Context.INITIAL_CONTEXT_FACTORY,
"org.jnp.interfaces.NamingContextFactory");
prop.put(Context.PROVIDER_URL, "jnp://*****:64115");
prop.put(Context.URL_PKG_PREFIXES, "org.jboss.naming:org.jnp.interfaces");
Context jndiContext = new InitialContext(prop);
ConnectionFactory factory = (ConnectionFactory)
jndiContext.lookup("java:/ConnectionFactory");
Queue queue = (Queue) jndiContext.lookup("java:/queue/A");
Connection connection = factory.createConnection();
On createConnection() I get:
Exception in thread "main" java.lang.IllegalArgumentException: Wrong target.
class org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate for public
org.jboss.jms.delegate.CreateConnectionResult
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(java.lang.String,java.lang.String,int)
throws javax.jms.JMSException
at org.jboss.aop.joinpoint.MethodInvocation.handleErrors(MethodInvocation.java:141)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:116)
at
org.jboss.jms.client.container.StateCreationAspect.handleCreateConnectionDelegate(StateCreationAspect.java:81)
at
org.jboss.aop.advice.org.jboss.jms.client.container.StateCreationAspect0.invoke(StateCreationAspect0.java)
at org.jboss.aop.joinpoint.MethodInvocation.invokeNext(MethodInvocation.java:101)
at
org.jboss.jms.client.delegate.ClientConnectionFactoryDelegate.createConnectionDelegate(ClientConnectionFactoryDelegate.java)
at
org.jboss.jms.client.JBossConnectionFactory.createConnectionInternal(JBossConnectionFactory.java:205)
at
org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:87)
at
org.jboss.jms.client.JBossConnectionFactory.createConnection(JBossConnectionFactory.java:82)
at simple.JMSLauncher.(JMSLauncher.java:55)
at simple.JMSLauncher.main(JMSLauncher.java:65)
View the original post :
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=4232235#...
Reply to the post :
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&a...