Registering EJB with JNDI (a bit XDoclet)

F

Frank Ratzlow

Hallo,

I'm currently writing some EJBs and according to some books there are
some predefined contextes for registering different resources.
E.g.
data sources -> java:comp/env/jdbc
enterprise beans -> java:comp/env/ejb
jms -> java:comp/env/jms

The question is how do I register a bean as java:comp/env/ejb/XyzBean,
means how and where do I have to specify this parameter (DD, within
interface ...?)?

===============================================
For example I wrote an EJB created the interfaces (local home &
component + remote home & component) using XDoclet and can only get a
ref to the remote home interface :-(

The generated fields within the interface:

public interface MyBeanHome extends extends javax.ejb.EJBObject {
public static final String
COMP_NAME="java:comp/env/ejb/MyBeanHome";
public static final String JNDI_NAME="MyBeanHome";

// some abstract methods ...
}

Only the call 'context.lookup("MyBeanHome");' succeeds - not using the
value from COMP_NAME. What's wrong?

===============================================

Additionally EJB 2.x is said to offer the flexibillity to look up the
local home interface if it is a call within the same JVM and the
remote home interface if the call is intercepted from another VM. This
should be transparent to the developer.
What has to be done to get this feature working? Do I only have to
register both Interfaces with the same label with JNDI (don't think
so)?

Would be really happy about a hint to some docs?

TIA

Frank
(e-mail address removed)

P.S. using latest XDoclet, JBoss and J2EE beta 1.4
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top