# @jc:ejb Annotation

Specifies the target EJB's home interface for an EJB control.

The home interface set here can be overridden at runtime through the EJB control method setJndiName(). The method has the same syntax as the attribute home-jndi-name below. For more information see Creating a New EJB Control.

Note: The @jc:ejb annotation appears in EJB controls with the .jcx extension. EJB controls with the .ctrl extension, which were created in a previous version of WebLogic Workshop, use the @jws:ejb annotation. Controls with the .ctrl extension continue to be supported in WebLogic Workshop.

## Syntax

@jc:ejb

(home-jndi-name="JNDInameOfTargetEJB" |

ejb-link="RelativeNameOfTargetEJB")¹

## Attributes

home-jndi-name

Exactly one attribute of the set must be used. Specifies the JNDI name of the target EJB's home interface. For instance,"EJBNameHome". To access an EJB on a different server in the same domain, use:
@jc:ejb home-jndi-name="jndi://username:password@host:7001/my.resource.jndi.object"

For more information, see Creating a New EJB Control

ejb-link

Exactly one attribute of the set must be used. Specifies the name of the target EJB using the application relative path to the EJB JAR. This syntax causes the runtime to use an application scoped name rather than a global JNDI name when locating the referenced EJB. The naming syntax is BeanName#EJBJAR, for instance, CreditCard#CustomerData.jar.

## Remarks

The following rules apply to this annotation's use:

- Exactly one attribute must be specificied for the @jc:ejb annotation.
- Only one @jc:ejb annotation may appear within a single Javadoc comment block.
- Must appear in front of the main interface definition in an EJB control's JCX file.

The target EJB must be deployed in WebLogic Server in the same domain as WebLogic Workshop project containing the EJB control.

Related Topics

EJB Control