Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Head First CH1 AdviceBean Example

 
Ben Dover
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
great, thanks!
[ January 02, 2005: Message edited by: Ben Dover ]
 
Ben Dover
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Rancher
Posts: 1589
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.
[ January 02, 2005: Message edited by: Ben Dover ]
 
Ben Dover
Ranch Hand
Posts: 91
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
.
[ January 02, 2005: Message edited by: Ben Dover ]
 
Jayant Kulkarni
Ranch Hand
Posts: 56
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic