I'm still trying to get the examples from Monson-Haefel's "Enterprise 
JavaBeans" (2nd Edition) to run in jBoss.

When I deploy the travelagent.jar file (a SessionBean), jBoss complains 
that it can't find the Cabin class files (the EntityBean). The Cabin's 
client works fine, so I know the Cabin bean deploys correctly.

How can I use jboss.xml to tell jBoss to add a directory to the classpath? 
I know I can do this by adding the classpath to jboss.conf and restarting 
jBoss, but this isn't how autodeploy is supposed to work. (Is it?)

Here's what I have so far.

1) Download and install the examples.zip file:
su
cd /usr/local/jboss/examples
mkdir oreilly
cd oreilly
lynx \
   -source \
   http://www.oreilly.com/catalog/entjbeans2/chapter/examples.zip \
   > examples.zip
unzip examples.zip
rm examples.zip

2) Compile and deploy the beans:

cd chapter4/EJB11

javac \
   -classpath /usr/local/jboss/lib/ext/ejb.jar \
   com/titan/cabin/Cabin*.java
cp com/titan/cabin/ejb-jar.xml META-INF/ejb-jar.xml
jar cvf cabin.jar \
   com/titan/cabin/Cabin*.class \
   META-INF/ejb-jar.xml

javac \
   -classpath .:/usr/local/jboss/lib/ext/ejb.jar \
   com/titan/travelagent/TravelAgent*.java
cp com/titan/travelagent/ejb-jar.xml META-INF/ejb-jar.xml
jar cvf travelagent.jar \
   com/titan/travelagent/TravelAgent*.class \
   META-INF/ejb-jar.xml

cp cabin.jar /usr/local/jboss/deploy/
cp travelagent.jar /usr/local/jboss/deploy/

3) Compile and run the clients:

javac \
   -classpath .:/usr/local/jboss/lib/ext/ejb.jar \
   com/titan/cabin/Client*.java

java \
   -classpath .:/usr/local/jboss/client/ejb.jar:/usr/local/jboss/client/jnp-cl
ient.jar:/usr/local/jboss/client/jboss-client.jar \
   com.titan.cabin.Client_1

java \
   -classpath .:/usr/local/jboss/client/ejb.jar:/usr/local/jboss/client/jnp-cl
ient.jar:/usr/local/jboss/client/jboss-client.jar \
   com.titan.cabin.Client_2

java \
   -classpath /usr/local/jboss/lib/ext/ejb.jar:/usr/local/jboss/client/jnp-cli
ent.jar:/usr/local/jboss/client/jboss-client.jar:. \
   com.titan.travelagent.Client_1

I also have Windows .BAT files and Unix .sh files to do all of this stuff. 
I plan on adding another trail to the jBoss documentation when I figure it 
all out, so your assistance here will help more than just me.

-- Ken Jenks, http://abiblion.com/

    Tools for reading.


--
--------------------------------------------------------------
To subscribe:        [EMAIL PROTECTED]
To unsubscribe:      [EMAIL PROTECTED]
Problems?:           [EMAIL PROTECTED]

Reply via email to