File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JBoss/WildFly and the fly likes EXCEPTION Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » JBoss/WildFly
Bookmark "EXCEPTION "Name Not Found Exception: ejb not bound "" Watch "EXCEPTION "Name Not Found Exception: ejb not bound "" New topic

EXCEPTION "Name Not Found Exception: ejb not bound "

suchi verma

Joined: Apr 06, 2004
Posts: 9
hi all,
I have deployed my enterprise application on jboss-3.2.2.
It consists of an session bean which is accessed using a Servlet.
The servlet is in a seperate .war file and the ejb's in a .jar file.
However when I call the servlet which inturn calls the session bean.
I get the following error--
javax.naming.NameNotFoundException: ejb not bound
I have double checked my jboss.xml and the servlet lookup().
They both are the same.
The servlet code is-----
public void doGet(HttpServletRequest req,HttpServletResponse res)
throws ServletException,IOException{

try {
/*Properties props = new Properties();
props.put(Context.URL_PKG_PREFIXES, "org.jboss.naming rg.jnp.interfaces");
Context ctx = new InitialContext(props);*/
Context ctx = new InitialContext();
Object obj=ctx.lookup("java:comp/env/ejb/beans/SimpleBean");
SimpleHome home = (SimpleHome)PortableRemoteObject.narrow(obj,SimpleHome.class);
} catch (Exception NamingException) {
System.out.println("initexception is"+NamingException);}

try {
PrintWriter out=res.getWriter();
out.println("calling session bean");
Simple test = home.create();
if (test != null)
out.println("<br>Completed creation of remote EJBObject");
out.println("<br>Create returned null");
String s = test.getMessage();
out.println("<br>EJB Message: " + s);
what could be the problem...
I have been trying this since 2 weeks.
please help!
Walker Rustin
Ranch Hand

Joined: Mar 08, 2004
Posts: 37
I sometimes get this message when I start jboss without any deployment. More often than not the root cause is some kind of network error. Undeploy the application and restart jboss. Make sure that jobss starts properly.
Good luck!
- Walk

suchi verma

Joined: Apr 06, 2004
Posts: 9
thnx wallker...
will give it a try.
suchi verma

Joined: Apr 06, 2004
Posts: 9
hi walker
As u said I undeployed my ejb application and restarted jboss.
Then i deployed my ejb application.
BUT when I call the client servlet I get the follwing error on my log
name.notfound.exception:ejb not bound.
It fails to print the bean message.
What could be the problem???
plz reply.
romeo juliet

Joined: May 05, 2004
Posts: 9
Could you please print the whole exception along with deployment descriptor, jboss.xml, web.xml and jboss-web.xml .
Let's see what comes up!

romeo juliet

Joined: May 05, 2004
Posts: 9
Check this out. The author didn't post the solution though.
- Roger
suchi verma

Joined: Apr 06, 2004
Posts: 9
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "">
<web-app id="WebApp_ID">
<servlet id="Servlet_1082170647969">
<servlet-mapping id="ServletMapping_1082170647971">
<welcome-file-list id="WelcomeFileList_1082170647972">
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "">
<jboss-web id="jboss-web">
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 2.4//EN" "">
<jboss id="jboss">
<enterprise-beans id="ejb_bean">
<session id="my_session_ejb">

5-09 19:23:21,784 INFO [STDOUT] exception isjavax.naming.NameNotFoundException: ejb not bound
2004-05-09 19:23:21,789 INFO [STDOUT] do post exception isjava.lang.NullPointerException

Hope this suffices
roger verma

Joined: May 14, 2004
Posts: 3
This is very good. I would like to be able to make somthing simmilar. I am just switchig frum windows to linux and freebsd. Do you and am tinking of using java. Do you know of where i can learn how to make tools like this.
roger verma
Sunil Verma

Joined: May 21, 2004
Posts: 2
Looking for the answer to same question.
Can anybody please update me on this.

Ask A Question And You Will Get an Answer
martin Grofcik

Joined: Jun 02, 2004
Posts: 1
I have similar problem,

When I restart JBoss it works, after some time of inactivity I obtained the error.

when I call EJB from servlet I obtained name not bound,
same result is from EJB application.

I agree. Here's the link:
subject: EXCEPTION "Name Not Found Exception: ejb not bound "
It's not a secret anymore!