• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

HFEJB AdviceClient

 
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
After deploying Advice bean from HFEJB when I try to run it, I get following error.

javax.naming.NameNotFoundException: Adivsor not found
<<no stack trace available>>


Any ideas, help is greatly appreciaed.
Regards
 
Alfred Harre
Ranch Hand
Posts: 73
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
This error was because the source code for AdviceClient.java provided by the authors tries to look up for "Test1" on JNDI look up where as they advise to register it as "Advisor" when deploying and hence JNDI lookup fails.
Thanks God, I have succeeded in compiling and running first example after struggling one whole week :roll:
I would like to suggest following for others who are starting first chapter of HFEJB
1. Use same version of J2SDK and J2EE (1.3)
2. On windows use following command to compile
javac -classpath %CLASSPATH%;c:<YOUR_PATH>AdviceAppClient.jar AdviceClient.java (command given in book is good for Linux)
3. If you are using source code provided by authors make sure you open AdviceClient.jar and pay attention to this line
Object o = ic.lookup("Test1"); // replace with YOUR JNDI name for the bean
4. These notes by authors are also helpful NOTES BY AUTHORS
5. You might wana go through this errata by the publisher ERRATA
I hope no one else will stuck on the very first chapter for a week as I have been :roll:
Regards and thanks to all those who really helped me. Specail thanks to Dale_Seng for really helping me.
Regards
[ May 06, 2004: Message edited by: Alfred Harre ]
 
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I also had a bit of a hard time with the so-called "Advice Guy".

What was weird was the getAdvice() method was throwing a RemoteException
when I was trying to run my client (from eclipse).

I tried changing the getAdvice() implementation to returning a simple String instead of getting a random entry from the array and it worked!

I then tried moving the contents of my getAdvice() method and the array containing the advices to the client to check if there were errors with it.
But it worked fine when I transferred the code to the client. I'm still wondering what caused the problem.

I'll try to post here the complete stack trace tomorrow.

Thanks a lot!
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here goes my stack trace:



 
Cowgirl and Author
Posts: 1589
5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The infamous "CORBA.BAD_OPERATION" error in the Advice Guy tutorial is virtually always caused by a bug in the J2EE RI (on most Windows implementations) and is detailed here;

CORBA ERROR notes for advice guy

The short version is, if you rename the method to something that doesn't match the interface name (instead of interface Advice and a method getAdvice(), change the method name to *anything else* like getMessage()). This is indeed a CORBA issue that *can* crop up, and as you all know from being Java folks--not a Java limitation or an RMI problem, or anything that *you* have done wrong. We made the mistake of testing this ONLY on the Linux version of the RI, under OSX (which, to show my inherent bias, always works perfectly )

Again, our apologies for those of you who had to struggle with it. Wish I could say that it's helping you learn EJB, but it's probably more like an exercise in patience.

cheers,
Kathy
 
Paul Michael
Ranch Hand
Posts: 697
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks so much Kathy! (and Bert too of course)

For making "learning EJB" fun...




---
*** Volunteer Your PC ***

Help in the research of the following diseases:

Alzheimer's, Mad Cow (BSE), CJD, ALS, and Parkinson's.
http://www.stanford.edu/group/pandegroup/folding/ (Team 2291/Philippines)

Cancer, Anthrax, and Smallpox.
http://www.grid.org (Team Philippines)
reply
    Bookmark Topic Watch Topic
  • New Topic