Log from O'Reilly JBoss Workbook Exercise 4.1
//This session follows Exercise 4.1 in the JBoss Workbook for Enterprise JavaBeans, 3rd Edition (the link to the code and tutorial can be found on the FAQ page)
//At this point, I have already started a JBoss instance on the same host machine but configured for different ports than default (so that I can have multiple instances running on the same host). This causes a problem when running the client (see below).
asl mmeridet/tmp> mkdir oreilly
asl mmeridet/tmp> cd oreilly/
asl tmp/oreilly> unzip /afs/ece/class/ece749/ejb/ejbwJboss.Files.zip
Archive: /afs/ece/class/ece749/ejb/ejbwJboss.Files.zip
extracting: ejbwJboss.ExFiles.zip
inflating: ejbwJboss.eBook.pdf
asl tmp/oreilly> ls
ejbwJboss.ExFiles.zip ejbwJboss.eBook.pdf
asl tmp/oreilly> unzip ejbwJboss.ExFiles.zip
Archive: ejbwJboss.ExFiles.zip
asl tmp/oreilly> ls
Titan-JBoss-3.2-12d ejbwJboss.ExFiles.zip ejbwJboss.eBook.pdf
asl tmp/oreilly> cd Titan-JBoss-3.2-12d/
asl oreilly/Titan-JBoss-3.2-12d> ls
workbook
asl oreilly/Titan-JBoss-3.2-12d> cd workbook/
asl Titan-JBoss-3.2-12d/workbook> ls
ant ex04_2 ex05_3 ex06_3 ex07_3 ex10_1 ex13_1
build.xml ex05_1 ex06_1 ex07_1 ex08_1 ex12_1 ex13_2
ex04_1 ex05_2 ex06_2 ex07_2 ex08_2 ex12_2 exAppendixA
asl Titan-JBoss-3.2-12d/workbook> cd ex04_1/
asl workbook/ex04_1> ls
build.xml jndi src
//I modified the build.xml file to point to my server's deployment directory instead of the "default" server's directory (this step is not shown)
asl workbook/ex04_1> setenv JAVA_HOME /usr/local/j2sdk1.4.2_02
asl workbook/ex04_1> ${JAVA_HOME}/bin/java -version
java version "1.4.2_02"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_02-b03)
Java HotSpot(TM) Client VM (build 1.4.2_02-b03, mixed mode)
asl workbook/ex04_1> setenv JBOSS_HOME /afs/ece/class/ece749/ejb/jboss-3.2.3
asl workbook/ex04_1> ls $JBOSS_HOME
bin client docs lib server
asl workbook/ex04_1> setenv PATH /afs/ece/user/mmeridet/tmp/oreilly/Titan-JBoss-3.2-12d/workbook/ant/bin:$PATH
asl workbook/ex04_1> chmod +x ../ant/bin/ant chmod +x ../ant/bin/ant
asl workbook/ex04_1> ant
Buildfile: build.xml
prepare:
[mkdir] Created dir: /afs/ece.cmu.edu/usr/mmeridet/tmp/oreilly/Titan-JBoss-3.2-12d/workbook/ex04_1/build
[mkdir] Created dir: /afs/ece.cmu.edu/usr/mmeridet/tmp/oreilly/Titan-JBoss-3.2-12d/workbook/ex04_1/build/classes
compile:
[javac] Compiling 5 source files to /afs/ece.cmu.edu/usr/mmeridet/tmp/oreilly/Titan-JBoss-3.2-12d/workbook/ex04_1/build/classes
ejbjar:
[jar] Building jar: /afs/ece.cmu.edu/usr/mmeridet/tmp/oreilly/Titan-JBoss-3.2-12d/workbook/ex04_1/build/titan.jar
[copy] Copying 1 file to /afs/ece/class/ece749/ejb/jboss-3.2.3/server/mgm/deploy
BUILD SUCCESSFUL
Total time: 8 seconds
asl workbook/ex04_1> ant run.client_41a
Buildfile: build.xml
prepare:
compile:
ejbjar:
run.client_41a:
[java] javax.naming.NameNotFoundException: CabinHomeRemote not bound
[java] at sun.rmi.transport.StreamRemoteCall.exceptionReceivedFromServer(StreamRemoteCall.java:247)
[java] at sun.rmi.transport.StreamRemoteCall.executeCall(StreamRemoteCall.java:223)
[java] at sun.rmi.server.UnicastRef.invoke(UnicastRef.java:133)
[java] at org.jnp.server.NamingServer_Stub.lookup(Unknown Source)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:528)
[java] at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:507)
[java] at javax.naming.InitialContext.lookup(InitialContext.java:347)
[java] at com.titan.clients.Client_1.main(Client_1.java:19)
BUILD SUCCESSFUL
Total time: 3 seconds
//note: here I had to modify the jndi/jndi.properties file to refer to my own instance of the name server. The default name server port in JBoss is 1099. However, for this session, I used the ports-01 setting from JBoss 3.2.2 sample-bindings.xml (see http://www.jboss.org/index.html?module=bb&op=viewtopic&t=35955&postdays=0&postorder=asc&start10) for my own server instance so my name server port is 1199. I modified jndi.properties as follows
java.naming.provider.url=localhost:1199
instead of
java.naming.provider.url=localhost
asl workbook/ex04_1> ant run.client_41a
Buildfile: build.xml
prepare:
compile:
ejbjar:
run.client_41a:
[java] Master Suite
[java] 1
[java] 1
[java] 3
BUILD SUCCESSFUL
Total time: 4 seconds
asl workbook/ex04_1> ant run.client_41b
Buildfile: build.xml
prepare:
compile:
ejbjar:
run.client_41b:
[java] PK=1, Ship=1, Deck=1, BedCount=3, Name=Master Suite
[java] PK=2, Ship=1, Deck=1, BedCount=2, Name=Suite 100
[java] PK=3, Ship=1, Deck=1, BedCount=3, Name=Suite 101
[java] PK=4, Ship=1, Deck=1, BedCount=2, Name=Suite 102
[java] PK=5, Ship=1, Deck=1, BedCount=3, Name=Suite 103
[java] PK=6, Ship=1, Deck=1, BedCount=2, Name=Suite 104
...
[java] PK=96, Ship=3, Deck=4, BedCount=3, Name=Suite 405
[java] PK=97, Ship=3, Deck=4, BedCount=2, Name=Suite 406
[java] PK=98, Ship=3, Deck=4, BedCount=3, Name=Suite 407
[java] PK=99, Ship=3, Deck=4, BedCount=2, Name=Suite 408
[java] PK=100, Ship=3, Deck=4, BedCount=3, Name=Suite 409
BUILD SUCCESSFUL
Total time: 16 seconds
asl workbook/ex04_1>