How to solve "javax.naming.Reference cannot be cast to javax.naming.Reference cannot be cast to .."
- Published: 09 October 2009
JBoss recipe of the day
This error means that the interface javax.naming.Reference cannot be resolved. It can happen when you are trying to lookup a component like an EJB or a Datasource from the JNDI. It is commonly caused by two reasons:
You are missing some classes in client classpath (Verify that you have jbossall-client.jar in the classpath).
You are using different JBoss runtimes between the client and the server. (For example the server uses JBoss 5.1.0 libraries and the client uses JBoss 5.0.0 or earlier)