You can create a jboss.xml file and mention the jndi-name of your choice for 
the EJB. Something like this:

<?xml version="1.0" encoding="UTF-8"?>
  | <!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 4.0//EN" 
"http://www.jboss.org/j2ee/dtd/jboss_4_0.dtd";>
  | 
  | 
  | <jboss>
  |  
  |     <enterprise-beans>
  |       <session>
  |          <ejb-name>ServiceEmployeBean</ejb-name>
  |          <jndi-name>MyBean</jndi-name>
  | 
  |       </session>
  |    </enterprise-beans>
  | 
  |    
  | 
  | </jboss>
  | 

Place this jboss.xml in the META-INF folder of your ejb jar (same place as 
ejb-jar.xml). Then use this jndi-name (in this case "MyBean") in your code, to 
lookup the bean.


P.S: You mentioned that you use EJB3. In EJB3 you no longer need the xmls to 
define the beans or the jndi-name. You can use annotations to do this. See this 
EJBTrail for more details http://trailblazer.demo.jboss.com/EJB3Trail/


View the original post : 
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4135867#4135867

Reply to the post : 
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4135867
_______________________________________________
jboss-user mailing list
jboss-user@lists.jboss.org
https://lists.jboss.org/mailman/listinfo/jboss-user

Reply via email to