Greg,

It depends on the EJB server you are using. Each vendor provides context
factory objects that perform component lookups. The property settings depend
on the server you are using.

<vendor>
For example in GemStone/J the property settings are something like:

        StockService_Interface=invest.StockServiceHome
        SystemName=gsj32
        HomePath=Systems/gsj32/Repository/Applications/Stock/Homes
        com.gemstone.naming.NameServiceSSLPort=10199
        java.naming.factory.initial=com.gemstone.naming.EJBCtxFactory
        com.gemstone.naming.NameServicePort=10200
        Stock_Interface=invest.StockHome
        com.gemstone.naming.NameServiceHost=raberlx_lap
        ReposHomePath=Applications/Stock/Homes

NameServiceHost/NameServicePort are the properties of interest that you are
asking about.

When you deploy a bean to GemStone/J, a "client jar" file is calulated,
including a resource with the above property settings setup for you. So the
code for the client  looks something like this (contents of
StockProperties.txt):

                        Properties p = new Properties();


p.load(getClass().getResourceAsStream("/StockProperties.txt"));
                        Context aContext = new InitialContext(p);
                        String homePath = p.getProperty("HomePath") +
"/StockService";
                        home = (StockServiceHome) aContext.lookup(homePath);

StockProperties.txt is the resource that's put into the client jar along
with interfaces and stub needed by the client.

This way you can avoid putting all those hard coded property settings in
your code. Even if the J2EE server you are using does not set up client jars
and resources for you in this manner, you could adopt the style and keep the
client code clean.
</vendor>

-Chris.
> -----Original Message-----
> From: Greg Robertson [SMTP:[EMAIL PROTECTED]]
> Sent: Friday, May 05, 2000 11:56 AM
> To:   [EMAIL PROTECTED]
> Subject:      calling EJB on another server using Reference Implementation
>
> I understand the RI documentation that states I have to specify
> org.omg.CORBA.ORBInitialHost=someotherserver on the command line for a
> client but how can I call an EJB residing on a different machine from the
> one housing my EJB (yes they HAVE to be on separate servers for reasons
> beyond my control).
>
> What is the syntax for building the InitialContext to attach to the other
> server in this instance - or for that matter if it's not a matter of
> InitialContext what do you have to do?
>
> thanks
>
> ==========================================================================
> =
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the
> body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to