This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes How to resolve NoInitialContextException? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to resolve NoInitialContextException? " Watch "How to resolve NoInitialContextException? " New topic

How to resolve NoInitialContextException?

Mark Henryson
Ranch Hand

Joined: Jul 11, 2005
Posts: 200
I am using, Head First EJB. I have encountered some problem while executing the example given in that book:

I am using Sun Application Server 8.. Windows 2000..


Folder Structure


[ November 06, 2006: Message edited by: Mark Henryson ]
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

You need to have a file in the client's classpath. I am not sure about the exact contents for Sun App Server.

[My Blog] [JavaRanch Journal]
Micheal John
Ranch Hand

Joined: Nov 01, 2006
Posts: 344
Where the will be?

Micheal John
SCJP 1.4 (86%), SCWCD 1.4 (86%), SCBCD 1.3 (85%), SCDJWS (Just Started...) - Satisfaction Lies in Our EFFORT, Not in the ATTAINMENT
Jaikiran Pai

Joined: Jul 20, 2005
Posts: 10441

It should be in the classpath of the client which is doing the lookup. I am not quite sure about the contents for the Sun App Server. Here's what i could come up with the help of Google:

This is what your should contain. Give it a try and let us know if that doesnt work.
Sunil Huilgol

Joined: Jan 22, 2006
Posts: 8
You can use this to remove the exception :

You can use above context to look up your EJB.
I agree. Here's the link:
subject: How to resolve NoInitialContextException?
It's not a secret anymore!