wood burning stoves 2.0*
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
Author

EXCEPTION "Name Not Found Exception: ejb not bound "

suchi verma
Greenhorn

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.INITIAL_CONTEXT_FACTORY,"org.jnp.interfaces.NamingContextFactory");
props.put(Context.PROVIDER_URL,"localhost:1099");////chetak:8080/
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 {
res.setContentType("text/html");
PrintWriter out=res.getWriter();
out.println("calling session bean");
Simple test = home.create();
if (test != null)
out.println("<br>Completed creation of remote EJBObject");
else
out.println("<br>Create returned null");
String s = test.getMessage();
out.println("<br>EJB Message: " + s);
out.close();
----------------------------------------------------------------
jboss.xml
<ejb-ref-name>beans/Simple</ejb-ref-name>
<jndi-name>ejb/beans/SimpleBean</jndi-name>
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


SCBCD
suchi verma
Greenhorn

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

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
Greenhorn

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!


SCBCD
romeo juliet
Greenhorn

Joined: May 05, 2004
Posts: 9
Check this out. The author didn't post the solution though.
http://jboss.org/index.html?module=bb&op=viewtopic&t=49359
Cheers.
- Roger
suchi verma
Greenhorn

Joined: Apr 06, 2004
Posts: 9
WEB.XML
=================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app id="WebApp_ID">
<servlet id="Servlet_1082170647969">
<servlet-name>ClientServlet1</servlet-name>
<servlet-class>beans.ClientServlet1</servlet-class>
</servlet>
<servlet-mapping id="ServletMapping_1082170647971">
<servlet-name>ClientServlet1</servlet-name>
<url-pattern>/ClientServlet1</url-pattern>
</servlet-mapping>
<welcome-file-list id="WelcomeFileList_1082170647972">
<welcome-file>index.html</welcome-file>
</welcome-file-list>
</web-app>
=================================================
JBOSS-WEB.XML
==================================================
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE jboss-web PUBLIC "-//JBoss//DTD Web Application 2.3//EN" "http://www.jboss.org/j2ee/dtd/jboss-web_3_2.dtd">
<jboss-web id="jboss-web">
<ejb-ref>
<ejb-ref-name>beans/SimpleBean</ejb-ref-name>
<jndi-name>ejb/SimpleHome</jndi-name>
</ejb-ref>
</jboss-web-app>
====================================================
JBOSS.XML
=====================================================
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jboss PUBLIC "-//JBoss//DTD JBOSS 2.4//EN" "http://www.jboss.org/j2ee/dtd/jboss_2_4.dtd">
<jboss id="jboss">
<enterprise-beans id="ejb_bean">
<session id="my_session_ejb">
<ejb-name>beans/SimpleBean</ejb-name>
<jndi-name>ejb/SimpleHome</jndi-name>
</session>
</enterprise-beans>
</jboss>
===========================================================

HERES THE LOG MESSAGE
=======================
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
Greenhorn

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.
thanks
roger verma
Sunil Verma
Greenhorn

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
Greenhorn

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.

Martin
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: EXCEPTION "Name Not Found Exception: ejb not bound "
 
Similar Threads
NameNotFoundException in EJB? could anyone tell me?
NameNotFoundException in EJB? could anyone tell me?
About Remot session bean
ERROR DURING DEPLOYMENT OF SESSION BEANS!!HELP
Writing myfirst SessionBean