[jboss-user] [EJB 3.0] - javax.naming.NameNotFoundException: MyEjb3 not bound :(

mailmustu do-not-reply at jboss.com
Thu May 31 08:14:23 EDT 2007


HI,

I wrote a simple bare minimum "Hello world" EJB 3.0, and deployed it in JBoss AS 4.0.5 with EJB 3 support.

I am getting an exception 
"javax.naming.NameNotFoundException: MyEjb3 not bound"

I am deploying "MyEjb3.ear" file using an ANT script.
If u need to see build.xml or other XML files I can paste them in next post.

Note: EJBTrail works perfectly fine in my app server, so I do not think there are any environmental issues.


here is the code:


HelloWorldBean.java  (Stateless session Bean)

  | package com.mustafa.ejb30;
  | import javax.ejb.Stateless;
  | 
  | @Stateless
  | 
  | public class HelloWorldBean implements HelloWorldLocal , HelloWorldRemote
  | {
  | 	public String sayHello(String name)
  | 	{
  | 		return("Hello "+name +" from your first EJB 3.0 component ...");
  | 	}
  | }
  | 



HelloWorldLocal.java  (Local Interface)

  | package com.mustafa.ejb30;
  | import javax.ejb.Local;
  | 
  | @Local
  | public interface HelloWorldLocal 
  | {
  |   public String sayHello(String name);
  | }	
  | 



index.jsp  (client jsp)

  | <%@page import = "com.mustafa.ejb30.*" %>
  | <%@page import = "javax.naming.*" %>
  | 
  | <html>
  | <head>
  | <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
  | <title>MyEjb3 test app</title>
  | </head>
  | 
  | <body>
  | <%
  | HelloWorldLocal hw = null;
  | InitialContext ctx = new InitialContext();
  | hw = (HelloWorldLocal) ctx.lookup("MyEjb3/HelloWorldBean/local");
  | 
  | String message = hw.sayHello("Mustafa!");
  | %>
  | Message is <%=message%>
  | 
  | </body>
  | </html>
  | 



Please let me know what am I missing.
Thanks in advance. 
- Mustafa
http://mustafak.co.nr

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4050114#4050114

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4050114



More information about the jboss-user mailing list