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
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