jdni.properties -> jndi.properties ? You can turn on debug and see if you're actually talking to JBoss.
I am also facing the same problem.
I am using samples given in the JBoss distribution as per the JBossMQWiki.
However when I use testQueue then I get ClassCastException and if I use queue A then I get Queue not bound exception.
Here is my code:
Properties properties = new Properties();
InitialContext ctx = new InitialContext(properties);
log.info("Looking up queueA");
Queue queue = (Queue) ctx.lookup("Queue/A");
Please let me know if this is incorrect and if yes then what needs to be done.
If you are getting a ClassCastException post the Exception stack trace and message.
Exception in thread "main" java.lang.ClassCastException: javax.naming.Reference
I found the reason for this. It has nothing to do with ClassCastException actually.
The JMS client was not able to connect to JBoss server hence I was not getting the Queue type object and thus the ClassCastException.
Putting jbossall-client.jar in the classpath solved the problem.
Yes the fact the ClassCastException mentions javax.naming.Reference is enough information to realise you had jars missing on your classpath.