try {
InitialContext ic = new InitialContext();
EJBThreadsHome testHome = (EJBThreadsHome) ic.lookup("threads");
EJBThreads ejbTest;
while(runMe)
{
ejbTest = null;
try {
ejbTest = testHome.findByPrimaryKey("test1");
}
catch (Exception e)
{
// Bean wasn't found create it
try {
ejbTest = testHome.create("test1");
}
catch (Exception e2)
{
log.debug("****Create exception: " + e2);