All, can someone see why I am getting a ClassCastException from this snipet code:


The error comes when casting the object from the initialcontext lookup into Database.
--------------------------------------------------------------------------
import javax.naming.InitialContext;
import javax.naming.NamingException;
import javax.sql.DataSource;


import org.exolab.castor.jdo.Database;

public class DbService {
    private static Database database;
    private static InitialContext initContext;

private static Database createDatabase() throws NamingException{
if(initContext == null)
initContext = new InitialContext(); database = (Database) initContext.lookup("java:comp/env/jdo/test"); return database;
}
}
------------------------------------------------------


Any help?

Thanks,
Luis

----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev




Reply via email to