We are trying-to-lookup for a Local EJB in JBoss7.1, but we get a classcast Exception. This local lookup is between the same Server:
Java.lang.ClassCastException:org.jboss.ejb.client.naming.ejb.EjbNamingContext cannot is cast to Com.transaction.ITransaction
We is doing a lookup for the following JNDI name:
Ejb:app/transactionbean!com.transaction.transactionlocal
InitialContext context = new InitialContext ();
Context.lookup (ejb:app/transactionbean!com.transaction.transactionlocal);
Is there any other configuration missing from our side. I Read about Ejb-client.properties does we need this file? or its-only for remote lookups?
You don ' t need ejb:namespace lookup for local EJBs. Use the spec mandated JNDI name scheme (either Java:global, Java:app, java:module depending on the context from where you Want to lookup). The server logs would show what JNDI name to use for the lookup.
Jboss7.1 Local EJB lookup problem