Another option is a standalone ejb client (i.e. not running in the app client container).

For that you'd include in your classpath the openejb-client-3.0.0- nnnnnnn.jar, the EJB spec jar, plus any other spec jars you may use (JTA, JPA, annotations). And use these JNDI properties:

    Properties props = new Properties();
props.put("java.naming.factory.initial", "org.apache.openejb.client.RemoteInitialContextFactory");
    props.put("java.naming.provider.url", "ejbd://127.0.0.1:4201");
    InitialContext context = new InitialContext(props);

The JNDI Names of your beans is going to be essentially {moduleId}/ {ejbName}/{interfaceClass} and are logged when the app is started on the info level of the OpenEJB.startup log4j category. Info isn't enabled by default, though, and there have been reports of difficulty getting those log messages to show up which we are looking into.

-David


On Aug 28, 2007, at 12:04 PM, Colin Freas wrote:

I have Geronimo 2.0.1 up and running, and have installed a simple EJB that I want to test with a client.



My understanding is I need to create a geronimo-application- client.xml file and place it in the jar file of my client. Is that correct? I’m having trouble determining the precise layout of the geronimo-application-client.xml file, which elements are required and what form they should take.



So far, this is what I have:



<application-client

    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application-client";

    configId="MyConfigName"

    moduleId="MyModuleId"

    >



</application-client>



So, my understanding would be that I then add this to the client jar as META-INF/geronimo-application-client.xml, add the jar via the admin console, then use “java -jar client.jar MyConfigName” from <geronimo-home>/bin



Any help fleshing out the xml file would be great. Confirmation or correction of my understanding after the xml works would be appreciated too.



Thank in advance!



- Colin Freas



Reply via email to