Hello!
I was able to get the first Advice bean project to work (I too followed the book exactly), but there was an initial problem. I got a "CORBA BAD_OPERATION" error due to a "headfirst._Advice_Stub.getAdvice(unknown Source)" error.
It turns out there is a "bug" in the RI that the Wickedly Smart website alerts us to:
http://www.wickedlysmart.com/HeadFirst/HeadFirstEJB/HeadFirstEJBNotes.html So I changed all the referenes/uses of the method in the bean from "getAdvice()" to "getAdviceMessage()" and it now seems to work fine.
I started the J2EE server from the c:\projects\advice directory and I do not seem to get the "file not found error"... Here is my ouptut in the command-prompt window:
C:\Projects\advice>j2ee -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/DB2, url =
jdbc:cloudscape:rmi:CloudscapeDB;create=true
<snip>
Binding DataSource, name = jdbc/XACloudscape__xa, dataSource = COM.cloudscape.core.RemoteXaDataSource@161581
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
<snip>
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3.1
Starting web service at port: 9191
J2EE SDK/1.3.1
J2EE server startup complete.
Compiling C:\j2sdkee1.3.1\repository\xplaptop\gnrtrTMP\AdviceApp\headfirst\AdviceBean_RemoteHomeImpl.java ....
Compiling C:\j2sdkee1.3.1\repository\xplaptop\gnrtrTMP\AdviceApp\headfirst\AdviceBean_EJBObjectImpl.java ....
rmic headfirst.AdviceBean_RemoteHomeImpl...
rmic headfirst.AdviceBean_EJBObjectImpl...
rmic headfirst.Advice...
rmic headfirst.AdviceHome...
Application AdviceApp deployed.
session context
ejb create
in getAdviceMessage
And then I tried starting the J2EE RI server at the root -- C:\
C:\>j2ee -verbose
J2EE server listen port: 1050
Naming service started:1050
Binding DataSource, name = jdbc/DB2, url = jdbc:cloudscape:rmi:CloudscapeDB;create=true
<snip>
Starting JMS service...
Initialization complete - waiting for client requests
Binding: < JMS Destination : jms/Queue , javax.jms.Queue >
<snip>
Starting web service at port: 8000
Starting secure web service at port: 7000
J2EE SDK/1.3.1
Starting web service at port: 9191
J2EE SDK/1.3.1
Loading jar:/C:/j2sdkee1.3.1/repository/xplaptop/applications/AdviceApp1073850255481Server.jar
J2EE server startup complete.
in session context
in ejb create
in getAdviceMessage
Here is the output from the client window:
C:\Projects\advice>java AdviceClient
A bird in the hand... is uncomfortable
C:\Projects\advice>java AdviceClient
A watched pot... is boring
C:\Projects\advice>java AdviceClient
Early to bed and early to rise... means you can't watch Letterman
Did you try emailing the authors at:
EJBErrata@wickedlysmart.com Good Luck