wood burning stoves
The moose likes EJB and other Java EE Technologies and the fly likes javax.naming.NamingException: Could not dereference object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "javax.naming.NamingException: Could not dereference object" Watch "javax.naming.NamingException: Could not dereference object" New topic

javax.naming.NamingException: Could not dereference object

rajareddya reddy
Ranch Hand

Joined: Jul 23, 2011
Posts: 61
Hi, I am getting following exception while deploying application in jboss 5.0.1.

please help to resolve this exception.
Hebert Coelho
Ranch Hand

Joined: Jul 14, 2010
Posts: 754

Is there any other exception before that? Check the names that you are refering.

[uaiHebert.com] [Full WebApplication JSF EJB JPA JAAS with source code to download] One Table Per SubClass [Web/JSF]
Anjan Chowdhury

Joined: Nov 02, 2011
Posts: 3
to create an ejb3 application, you have to create the ejb jar. look at the console of eclipse IDE, while deploying the jar.
here the code that i create to make a simple EJB:


package ejb;

import javax.ejb.Stateless;

* Session Bean implementation class Anju
public class Anju implements AnjuLocal {

* Default constructor.
public Anju() {
// TODO Auto-generated constructor stub
public void yes(){
System.out.println("connected to jsp");
package ejb;
import javax.ejb.Local;

public interface AnjuLocal {
public void yes();
now create a dynamic web project. and create a html page:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
enter your name
<form method="get" action="AnjuServlet">
<input type="text" name="name">
<button type="submit" style="width : 92px; height : 25px;">
now create a servlet : src/web/AnjuServlet.java
package web;

import java.io.IOException;

import javax.ejb.EJB;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import ejb.AnjuLocal;

* Servlet implementation class AnjuServlet
public class AnjuServlet extends HttpServlet {
private static final long serialVersionUID = 1L;

private AnjuLocal al;
* @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
// TODO Auto-generated method stub

don't forget to configure the java build path. to add the ejb project in the web project.
now deploy the jar(ejb) file first .
then deploy the war(web) file.
and check .
I agree. Here's the link: http://aspose.com/file-tools
subject: javax.naming.NamingException: Could not dereference object
jQuery in Action, 3rd edition