Results 1 to 3 of 3
- 01-26-2009, 12:07 AM #1
Member
- Join Date
- Jan 2009
- Posts
- 1
- Rep Power
- 0
javax.naming.NameNotFoundException: bean not bound
I am trying to build an EE project that has a EJB module and a web module. I am using servlet as my client to call EJB. here is my code:
public class WebClient extends HttpServlet
{
private Context ctx;
@EJB
HelloWorld bean ;
public void doGet(HttpServletRequest request, HttpServletResponse response)throws IOException, ServletException
{
response.setContentType("text/html;charset=ISO-8859-1");
PrintWriter out = response.getWriter();
try {
if (bean != null)
{
bean.setName("Roman");
out.println("<html><body>");
out.println("This is a simple EJB-Bean-Test: ");
out.println(bean.getGreeting());
out.println("</body></html>");
}
else
{
out.println("<html><body>");
out.println("Lookup for bean failed!");
out.println("</body></html>");
}
}catch (Exception e) {
System.out.println("exception"+e);
e.printStackTrace();
}
}
}
Please tell me what is going wrong?I have been spending close to a week on this. :(
Thanks,
Sirisha
- 01-26-2009, 11:27 AM #2
Member
- Join Date
- Jan 2009
- Location
- italy
- Posts
- 16
- Rep Power
- 0
When you write
@EJB
HelloWorld bean ;
HelloWorld is the bean implementation or interface?
If It is interface, what type of (Local or Remote)?Article and examples about Java EE world
http://programmaremobile.blogspot.com
- 04-01-2009, 10:51 AM #3
Member
- Join Date
- Apr 2009
- Posts
- 3
- Rep Power
- 0
Similar Threads
-
Exception in thread "main" javax.naming.NameNotFoundException: jmx not bound
By Vartika in forum Advanced JavaReplies: 2Last Post: 08-07-2009, 10:21 PM -
javax.microedition.io/ javax.bluetooth
By ahtiven in forum New To JavaReplies: 3Last Post: 01-13-2009, 02:54 PM -
[SOLVED] String out of bound error
By maxb in forum New To JavaReplies: 4Last Post: 12-01-2008, 02:32 PM -
ArrayIndexout of Bound exception
By Preethi in forum New To JavaReplies: 2Last Post: 02-14-2008, 09:40 PM -
javax.naming.NameNotFoundException: ejb/RatingEJB
By Daniel in forum Enterprise JavaBeans (EJB)Replies: 2Last Post: 06-29-2007, 02:12 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks