Context look up failed with JBOSS 6
samwun9988 Sep 28, 2011 11:05 PMHi,
I got the following error when during the deployment with Jboss 6:
2011-09-29 12:33:44,743 INFO [org.jboss.web.tomcat.service.deployers.TomcatDeployment] (HDScanner) deploy, ctxPath=/CategoryClient2-web
2011-09-29 12:33:44,781 INFO [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/CategoryClient2-web]] (HDScanner) Initializing Spring root WebApplicationContext
2011-09-29 12:33:44,827 INFO [STDOUT] (HDScanner)
2011-09-29 12:33:44,827 INFO [STDOUT] (HDScanner)
2011-09-29 12:33:44,827 INFO [STDOUT] (HDScanner) Hello ...
2011-09-29 12:33:44,828 ERROR [STDERR] (HDScanner) javax.naming.NameNotFoundException: CategoryClient2-ejb not bound
CategoryFinderController.java:
@Controller
//@SessionAttributes("categoryFinder")
@RequestMapping("/category")
@Transactional
public class CategoryFinderController {
private static final Logger logger = Logger.getLogger(CategoryFinderController.class);
public CategoryFinderController() {
logger.info("calling CategoryFinderController");
List<CategorySubcategories> result = null;
System.out.println("\n\n\t Hello ...");
logger.info("calling CalculatorFinderController");
try {
InitialContext ic = new InitialContext();
// Obtain the application component's ENC
CallerLocal remote = (CallerLocal) ic.lookup("java:global/CategoryClient2-ear/CategoryClient2-ejb/CallerName!ix.category.remote.CallerLocal");
result = (List<CategorySubcategories>) remote.findAll();
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("ONE----result = " + result.size());
}
// // setup binder for adding/editing products
@InitBinder
protected void initBinder(WebDataBinder binder) {
logger.info("callling initBinder");
SimpleDateFormat dateFormat = new SimpleDateFormat("MM/dd/yyyy", Locale.US);
binder.registerCustomEditor(Boolean.class, new CustomBooleanEditor(false));
binder.registerCustomEditor(Date.class, new CustomDateEditor(dateFormat, true));
binder.registerCustomEditor(String.class, new StringTrimmerEditor(true));
}
//
// // default render page - search
@RequestMapping
public String showSearch(Model model) {
logger.info("calling default submit method showSeach()");
model.addAttribute("totalResults", Integer.valueOf(0));
return "categoryFinderSearch";
}
I have attached an ear file here for reference.
Any suggestion would be very appreciated.
Thanks
Sam