After reading a number of blog entries (blojsom, harri) on deploying blojsom to OC4J. It's time to provide a solution for the easiest command line way.
Although Harri's entry is very complete, he edits the Orion or OC4J server configuration files by hand (shudder). The better and less error prone solution is to use the command line tool admin.jar
Deploying EAR files with admin.jar
This will replace step 7 and 8
cd $ORACLE_HOME/j2ee/home
java -jar admin.jar ormi://hostname[:port] admin welcome -deploy -file /path/to/blojsom.ear -deploymentName blojsom
The generic code line is
java -jar admin.jar ormi://hostname[:port] username password -deploy -file <full-path-to-file> -deploymentName <deploymentName>
Setting the Context Root with admin.jar
This will replace step 9
cd $ORACLE_HOME/j2ee/home
java -jar admin.jar ormi://hostname[:port] -bindWebApp admin welcome blojsom blojsom http-web-site /blojsom
The generic code line is
java -jar admin.jar ormi://hostname[:port] username password -bindWebApp <deploymentName> <war-file-basename> <web-site-basename> <contextroot>
Conclusion
Editing the Orion/OC4J server XML configuration files is error prone and tedious. If you're able to use a tool for this, use it.
Bonus
These tools can be used in build scripts from Ant, too. See Steve Button's Entry for details.