-
1. Re: How can I change the default ejb3 jndi name?
jaikiran Oct 27, 2010 9:12 AM (in response to inacio-silva)1 of 1 people found this helpfulWhich version of JBoss AS?
For AS5.x and later, see this http://docs.jboss.org/ejb3/docs/tutorial/1.0.7/html/JNDI_Bindings.html
For AS4.x, see this http://docs.jboss.org/ejb3/docs/tutorial/jndibinding/jndi.html
-
2. Re: How can I change the default ejb3 jndi name?
inacio-silva Oct 27, 2010 9:59 AM (in response to jaikiran)Thank you for your answer.
My Jboss is 4.2.2
I haven't found the RemoteBinding.class in my server. What jar must I have in my classpath's program in order to use that class?
Thank you again!
-
3. Re: How can I change the default ejb3 jndi name?
jaikiran Oct 27, 2010 10:38 AM (in response to inacio-silva)For AS4.x it's in JBOSS_HOME/server/< servername>/deploy/ejb3.deployer/jboss-annotations-ejb3.jar
-
4. Re: How can I change the default ejb3 jndi name?
inacio-silva Oct 27, 2010 12:38 PM (in response to jaikiran)1 of 1 people found this helpfulIt worked! Great!
Thank you very much!
-
5. How can I change the default ejb3 jndi name?
minibiti Mar 10, 2011 6:01 AM (in response to jaikiran)Hi,
Using your link for AS 5, it still does not work for me
I used
@Stateless
@LocalBinding (jndiBinding="MyService/MyOwnName")but I still do not manage to change the default JNDI name for my bean.
Any idea?
I am using JBoss 5.1 AS.
Thanks
-
6. How can I change the default ejb3 jndi name?
jaikiran Mar 10, 2011 6:10 AM (in response to minibiti)For AS5 you should be using @org.jboss.ejb3.annotation.LocalBinding annotation. I guess you are using the wrong package name for that annotation. The annotation can be found in JBOSS_HOME/client/jboss-ejb3-ext-api.jar
-
7. How can I change the default ejb3 jndi name?
minibiti Mar 10, 2011 7:17 AM (in response to jaikiran)Jaikiran, you are a life saver!
Now it is working
Thanks a bunch!
-
8. How can I change the default ejb3 jndi name?
fsotest Mar 10, 2011 8:38 AM (in response to minibiti)I have a kind of similar problem. I would like to include a version number in the jndi path like this: ear-name-V0-0/ejb-name/remote. In jboss 5.1 the first part of the jndi-name is taken from the ear-file being deployed. Is it possible to use something else then the name of the ear-file name (I would not like the ear file to be named ear-name-V0-0.ear). I would not like to use @LocalBinding at each ejb since it would then have to include the version number at each ejb. The only implementation I can figure out is to add an jboss.xml for each ejb module and include bindings for each bean (at build time). But I would prefer only to have the version number at one place. Any ideas.
-
9. Re: How can I change the default ejb3 jndi name?
mittal.rohit469 Apr 28, 2014 3:42 AM (in response to inacio-silva)Hello,
I am using JBOSS EAP 6.1.. and in that @LocalBinding don't work.
I need to define default JNDI name in order to remove version number from JNDI names.
Please let me know for JBOSS EAP 6.1
-
10. Re: How can I change the default ejb3 jndi name?
jaikiran Apr 28, 2014 4:10 AM (in response to mittal.rohit469)Rohit Mittal wrote:
to remove version number from JNDI names.
That can be controlled through the use of application.xml and/or web.xml and/or ejb-jar.xml in a portable way. What do those descriptor files look like and what do the current JNDI names look like?
-
11. Re: How can I change the default ejb3 jndi name?
mittal.rohit469 Apr 28, 2014 4:59 AM (in response to jaikiran)Actually, there is jboss-ejb3.xml for JBOSS EAP 6.1... in which we specify
<session>
<ejb-name>BEAN_NAME</ejb-name>
</session>
I also tried using <mapped-name> but it doesn't worked.
Currently, the JBOSS generates it's own JNDI names in the format:
ejb:EJB_EAR_NAME_WITH_VERSION_NUMBER/EJB3_PROJECT_NAME_WITH_VERSION_NUMBER/BEAN_NAME!REMOTE_CLASS_NAME_WITH_FULL_PACKAGE_PATH
I need to define default JNDI name in order to remove the version number from EAR and PROJECT names.
-
12. Re: Re: How can I change the default ejb3 jndi name?
jaikiran Apr 28, 2014 7:44 AM (in response to mittal.rohit469)Rohit Mittal wrote:
I need to define default JNDI name in order to remove the version number from EAR and PROJECT names.
You don't need jboss-ejb3.xml for that. For changing the application name (which by default is the .ear name in case of ear files), add the following to your application.xml:
<application> <!-- Replace foo with the name of your application --> <application-name>foo</application-name>
and to change the EJB module's name, in your ejb-jar.xml add the following:
<ejb-jar> <!-- Replace bar with the name of your module --> <module-name>bar</module-name>
Check the relevant xsds for more details.
-
13. Re: How can I change the default ejb3 jndi name?
mittal.rohit469 Apr 28, 2014 11:39 PM (in response to jaikiran)thanks Jaikiran for the response...
I checked my application.xml :
<application>
<display-name>EAR_NAME_WITHOUT_VERSION_NUMBER</display-name>
<module>
<ejb>EJB3_PROJECT_NAME_WITH_VERSION.jar</ejb>
</module>
</application>
Here if i remove version number then this ejb3 project is not deployed...
Also, we don't use ejb-jar.xml.... instead there is jboss-ejb3.xml...in which there is no module name
Is there something which i am missing?
-
14. Re: How can I change the default ejb3 jndi name?
jaikiran Apr 29, 2014 12:47 AM (in response to mittal.rohit469)That's not what I meant. Take a look at my previous reply. It uses application-name in application.xml (not display-name) and it doesn't change anything with the <ejb> element value.
If you aren't packaging a ejb-jar.xml, then add one to the deployment with just the ejb-jar element and module-name as the child element.