You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by Softwareentwicklung Hauschel <So...@Hauschel.de> on 2003/01/23 18:00:13 UTC
JNDI Problem
Hey all,
I've created a Datasource wit Tomcat Admin Tool.
The JNDI Name is: jaxsdb.
Now i want to load this resource:
public DataSource getds()
{
Category cat = Category.getInstance("de.hauschel.wapen.be.BEFactory");
cat.debug("->getds()");
try
{
// Obtain our environment naming context
Context initCtx = new InitialContext();
Context envCtx = (Context) initCtx.lookup("java:comp/env");
// Look up our data source
DataSource ds = (DataSource)envCtx.lookup("jaxsdb");
cat.debug("<-getds()");
return ds;
}
catch (NamingException e)
cat.debug("EXCEPTION");
cat.debug(e.getMessage());
}
cat.debug("<-getds()");
return null;
}
But i always become the same NamingException: Name jaxsdb is not bound in
this Context
Anybody knows the Problem ?
thanks,Fredy
--
To unsubscribe, e-mail: <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>