I'm trying to lookup local jndi from an EJB application which is using a custom class loader through the <loader-repository> tag in jboss-app.xml The problem is , it throws classcastexception. Can anyone please let me know the solution to this problem