views:

363

answers:

1

I would like to specify JNDI name for an EJB3 bean using annotation, but JBoss 5.1.0 GA seems to ignore the annotation completely. Bean's annotations are:

@Remote(Foobar.class)
@Stateless(name = "Foobar")
@TransactionManagement(TransactionManagementType.BEAN)
@RemoteBinding(jndiBinding="ejb/Foobar")
public class FoobarBean implements Foobar {
...

I tested deploying also using @RemoteBindings annotation, but the result was same:

@RemoteBindings({@RemoteBinding(jndiBinding="ejb/Foobar")})

The bean does not get bound to JNDI with the specified name, and the log file doesn't give any clues.

+1  A: 

What are your import statements? JBoss 4.2.x and up uses org.jboss.ejb3.annotation.* instead of org.jboss.annotation.ejb.*

neu242