Context ctx = new InitialContext();
getLog().debug(++test + "- " + "Looking up the home AllTypes...");
AllTypesHome allTypesHome;
try
{
allTypesHome = (AllTypesHome)ctx.lookup("AllTypes");
if (allTypesHome == null)
{
throw new Exception("abort");
}
getLog().debug("OK");
}
catch (Exception e)
{
getLog().debug("Could not lookup the context: the beans are probably not deployed");
getLog().debug("Check the server trace for details");
log.debug("failed", e);
throw new Exception();
}
getLog().debug(++test + "- " + "Calling findByPrimaryKey on AllTypesHome with name seb...");
AllTypes allTypes = null;
try
{
allTypes = allTypesHome.findByPrimaryKey("seb");
}
catch (Exception e)
{
getLog().debug(e.getMessage());
}
if (allTypes == null)
{
getLog().debug("not found OK");
getLog().debug(++test + "- " + "Calling create on AllTypesHome with name seb...");
allTypes = allTypesHome.create("seb");
}
if (allTypes != null)
{
getLog().debug("OK");