I am trying to connect to testQueue which comes default with jboss messgaing , but I am getting the following exception
javax.naming.CommunicationException: Failed to retrieve stub from server (server address)
[Root exception is java.io.StreamCorruptedException: unexpected block data]
at org.jnp.interfaces.NamingContext.getServer(NamingContext.java:248)
at org.jnp.interfaces.NamingContext.discoverServer(NamingContext.java:12
at org.jnp.interfaces.NamingContext.checkRef(NamingContext.java:1382)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:579)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
at javax.naming.InitialContext.lookup(InitialContext.java:351)
my server and application are running on same machine
I have mentioned the following properties in my ApplicationResources pr operties file
jmsProviderUrl = jnp\://localhost\:1099
jmsPrefixes = org.jboss.naming:org.jnp.interfaces
jmsContextFactory = org.jnp.interfaces.NamingContextFactory
my lookupcode is
ResourceBundle bundle = ResourceBundle.getBundle("ApplicationResources");
Hashtable hst = new Hashtable();
hst.put(Context.INITIAL_CONTEXT_FACTORY,bundle.getString("jmsContextFactory"));
hst.put(Context.URL_PKG_PREFIXES,bundle.getString("jmsPrefixes"));
hst.put(Context.PROVIDER_URL,bundle.getString("jmsProviderUrl"));
Context context = new InitialContext(hst);
Iam getting the above error when the following line is executed
QueueConnectionFactory queueConnectionFactory = (QueueConnectionFactory) context.lookup("ConnectionFactory");
//remaining code is
String queueName = "queue/testQueue";
Queue queue = (Queue) context.lookup(queueName);
do I need to change in
connection-factories-service.xml
or
destinations-service.xml
or let me know where do I need to change.
help is highly appreciated.