• Post Reply Bookmark Topic Watch Topic
  • New Topic

netbeans 5.5 + Jboss 4.0.4 + EJB 3.0  RSS feed

 
mbouna ismo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

I need a help.It is very important for me.

I am doing the �EJB 3.0 Enterprise Beans for the JBoss Application Server" tutorial (http://www.netbeans.org/kb/55/ejb30-jboss.html):


I have an entity beans NewsEntity and a �session bean facade� for the NewsEntity entity class. This is hoew i call my beans:

private NewsEntityFacadeLocal lookupNewsEntityFacade() {
try {
Context c = new InitialContext();
return (NewsEntityFacadeLocal) c.lookup("NewsApp/NewsEntityFacade/local");
}
catch(NamingException ne) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne);
throw new RuntimeException(ne);
}
}

I am running Netbeans 5.5, JDK 1.5.09 bundled with JBoss 4.0.4 on Windows XP.

I have got the following error when trying to test these codes using a browser to open up the url link "http://localhost:8080/NewsApp-war/ListNews", which is a servlet called ListNews:

java.lang.RuntimeException: javax.naming.NameNotFoundException: NewsApp not bound
web.ListNews.lookupNewsEntityFacade(ListNews.java:95)
web.ListNews.processRequest(ListNews.java:48)
web.ListNews.doGet(ListNews.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)



Please,how can help me?
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is hoew i call my beans:

private NewsEntityFacadeLocal lookupNewsEntityFacade() {
try {
Context c = new InitialContext();
return (NewsEntityFacadeLocal) c.lookup("NewsApp/NewsEntityFacade/local");
}
catch(NamingException ne) {
Logger.getLogger(getClass().getName()).log(Level.SEVERE,"exception caught" ,ne);
throw new RuntimeException(ne);
}
}


I looked at that tutorial and it appears that you are doing the lookup using the wrong jndi name. The tutorial uses a different jndi name:



Change the jndi-name that you are passing to the lookup method to match the one mentioned in the tutorial
 
mbouna ismo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Not,The tutorial uses a different jndi "NewsApp/NewsEntityFacade/local".

When I used c.lookup("java:comp/env/ejb/NewsEntityFacade"),I got the following error:

java.lang.RuntimeException: javax.naming.NameNotFoundException: ejb not bound
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
To make sure what the jndi name is do the following:

- Go to http://localhost:8080/jmx-console
- On that screen search for the JNDIView service and click on it
- On the page that comes up, click the button next to the list() method.
- You will see a list of jndi names and the objects that are bound in the JNDI tree. Check what's the jndi-name for your bean. In case, you are not able to understand the output of the JNDIView, post that output here.
[ February 28, 2007: Message edited by: Jaikiran Pai ]
 
mbouna ismo
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. But my bean don�t exist in the "list of jndi names". That is the veritable problem. When I create a simple session bean, it�s work fine but when I create a �session bean for entity bean�, it don�t exist in the "list of jndi names" after deployment.
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I havent used NetBeans IDE before so dont have much inputs. Maybe someone with NetBeans experience will be able to help you out.
 
neelam kumari
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I received the following error message after unsuccessfully trying to test tutorial EJB 3.0 Enterprise Beans for the JBoss Application Server (http://www.netbeans.org/kb/55/ejb30-jboss.html ) by accessing servlet on http://localhost:8080/NewsApp-war/ListNews on my PC:

type Exception report

message

description The server encountered an internal error () that prevented it from fulfilling this request.

exception

java.lang.RuntimeException: javax.naming.NameNotFoundException: NewsApp not bound
web.ListNews.lookupNewsEntityFacade(ListNews.java:95)
web.ListNews.processRequest(ListNews.java:48)
web.ListNews.doGet(ListNews.java:68)
javax.servlet.http.HttpServlet.service(HttpServlet.java:697)
javax.servlet.http.HttpServlet.service(HttpServlet.java:810)
org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:96)


note The full stack trace of the root cause is available in the Apache Tomcat/5.5.17 logs.

I am running Netbeans 5.5, JDK 1.5.09 bundled with JBoss 4.0.4 on Windows XP.

This is my first EJB exercise and would appreciate some guidances.

thanks in advance,
neelam
 
Daniel S.
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I had the same problem ten minutes ago. Replace java:comp/env/ejb/NewsEntityFacade use ... .
It worked fine after the second deployment.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65833
134
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"Daniel S.",

There aren't many rules that you need to worry about here on the Ranch, but one that we take very seriously regards the use of proper names. Please take a look at the JavaRanch Naming Policy and adjust your display name to match it.

In particular, your display name must be a first and a last name separated by a space character, and must not be obviously fictitious.

Thanks!
bear
JavaRanch Sheriff
 
Nick Nguyen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have the same problem. And it's not because i didn't get it right. It worked last night, and today I get the exception
java.lang.RuntimeException: javax.naming.NameNotFoundException:

So what's going on? what I missed?

Thank you,
 
Jaikiran Pai
Sheriff
Posts: 10447
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you using the same application that was mentioned by the original poster? Post your exception stacktrace and more details about your application.
 
Nick Nguyen
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes it's the same application (EJB training using JBOSS 4.0.4 on Netbeans 5.5. ) And it will work again if I delete / undeploy everything and recreate it from scratch....
Very strange.
 
g Pa
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I tried this tutorial, and got the following exception.

SEVERE: exception caught
javax.naming.NameNotFoundException: ejb not bound
at org.jnp.server.NamingServer.getBinding(NamingServer.java:529)
at org.jnp.server.NamingServer.getBinding(NamingServer.java:537)
at org.jnp.server.NamingServer.getObject(NamingServer.java:543)
at org.jnp.server.NamingServer.lookup(NamingServer.java:267)
at org.jnp.server.NamingServer.lookup(NamingServer.java:270)
at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:627).

I then searched on google, and came here.


I tried what Jaikiran Pai, suggested, went to http://localhost:8080/jmx-console, and checked under
Global JNDI Namespace, and found the following entry.

+- NewsApp (class: org.jnp.interfaces.NamingContext)
| +- NewEntityFacade (class: org.jnp.interfaces.NamingContext)
| | +- local (proxy: $Proxy115 implements interface ejb.NewEntityFacadeLocal,interface org.jboss.ejb3.JBossProxy,interface javax.ejb.EJBLocalObject).


I had the jms name wrong in ListNews.java, modified it to NewsApp/NewEntityFacade/local, and my application worked fine.

Notice the s missing in NewEntityFacade, thanks Jaikiran Pai.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!