Lookup a local EJB using the seam @Name annotation.

Solution Verified - Updated -

Issue

  • How can I lookup a local EJB via the name specified in @Name annotation?

I have an EJB annotated wit:

@Name("personTask")
public class PersonTaskBean implements PersonTask, Serializable {

The following code works, but I would like to be able to do the lookup only using the name that is used in the annotation.

PersonTask personTask = (PersonTask) new InitialContext().lookup("arbutus03-ear/PersonTaskBean/local");

Environment

  • JBoss Enterprise Application Platform (EAP) 5.1.0

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content