wood burning stoves*
The moose likes EJB Certification (SCBCD/OCPJBCD) and the fly likes Head First CH1 AdviceBean Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » EJB Certification (SCBCD/OCPJBCD)
Bookmark "Head First CH1 AdviceBean Example" Watch "Head First CH1 AdviceBean Example" New topic
Author

Head First CH1 AdviceBean Example

Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
I followed the chapter one example to the letter, but when I run the Client app I get a NoInitialContextException. Has anyone else had this problem?
[ January 02, 2005: Message edited by: Ben Dover ]
Jayant Kulkarni
Ranch Hand

Joined: Dec 02, 2003
Posts: 56
Hi, Please refer my earlier post on this, The topic is headed by -
head first ejb pg:57 client problem!!!please help urgent
Thanks,
Jayant
[ January 30, 2004: Message edited by: Jayant Kulkarni ]
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
great, thanks!
[ January 02, 2005: Message edited by: Ben Dover ]
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
Ok, I got over that ...ContextException above, now Im getting this:

java.lang.ClassCastException
at com.sun.corba.se.internal.javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at javax.rmi.PortableRemoteObject.narrow(Unknown Source)
at AdviceClient.go(AdviceClient.java:20)
at AdviceClient.main(AdviceClient.java:11)

What the? Everything is set up in as it should be, deployed ok, compiled client ok, client can see the necessary jars, j2ee server is running, changed the JNDI lookup name in the client code, but nada. Zip. Exception city.
[ January 02, 2005: Message edited by: Ben Dover ]
Jayant Kulkarni
Ranch Hand

Joined: Dec 02, 2003
Posts: 56
No it should not be that difficult.
See somewhere classcastexpcetion is coming ...look by line by line in the code..
Thanks,
Jayant
Kathy Sierra
Cowgirl and Author
Ranch Hand

Joined: Oct 10, 2002
Posts: 1572
Originally posted by Louis M-a-l-e-n-i-c-a:
Should it be this difficult to get past the first freaking chapter???

Well, kind of. *Should* it be? No. *Is* is? Yes. For almost everyone. On page 16 there's a picture of a woman saying that deployment is the trickiest part of the whole thing.
The *good* news is that once you get past all this, everything else is easier. So, yes it's hard to get past the first frickin' chapter because this is where you have to actually get it all working. We get the pain over early and then you can kick back...
Can you post your client code here and also your error message that you get in the terminal? We'll try to troubleshoot that. A ClassCastException in J2EE is no different than J2SE, except that there are several pieces where it could be failing. We'll get you through this. I know it's frustrating, and there are a zillion other people who have (or currently ARE) experiencing the same frustrations. Getting everything to work perfectly when you run the client is the trickiest part for sure, but once you get that... it should all be easier. Some people have taken up to a week to get it all finally working.
EJB does have a high frustration factor any time you move to a new app server (which, hopefully in the real world doesn't happen very often!).
So, post some more info and we'll keep trying.
Please hang in there. I'm telling you... it really will get easier
It's like going for a 10-kilometer run where the first 1K is straight up a very steep hill, but after that it's just nice rolling hills.
cheers,
Kathy
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
.
[ January 02, 2005: Message edited by: Ben Dover ]
Ben Dover
Ranch Hand

Joined: Jan 30, 2004
Posts: 91
.
[ January 02, 2005: Message edited by: Ben Dover ]
Jayant Kulkarni
Ranch Hand

Joined: Dec 02, 2003
Posts: 56
Well Kathy, its nice reply.
I had struggled for past 2 days(2.5 to be exact) but I found out at last.
Also the site wickedsmartly.com has good set of explianation.
I was struggeling on the class path setting of j2ee.jar...sun has placed that so casually somewhere, but thats one your require.
Anyway I am moving with satisfaction to next chapter(I almost finished it..!)
Thanks for the wonderful book and nice emails...(it gives you enthu..)
Cheers,
Jayant
 
jQuery in Action, 2nd edition
 
subject: Head First CH1 AdviceBean Example
 
Similar Threads
What is the plural of Algorithm ?
How do you print a character a random number of times?
Mashups: A Java Thing?
Sub class name- qualify clause
System.err or System.out