[jboss-user] [Beginners Corner] - Deploy Problem: JBoss, EJB3, NetBeans and the web.xml file s

wls do-not-reply at jboss.com
Mon Sep 25 17:52:20 EDT 2006


Admittedly, I'm a beginner here, so go gentle on me.

I'm using the NetBeans 5.5 beta 2 with the JBoss 4.0.4 GA installer, which supposedly includes EJB3 stuff, from http://www.netbeans.org/products/ide/ and so far things had been working perfectly.  

That was until I did right clicked "Enterprise Resources > Call Enterprise Bean" from the pop up window in an servlet of an Enterprise Application and referenced a working bean.

Now my question isn't one of using the NetBeans environment, but rather that after it generated the code, which did compile perfectly, I started getting errors that my bean could not be deployed to JBoss due to an error in the web.xml file.

Looking in the web.xml file, which I assume is some kind of deployment file (hey, I said I was new to J2EE), there is a new element in the xml called <ejb-local-ref>.  And it's on this xml section that JBoss seems to be choking.

Inside http://www.netbeans.org/kb/55/ejb30-jboss.html, it suggests that JBoss automatically adds session beans to the JNDI namesspace, and thus one should remove the ejb-local-ref from the web.xml file by going to the WEB-INF folder inside the Web Pages node.

Doing so didn't help, and instead created a new problem with the bean not being bound to a name.

>From what I can tell from various Google searches and reading different documents, it seems that not only is NetBeans is generating Java EE 5 code, but deployment notation as well.  And, while JBoss is using EJB3, it does not recognize the newer xml syntax.

My problem is fairly obvious, and I'm drowning in a sea of documentation that's in one world or the other, but not bridging the gap between them.

NetBeans is producing this:
javax.naming.Context c = new javax.naming.InitialContext();
  | return (MyBeanLocal) c.lookup("java:comp/env/ejb/MyBean");

Which exceptions with a
anonymous wrote : javax.naming.NameNotFoundException: ejb not bound

My guess is that I need something inside the web.xml file to do that binding, but I'm just not sure what.  I'm also pondering in that there seems to be a jboss.xml file that I could create, but I don't know if this is on the right track or not, either.

Would someone mind pointing me in the right direction?

Many thanks,
-Walt Stoneburner, wls at wwco.com

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

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



More information about the jboss-user mailing list