geronimo-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Krall <>
Subject Several problems using jndi with ejb3
Date Mon, 05 Feb 2007 10:36:16 GMT

I am using geronimo-tomcat6-jee5-2.0-M2 and I am writing an application
ear containing several ejbs (based on EJB3).
Everything compiles and deploys fine.

My ejb looks like this:

public class StammdatenVerwaltungServerImpl implements Stammdatenverwaltung
    [...]some methods[...]

My first problem is getting a reference to this bean from a client:

Properties props = new Properties();
props.setProperty("java.naming.provider.url", "remotehost:4201");
props.setProperty("", "system");
props.setProperty("", "XXX");
Context ic = new InitialContext(props);
Stammdatenverwaltung stammdatenverwaltung = (Stammdatenverwaltung)

After I could not get a handle to the bean with various jndi-names, I
found an article (
saying that the deployment-id + "BusinessRemote" is used as jndi-name.
The problem is that this deployment-id changes with every deployment.
How can I set a fix value for the jndi-name?
I tried @Stateless with annotation-parameters "name" and "mapped-name"
but that did not help.

I do NOT want to use ejb-descriptors.

Second problem (perhaps this is the same problem):

I cannot get a handle to my global datasource "tkldienstplanpool" from
within my ejb (serverside).
I was not able to recognize the jndi-name of that datasource (deployed
as "tkldienstplanpool").
Do I need the deployment-id as prefix or do I need to add a
reference-description in my application.xml and geronimo-application.xml?
What should it look like? The usage-button in geronimo-console does only
show some examples for web.xml and geronimo-web.xml.

A last question:
Why does the geronimo-console-jndi-viewer not show jndi-names?
My ejb is listed but does not show its jndi-name
It looks like this:

Enterprise Applications

Many questions, I hope I will get some answers ;-)

Best regards,
Torsten Krall

View raw message