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 JNDI problem 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 "JNDI problem" Watch "JNDI problem" New topic
Author

JNDI problem

Robert Bonslater
Greenhorn

Joined: Jan 30, 2005
Posts: 28
When I try to bind name and entity using JNDI what does this mean:

log4j:WARN No appenders could be found for logger (org.jnp.interfaces.NamingCont
ext).
log4j:WARN Please initialize the log4j system properly.
javax.naming.CommunicationException: Receive timed out [Root exception is java.n
et.SocketTimeoutException: Receive timed out]


I added some String executions to find the problem and it is obviously at
ctx.bind(name, entity);
Here is a piece if my code:

try {
System.out.println("Here");
// For clarity, command-line args in local vars
String name = args[0];
Integer entity = Integer.valueOf(args[1]);
System.out.println("Here");
// Access the initial context.
Context ctx = new InitialContext();
System.out.println("Context");
// Bind name to entity in the Context.
ctx.bind(name, entity);
System.out.println("Here");
// To test, retrieve the entity through the name
Integer retrieved = (Integer) ctx.lookup(name);
System.out.println("From lookup: " + retrieved);
}
catch(NamingException e) { System.err.println(e); }
catch(NumberFormatException e) { System.err.println(e); }
}
}
[ April 04, 2005: Message edited by: Robert Bonslater ]
Yuan Ye
Ranch Hand

Joined: Mar 05, 2003
Posts: 172
Is your AS started before the program, looks like sth wrong with the system environment.
Clemens Tolboom
Greenhorn

Joined: Feb 15, 2005
Posts: 12
As far as i can see the log4j warning is about a misconfigured log4j.xml or log4j.properties file. Have you checked this file?

Anyway ... it's just a warning ... you app should still work.

log4j is 'just' a logging framework.
[ April 06, 2005: Message edited by: Clemens Tolboom ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JNDI problem