You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@geronimo.apache.org by Colin Freas <cf...@millennialmedia.com> on 2007/08/28 21:04:49 UTC

Trying to run a client...

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


Re: Trying to run a client...

Posted by David Blevins <da...@visi.com>.
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
>
>


Re: Trying to run a client...

Posted by Kevan Miller <ke...@gmail.com>.
On Aug 28, 2007, at 3: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.
Hi Colin,
An application client is certainly an option. However, you might find  
it easier to test your EJB using a JSP/servlet...

>
>
> 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>
Should look something like:

<application-client
    xmlns="http://geronimo.apache.org/xml/ns/j2ee/application- 
client-1.2"
    xmlns:dep="http://geronimo.apache.org/xml/ns/deployment-1.2">

    <dep:client-environment>
     <dep:moduleId>
       <dep:groupId>org.myGroupId</dep:groupId>
       <dep:artifactId>MyClient</dep:artifactId>
       <dep:version>1.0</dep:version>
       <dep:type>car</dep:type>
     </dep:moduleId>
    </dep:client-environment>

    <dep:server-environment>
     <dep:moduleId>
       <dep:groupId>org.myGroupId</dep:groupId>
       <dep:artifactId>MyClientServer</dep:artifactId>
       <dep:version>1.0</dep:version>
       <dep:type>car</dep:type>
     </dep:moduleId>
    </dep:server-environment>

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

java -jar client.jar org/myGroupId/MyClient
>
>
> 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
>
>