OpenEJB Remote Server -- Command-line Guide

|  |  |  | OpenEJB OpenJMS OpenORB Castor Tyrex |

Main
Welcome!
Download
Mailing Lists
The Team

Users
Quickstart
Hello World!
CMP Example
CMP Guide
Deploy
Startup
Validation
Configuration
Support
Request Feature
FAQ

Servers
Local Server
Remote Server
Tomcat

Integrators
Why OpenEJB
Overview
Design
Specification
Presentation

Developers
Custom Services
Release Plan
Source Code
SourceForge

OpenEJB Remote Server Command-line Guide

## NAME

openejb start - OpenEJB Remote Server

## SYNOPSIS

openejb start [options]

## NOTE

The OpenEJB Remote Server must be executed from the OPENEJB_HOME directory. This is the directory where OpenEJB was installed or unpacked. For the remainder of this document we will assume you unpacked OpenEJB into the directory C:\openejb.

In Windows, the remote server can be executed as follows:

C:\openejb> openejb start -help

In UNIX, Linux, or Mac OS X, the deploy tool can be executed as follows:

[user@host openejb]# ./openejb.sh start -help

Depending on your OpenEJB version, you may need to change execution bits to make the scripts executable. You can do this with the following command.

[user@host openejb]# chmod 755 openejb.sh bin/*.sh

From here on out, it will be assumed that you know how to execute the right openejb script for your operating system and commands will appear in shorthand as show below.

openejb start -help

## DESCRIPTION

Starts OpenEJB as an EJB Server that can be accessed by remote clients via the OpenEJB Remote Server.

ALWAYS check your openejb.log file for warnings immediately after starting the Remote Server.

OpenEJB issues warnings when it works around a potential problem, encounters something it didn't expect, or when OpenEJB wants to let you know something may not work as you expected it.

The OpenEJB Remote Server is the default implementation of OpenEJB's ApplicationServer interface. It allows remote clients to access beans in OpenEJB over a network.

The JNDI names clients use to lookup beans from the Remote Server depends on the Deployment ID you gave the beans when you deployed them with the Deploy Tool.

OpenEJB itself is configured with the OpenEJB configuration file, which is extremely simple and self-documenting. This file is located at c:\openejb\conf\openejb.conf.

## OPTIONS

| -h | host | Binds the Remote Server to the specified host address. Default host address is 127.0.0.1.
| -p | port | Binds the Remote Server to the specified port. Default port is 4201.
| -t | int | Sets the number of concurrent threads the Remote server should use to service requests from clients. Default number of threads is 20.
| -d | dir | Sets the OPENEJB_HOME to the specified directory.
| -l | file | Sets the log4j configuration to the specified file.
| -conf | file | Sets the OpenEJB configuration to the specified file.
| -version |  | Print the version.
| -help |  | Print this help message.
| -examples |  | Show examples of how to use the options.
| --admin-ip |  | A comma delimited list of hosts and IP addresses that are allowed to administer this server.
| --local-copy | [true|false] | Instructs the container system whether or not marshal (copy) the parameters and return values on calls between beans.

## EXAMPLES

### Simplest scenario

openejb start

That's it. The server will start up and bind to IP 127.0.0.1 and port 4201.

The following properties would then be used to get an InitialContext from the Remote Server.

       java.naming.factory.initial      = org.openejb.client.RemoteInitialContextFactory
       java.naming.provider.url         = 127.0.0.1:4201
       java.naming.security.principal   = myuser
       java.naming.security.credentials = mypass

### Using -h

openejb start -h 10.45.67.8

This is the most common way to use the OpenEJB Remote Server. The server will start up and bind to IP 10.45.67.8 and port 4201.

The following properties would then be used to get an InitialContext from the Remote Server.

       java.naming.factory.initial      = org.openejb.client.RemoteInitialContextFactory
       java.naming.provider.url         = 10.45.67.8:4201
       java.naming.security.principal   = myuser
       java.naming.security.credentials = mypass

DNS names can also be used.

openejb start -h myhost.foo.com

The following properties would then be used to get an InitialContext from the Remote Server.

       java.naming.factory.initial      = org.openejb.client.RemoteInitialContextFactory
       java.naming.provider.url         = myhost.foo.com:4201
       java.naming.security.principal   = myuser
       java.naming.security.credentials = mypass

### Using -p

openejb start -p 8765

The server will start up and bind to IP 127.0.0.1 and port 8765.

The following properties would then be used to get an InitialContext from the Remote Server.

       java.naming.factory.initial      = org.openejb.client.RemoteInitialContextFactory
       java.naming.provider.url         = 127.0.0.1:8765
       java.naming.security.principal   = myuser
       java.naming.security.credentials = mypass

### Using -conf file

openejb start -conf C:\openejb\conf\mytest.conf

Sets the openejb.configuration system variable to the file C:\openejb\conf\mytest.conf. When the server starts up and the initializes OpenEJB, this configuration will be used to assemble the container system and load beans.

### Using --admin-ip addresses

openejb start --admin-ip 192.168.1.12

Adds 192.168.1.12 to the list of IP addresses that are authorized to shutdown the server or access the server via a telnet client. The host that this server was started on is always allowed to administer the server.

Multiple hosts can be given administrative access to this server by listing all the host names separated by commas as such:

openejb start --admin-ip 192.168.1.12,joe.foo.com,robert

The first host in the string names the host explicitly using an IP address (192.168.1.12).

The second host in uses a DNS name (joe.foo.com) to refer to the hosts IP address. The DNS name will be resolved and the IP will be added to the admin list.

The third address refers to a the host by a name (robert) that the opperating system is able to resolve into a valid IP address. This is usually done via a hosts file, interal DNS server, or Windows Domain Server.

## Using -conf file

openejb start -conf C:\openejb\conf\mytest.conf

openejb start --local-copy=true

Instructs the container system to marshall (ie, copy) all calls between beans are required by the EJB 1.1 specification.

openejb start --local-copy=false

Instructs the container system to not marshall (copy) calls between beans. The container system as will pass parameters and return values without copying or marshalling as is required for EJB 2.0 Local interfaces.

Java, EJB, JDBC, JNDI, JTA, Sun, Sun Microsystems are trademarks or registered trademarks of Sun Microsystems, Inc. in the United States and in other countries. XML, XML Schema, XSLT and related standards are trademarks or registered trademarks of MIT, INRIA, Keio or others, and a product of the World Wide Web Consortium. All other product names mentioned herein are trademarks of their respective owners.