• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Where to put jndi.properties

 
Timothy Sam
Ranch Hand
Posts: 751
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I have a client and an EJB deployed in JBoss. They're in the same machine. My jndi.jar is in the same directory as my client and I have the following folder structure for my client

MyApp
- Client
- MyApp.java
- jndi.properties

However, when I try to run my client program I get the following error...


Exception in thread "main" javax.naming.NoInitialContextException: Need to speci
fy class name in environment or system property, or as an applet parameter, or i
n an application resource file: java.naming.factory.initial
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.lookup(Unknown Source)
at client.MyApp.main(Unknown Source)



Source code looks like this...

 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is jndi.properties in the Client folder ?
 
sudha swami
Ranch Hand
Posts: 186
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
You should put the jndi.properties in the following folder:
\jboss\server\default\conf. Hope this works.
regards
sudha
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by sudha swami:
Hi,
You should put the jndi.properties in the following folder:
\jboss\server\default\conf. Hope this works.
regards
sudha


How would putting jndi.properties help when running the client side code ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic