Solved

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

Posted on 2008-10-07
4
10,764 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 50 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

Suggested Solutions

Title # Comments Views Activity
Understanding websocket example in spring 1 119
servlet filter example 37 84
arguments to jar 5 40
Regarding swagger API 1 37
The Fluent Interface Design Pattern You can use the Fluent Interface (http://en.wikipedia.org/wiki/Fluent_interface) design pattern to make your PHP code easier to read and maintain.  "Fluent Interface" is an object-oriented design pattern that r…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
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.

733 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