NAME
openejb start - OpenEJB Remote Server
SYNOPSIS
openejb start options
NOTE
The OpenEJB Remote Server can be started by running the openejb.bat script for windows and the openejb script for Linux and other Unix based OSes. Before running these scripts you need to set the environment variable OPENEJB_HOME to the path of the directory where you unpacked the OpenEJB installation.
From now on we will refer to this directory as <OPENEJB_HOME> and assume that you unpacked OpenEJB into the directory C:\openejb-3.0.0
The startup scripts are present in the <OPENEJB_HOME>/bin directory. You can set this directory in the system PATH for starting openejb from the command shell.
In Windows, the remote server can be executed as follows:
C:\openejb-3.0.0> bin\openejb start
In UNIX, Linux, or Mac OS X, the deploy tool can be executed as follows:
user@host openejb-3.0.0# ./bin/openejb start
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-3.0.0# chmod 755 bin/openejb
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.
OpenEJB itself is configured with the OpenEJB configuration file, which is extremely simple and self-documenting. This file is located at c:\openejb-3.0.0\conf\openejb.xml.
OPTIONS
--admin-bind <host> |
Binds the OpenEJB admin service to the specified host address. Default host address is 0.0.0.0. |
--admin-port <int> |
Binds the OpenEJB admin service to the specified port. Default port is 4200. |
--conf <file> |
Sets the OpenEJB configuration to the specified file. |
--ejbd-bind <host> |
Binds the Remote Server to the specified host address. Default host address is 0.0.0.0. |
--ejbd-port <int> |
Binds the Remote Server to the specified port. Default port is 4201. |
--examples |
Show examples of how to use the options. |
-h, --help |
Print this help message. |
--hsql-bind <host> |
Binds the embedded HSQL DB service to the specified host address. Default host address is 0.0.0.0. |
--hsql-port <int> |
Binds the embedded HSQL DB service to the specified port. Default port is 9001. |
--httpejbd-bind <host> |
Binds the EJB over HTTP service to the specified host address. Default host address is 0.0.0.0. |
--httpejbd-port <int> |
Binds the EJB over HTTP service to the specified port. Default port is 4204. |
--local-copy <boolean> |
Instructs the container system to marshal (ie, copy) all calls between beans. |
--telnet-bind <host> |
Binds the telnet administration service to the specified host address. Default host address is 0.0.0.0. |
--telnet-port <int> |
Binds the telnet administration service to the specified Port. Default port is 4202. |
-v, --version |
Print the version. |
EXAMPLES
Example: Simplest scenario
openejb start
That's it. The ejbd 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.apache.openejb.client.RemoteInitialContextFactory java.naming.provider.url = ejbd://127.0.0.1:4201 java.naming.security.principal = myuser java.naming.security.credentials = mypass
Example: --conf=file
openejb start --conf=C:\openejb-3.0.0\conf\mytest.conf
Sets the openejb.configuration system variable to the file C:\openejb\conf\mytest.conf
. When the server starts up and initializes OpenEJB, this configuration will be used to assemble the container system and load beans.
Example: --local-copy
openejb start --local-copy=true
Instructs the container system to marshal (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 marshal (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.
CONFIG OVERRIDE EXAMPLES
Example: -D<service>.bind=<address>
openejb start -Dejbd.bind=10.45.67.8
This is the most common way to use the EJBd Server Service. The service 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 EJBd Server Service.
java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory java.naming.provider.url = ejbd://10.45.67.8:4201 java.naming.security.principal = myuser java.naming.security.credentials = mypass
DNS names can also be used.
openejb start -Dejbd.bind=myhost.foo.com
The following properties would then be used to get an InitialContext from the Remote Server.
java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory java.naming.provider.url = ejbd://myhost.foo.com:4201 java.naming.security.principal = myuser java.naming.security.credentials = mypass
openejb start -Dtelnet.bind=myhost.foo.com
The following properties would then be used to log into the server via a telnet client as such:
telnet myhost.foo.com 4202
Example: -D<service>.port=<port>
openejb start -Dejbd.port=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.apache.openejb.client.RemoteInitialContextFactory java.naming.provider.url = ejbd://127.0.0.1:8765 java.naming.security.principal = myuser java.naming.security.credentials = mypass
openejb start -Dhttpejbd.port=8888
The server will start up and the EJB over HTTP service will bind to IP 127.0.0.1 and port 8888.
The following properties would then be used to get an InitialContext from the HTTP/Remote Server.
java.naming.factory.initial = org.apache.openejb.client.RemoteInitialContextFactory java.naming.provider.url = http://127.0.0.1:8888/openejb java.naming.security.principal = myuser java.naming.security.credentials = mypass
Example: -D<service>.only_from=<addresses>
openejb start -Dadmin.only_from=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 -Dadmin.only_from=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 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.
Example: -D<service>.threads=<max>
openejb start -Dejbd.threads=200
Sets the max number of concurrent threads that can enter the EJBd Server Service to 200.
Example: -D<service>.disabled=<true/false>
openejb start -Dtelnet.disabled=true
Prevents the Telnet Server Service from starting when the OpenEJB Server starts.
CONSOLE OUTPUT
Once you start OpenEJB using the openejb start
command the following output will be seen on the console
Apache OpenEJB 3.0.0-SNAPSHOT build: 20070816-01:39 http://openejb.apache.org/ INFO - openejb.home = C:\openejb-3.0.0-SNAPSHOT INFO - openejb.base = C:\openejb-3.0.0-SNAPSHOT DEBUG - Instantiating assembler class org.apache.openejb.assembler.classic.Assem bler INFO - Configuring Service(id=Default Security Service, type=SecurityService, pr ovider-id=Default Security Service) INFO - Configuring Service(id=Default Transaction Manager, type=TransactionManag er, provider-id=Default Transaction Manager) INFO - Configuring Service(id=Default JMS Resource Adapter, type=Resource, provi der-id=Default JMS Resource Adapter) INFO - Configuring Service(id=Default JDBC Database, type=Resource, provider-id= Default JDBC Database) INFO - Configuring Service(id=Default Unmanaged JDBC Database, type=Resource, pr ovider-id=Default Unmanaged JDBC Database) INFO - Configuring Service(id=Default JMS Connection Factory, type=Resource, pro vider-id=Default JMS Connection Factory) INFO - Configuring Service(id=Default Local TX ConnectionManager, type=Connectio nManager, provider-id=Default Local TX ConnectionManager) INFO - Configuring Service(id=Default JDK 1.3 ProxyFactory, type=ProxyFactory, p rovider-id=Default JDK 1.3 ProxyFactory) INFO - Configuring Service(id=Default CMP Container, type=Container, provider-id =Default CMP Container) INFO - Configuring Service(id=Default BMP Container, type=Container, provider-id =Default BMP Container) INFO - Configuring Service(id=Default Stateful Container, type=Container, provid er-id=Default Stateful Container) INFO - Configuring Service(id=Default Stateless Container, type=Container, provi der-id=Default Stateless Container) INFO - Configuring Service(id=Default MDB Container, type=Container, provider-id =Default MDB Container) INFO - Found EjbModule in classpath: C:\openejb-3.0.0-SNAPSHOT\lib\openejb-core- 3.0.0-SNAPSHOT.jar DEBUG - Searched 83 classpath urls in 291 milliseconds. Average 3 milliseconds per url. DEBUG - Beginning load: C:\openejb-3.0.0-SNAPSHOT\lib\openejb-core-3.0.0-SNAPSHO T.jar INFO - Configuring app: C:\openejb-3.0.0-SNAPSHOT\lib\openejb-core-3.0.0-SNAPSHO T.jar INFO - Loaded Module: C:\openejb-3.0.0-SNAPSHOT\lib\openejb-core-3.0.0-SNAPSHOT. jar INFO - Assembling app: C:\openejb-3.0.0-SNAPSHOT\lib\openejb-core-3.0.0-SNAPSHOT .jar INFO - Jndi(name=openejb/ConfigurationInfoBusinessRemote) INFO - Jndi(name=openejb/DeployerBusinessRemote) INFO - Jndi(name=MEJB) INFO - Created Ejb(deployment-id=openejb/ConfigurationInfo, ejb-name=openejb/Con figurationInfo, container=Default Stateless Container) INFO - Created Ejb(deployment-id=openejb/Deployer, ejb-name=openejb/Deployer, co ntainer=Default Stateless Container) INFO - Created Ejb(deployment-id=MEJB, ejb-name=MEJB, container=Default Stateles s Container) DEBUG - Containers : 5 DEBUG - Type Container ID DEBUG - BMP ENTITY Default BMP Container DEBUG - MESSAGE Default MDB Container DEBUG - CMP ENTITY Default CMP Container DEBUG - STATEFUL Default Stateful Container DEBUG - STATELESS Default Stateless Container DEBUG - Deployments : 3 DEBUG - Type Deployment ID DEBUG - STATELESS openejb/ConfigurationInfo DEBUG - STATELESS openejb/Deployer DEBUG - STATELESS MEJB DEBUG - SecurityService : org.apache.openejb.core.security.SecurityServiceImpl DEBUG - TransactionManager: org.apache.geronimo.transaction.manager.GeronimoTran sactionManager INFO - OpenEJB ready. OpenEJB ready. [init] OpenEJB Remote Server [Server@1e758ca]: [Thread[main,5,main]]: checkRunning(false) entered [Server@1e758ca]: [Thread[main,5,main]]: checkRunning(false) exited ** Starting Services ** NAME IP PORT httpejbd 0.0.0.0 4204 telnet 0.0.0.0 4202 ejbd 0.0.0.0 4201 [Server@1e758ca]: Initiating startup sequence... [Server@1e758ca]: Server socket opened successfully in 0 ms. [Server@1e758ca]: [Thread[HSQLDB Server @1e758ca,5,main]]: run()/openDatabases() : [Server@1e758ca]: Initiating shutdown sequence... [Server@1e758ca]: Shutdown sequence completed in 10 ms. [Server@1e758ca]: 2007-08-20 07:10:30.453 SHUTDOWN : System.exit() was not calle d hsql 0.0.0.0 9001 admin thread 0.0.0.0 4200 ------- Ready!