Forums Register Login

Head First -AdviceApp (page58) - Runtime error

+Pie Number of slices to send: Send
Hello,
I just embarked on my journey towards SCBCD and have been getting the following runtime error when I try to run the AdviceClient code after following HeadFirstEJB. Please let me know if I am missing somethign(have the j2ee.jar etc in my classpath and the j2ee server shows no errors, says Deployment of AdviceAppClient is completed.


C:\projects\advice> javac -classpath %CLASSPATH%;AdviceAppClient.jar AdviceClien
t.java

C:\projects\advice>java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient
java.rmi.RemoteException: CORBA BAD_OPERATION 0 No; nested exception is:
org.omg.CORBA.BAD_OPERATION: minor code: 0 completed: No
org.omg.CORBA.BAD_OPERATION: minor code: 0 completed: No
at java.lang.Class.newInstance0(Native Method)
at java.lang.Class.newInstance(Unknown Source)
at com.sun.corba.ee.internal.iiop.messages.ReplyMessage_1_2.getSystemExc
eption(ReplyMessage_1_2.java:93)
at com.sun.corba.ee.internal.iiop.ClientResponseImpl.getSystemException(
ClientResponseImpl.java:108)
at com.sun.corba.ee.internal.POA.GenericPOAClientSC.invoke(GenericPOACli
entSC.java:132)
at org.omg.CORBA.portable.ObjectImpl._invoke(Unknown Source)
at headfirst._Advice_Stub.getAdvice(Unknown Source)
at AdviceClient.go(AdviceClient.java:19)
at AdviceClient.main(AdviceClient.java:9)
Thanks
Siva
+Pie Number of slices to send: Send
Hello,
Think I figured part of the problem. Had a copy of AdviceAppClient.jar in the projects/advice folder and when I removed the same the previous errors vanished, still getting the following, trying further. Let me know if any of you have come across this problem.

Thanks
Siva


C:\projects\advice>java -cp %CLASSPATH%;AdviceAppClient.jar AdviceClient
java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unkno
wn Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at AdviceClient.go(AdviceClient.java:17)
at AdviceClient.main(AdviceClient.java:9)

C:\projects\advice>
+Pie Number of slices to send: Send
See the Errata of HFE. It may help. According to this Component interface name (Advice) should not be part of bean method name (getAdvice). so change bean method name to some thing else like getMessage and try?.

yamini
+Pie Number of slices to send: Send
Thanks Yamini. Looks like the version of J2EE RI that I have installed has that bug.

I was trying for the last 4 hrs without readig your posting and nothing helped, finally when I looked at your posting, and made the necessary changes, presto, it worked. Now, I will read the book with more confidence.

Thanks again
Siva
Get out of my mind! Look! A tiny ad!
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


reply
reply
This thread has been viewed 826 times.
Similar Threads
Error when trying the example on page 58...
Problem running HF Chap 1 example
Could not connect to localhost
Head First EJB
Help with compiling AdviceClient.java
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 29, 2024 00:14:19.