We are trying to lookup for an Local EJB in JBoss7.1, but we get an ClassCast Exception. This local lookup is between the same Server:

 

java.lang.ClassCastException: org.jboss.ejb.client.naming.ejb.EjbNamingContext cannot be cast to com.transaction.ITransaction

 

We are 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 do 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 will show what JNDI name to use for the lookup.

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-04
  • 2022-12-23
  • 2022-01-02
  • 2021-11-24
  • 2021-07-22
猜你喜欢
  • 2022-02-12
  • 2022-12-23
  • 2022-01-09
  • 2021-11-30
  • 2021-06-03
  • 2021-06-23
  • 2021-12-08
相关资源
相似解决方案