File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
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
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "How to resolve NoInitialContextException? " Watch "How to resolve NoInitialContextException? " New topic
Author

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..

Exception
---------


Folder Structure
---------------------


Coding
-------

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

Joined: Jul 20, 2005
Posts: 10046
    
163

You need to have a jndi.properties 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 jndi.properties 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
Marshal

Joined: Jul 20, 2005
Posts: 10046
    
163

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 jndi.properties should contain. Give it a try and let us know if that doesnt work.
Sunil Huilgol
Greenhorn

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: http://aspose.com/file-tools
 
subject: How to resolve NoInitialContextException?