[jboss-user] [EJB 3.0] - Where am I going wrong...?

BarmyYeTTi do-not-reply at jboss.com
Fri Aug 18 19:58:49 EDT 2006


Hi all, using 4.0.4 GA and trying to get a simple stateless bean to work with no luck.

Got a feeling its something to do with descriptors.., or rather the lack of.

Heres the code:

package kate;
  | 
  | public interface test {
  |     public String getTest();
  | }
  | 
  | 
  | package kate;
  | 
  | import javax.ejb.Stateless;
  | @Stateless
  | public class testBean implements test {
  | 
  |     public String getTest(){
  |         return "Bean has worked!";
  |     }
  | }
  | 
  | 
  | package kate;
  | 
  | import javax.ejb.EJB;
  | public class TestEJB {
  |     @EJB test bean;
  | 
  |     public String getTest(){
  |         String str = null;
  |         if(bean == null){
  |             str = "bean = -------------------------------------------------NULL";
  |         } else {
  |             str = "<--- (" + bean.getTest() + ") --->";
  |         }
  |         return str;
  |     }
  | }

Should this work? am I missing something?
Please help, been trying to get my head round EJB3 & 4.0.4 for 2 weeks now and Im still at this stage :-(

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

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



More information about the jboss-user mailing list