The 2nd part of the 2 part article
discusses the EJB Deployment, Troubleshooting and
Environment Variables affecting the setup of the
EJB Server
Publishing EJB's in the Database
(Deployment)
Similar to PL/SQL stored procedures
and java stored procedures, EJB's are "deployed"
into the database. The EJB and CORBA objects have
their own namespace within the Oracle database,
this is called a session namespace. The namespace
is managed by the sess_sh command under NT.
The session namespace is like
a Unix directory structure. It consists of a hierarchical
collection of 'Published Contexts' (directories)
and 'Published Nodes' (files). Each node represents
a stored EJB or CORBA object, these are called by
client applications and are instantiated in the
Java Shared Pool via the Oracle 8i ORB.
In order to publish EJB's, you
need to setup the session namespace, this can be
done with the publish command line tool OR the interactive
sess_sh (session shell). The initial publishing
contexts are:
| Name |
Owner |
Read |
Write |
Execute |
| / |
SYS |
PUBLIC |
SYS |
PUBLIC |
| /bin |
SYS |
PUBLIC |
SYS |
PUBLIC |
| /etc |
SYS |
PUBLIC |
SYS |
PUBLIC |
| /test |
SYS |
PUBLIC |
PUBLIC |
PUBLIC |
D:>sess_sh
-user scott -password tiger
-service sess_iiop://myhostname:2481:mysdbid
--Aurora/ORB Session Shell--
--type "help" at the command line for help message
$ ls -l
Read Write Exec Owner Date Time Name Schema Class
Helper
PUBLIC SYS PUBLIC SYS Sep 07 08:59 bin/
PUBLIC SYS PUBLIC SYS Sep 07 08:59 etc/
PUBLIC PUBLIC PUBLIC SYS Sep 07 08:59 test/
$
From within sess_sh you can republish
EJB's, manage access rights and much more.
To initially 'publish' a EJB into
the database, developers use the deployejb command
line application. This will load and publish the
EJB for the developer. The developer must have write
access to publish objects. By default all published
objects will reside in the /test context.
The deployejb command will use
the 'deployment descriptor' file supplied by the
developer to control how the EJB is deployed to
the database. The suggested extension of the deployment
descriptor text file is *.ejb.
The interactive shell is highly
recommended over the command line tools when learning
how to manipulate the session namespace.
deployejb -republish -temp temp
-u myejbuser -p mypassword -s sess_iiop://myhostname:2481:mydbsid
-descriptor hello.ejb server.jar
Reading Deployment Descriptor...done
Verifying Deployment Descriptor...done
Gathering users...done
Generating Comm Stubs.....................................done
Compiling Stubs...done
Generating Jar File...done
Loading EJB Jar file and Comm Stubs Jar file...done
Generating EJBHome and EJBObject on the server...done
Publishing EJBHome...done
A deployed EJB can be removed
from the database via the remove command line program
or via sess_sh.
Troubleshooting
- It is critical that the
CLASSPATH settings are correct otherwise deployment
and compilation will not work.
- Work closely with the
developers with deployment to the database. It
is to easy to deploy everything to /test, learn
how the namespace works, security access for the
client to the deployed beans and understand the
publishing process.
- Re-learn multi-threaded
server (MTS), and how to tune it.
There is little tuning information that you can
gleam from the Java Shared Pool. Whilst in NT,
check Oracle Handle counts, memory usage and try
various MTS settings.
- Pick the correct JDK,
Oracle v8.1.5 only supports JDK 1.1.6, not version
2.
Environment Variable Hints
For those still have problems
with Environment settings, try these examples.
Compliation
CLASSPATH=.;d:\oracle\Ora81\lib\aurora_client.jar;
d:\oracle\Ora81\jdbc\lib\classes111.zip;d:\oracle\Ora81\sqlj\lib\translator.zip;
d:\oracle\Ora81\lib\vbjorb.jar; d:\oracle\Ora81\lib\vbjapp.jar;d:\jdk1.1.6;
d:\jdk1.1.6\lib;d:\jdk1.1.6\lib\classes.zip
Deployment
Don’t forget to include your server_generated.jar
file.
Command line Test
java -classpath %CLASSPATH% Client
sess_iiop://myhostname:2481:mydbsid /test/myHello
olcr olcr
Note
Refer to Oracle 8.1.5 documentation
for a comprehensive coverage of Jserver and EJB
implementation. Also, it is worth the effort to
understand and come to grips with Java terminology
and its architecture before working with the EJB
developer.
DBAsupport.com Home Page