In order to connect a stand-alone client to my EJBs I place a
jndi.properties file next to the .class files of the client like this
------------------------------
java.naming.factory.initial=com.evermind.server.rmi.RMIInitialContextFactory
java.naming.provider.url=ormi://hostNameOfOrionServer/yourAppName
java.naming.security.principal=admin
java.naming.security.credentials=passwordOfAdmin
----------------------------------------------

By using the RMIInitialContextFactory I don't have to deal with creating an
extra META-INF directory + XML file for the client. If I want to leave the
jndi.properties file out completely, I can put the content inside a
Properties object and pass it as parameter to new InitialContext().

Then I copy these jar files from the orion directory to the client computer:
ejb.jar, jndi.jar, mail.jar, orion.jar, xerces.jar (2.86 MB in total)

I finally run the client and pass the path of the following jar files as
classpath:
orion.jar, ejb.jar, jndi.jar
I also add the path to the ejb.jar file containing the home- and remote
interfaces of my EJB application.
Orion will automatically and instantly create stub code from the interfaces
when I run the application.

/David

Reply via email to