?
Solved

how to configure a certain JNDI-Name with EJB3 Annotations (the JEE way)

Posted on 2008-10-07
4
Medium Priority
?
10,843 Views
Last Modified: 2013-11-24
If II annotate my session bean like that:

@Stateless ( name="UserFacadeBean", mappedName="UserFacadeRemote/remote")
public class UserFacadeBean implements UserFacadeLocal, UserFacadeRemote {
}

and deploy it in Webglogic 10, i get access to the remote interface with:

JNDI_NAME = "UserFacadeRemote/remote#" + UserFacadeRemote.class.getName();
userFacade = (UserFacadeRemote) new InitialContext().lookup(JNDI_NAME);

that works fine, but is there an alternative (beyond unsing ejb.jar.xml) to define
a jndi name with annotations, without the full qualified classname of the remote interface?

so I want to have something like:
 new InitialContext().lookup("mySimpleName");



thanks
manolis





 

0
Comment
Question by:mafentakis
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 4

Expert Comment

by:Mr_It
ID: 22719028
In JBoss you can specify this in the vendor specific jboss.xml deployment descriptor or by using annotations in the bean class:
@RemoteBinding(jndiBinding="mySimpleName") for remote EJB interfaces or
@LocalBinding(jndiBinding="mySimpleName") for local EJB interfaces

I don't know if there is an annotations counterpart in WebLogic, but I'm sure the JNDI name for an EJB can be specified in the weblogic-ejb-jar.xml deployment descriptor as well. I guess you have to declare the bean in there and probably use the 'jndi-name' or 'local-jndi-name' element.
0
 

Author Comment

by:mafentakis
ID: 22739245
@Mr_It:

Thanks for your answer, but as i wrote i want the "J2EE Way" and not the custom Solution.


regards
manolis
0
 
LVL 4

Expert Comment

by:Mr_It
ID: 22740470
Yes I should better read titles ;-)
0
 
LVL 4

Accepted Solution

by:
Mr_It earned 150 total points
ID: 22740911
The mappedName element is not required to be supported by all implementations. Any use of this element is non-portable. The weblogic implementation happens to implement this using the fully qualified classname.

I don't think there is a standard way to do this...

Regards


0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Before You Read The Article Please make sure you understand these two concepts: Variable Scope (http://www.php.net/manual/en/language.variables.scope.php) and Property Visibility (http://www.php.net/manual/en/language.oop5.visibility.php).  And to …
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
The viewer will learn how to implement Singleton Design Pattern in Java.
This tutorial covers a practical example of lazy loading technique and early loading technique in a Singleton Design Pattern.
Suggested Courses

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question