Conecction Ejb 3.0 Remote

Discussion in 'Java' started by legranadosb, Apr 30, 2008.

  1. legranadosb

    legranadosb

    Joined:
    Apr 29, 2008
    Messages:
    1
    Hello:captain:
    I need to connect a client with a apliccation that is deployed in WASCE i`m making a test but i have a problem... HELP ME

    this is my code::::

    *****Remote*****
    package prueba;

    import javax.ejb.Remote;

    @Remote
    public interface pruebaRemote {
    public String metodo(String arg);
    }
    ****Stateless*****

    package prueba;

    import javax.ejb.Remote;
    import javax.ejb.Stateless;
    import javax.ejb.TransactionAttribute;
    import javax.persistence.EntityManager;
    import javax.persistence.PersistenceContext;

    @Remote
    @Stateless
    public class PruebaBean implements pruebaLocal, pruebaRemote {

    @PersistenceContext
    EntityManager em;
    public static final String RemoteJNDIName = PruebaBean.class.getSimpleName() + "/remote";
    public static final String LocalJNDIName = PruebaBean.class.getSimpleName() + "/local";

    @TransactionAttribute()
    public String metodo(String arg) {
    // TODO Auto-generated method stub
    return arg;
    }

    }


    *******client******

    import javax.ejb.EJB;

    import prueba.pruebaRemote;


    public class test {

    /**
    * @param args
    */

    public static void main(String[] args) {
    new metodo();



    }


    }
    class metodo{
    @EJB
    pruebaRemote beanRemote;
    public metodo(){


    System.out.println(beanRemote.metodo("Esto es una prueba"));
    }
    }

    *****and the error is****
    Exception in thread "main" java.lang.NullPointerException
    at metodo.<init>(test.java:51)
    at test.main(test.java:19)
    *******************************
    my email is legranadosb@yahoo.com
     
    legranadosb, Apr 30, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Steve
    Replies:
    1
    Views:
    718
    John C. Bollinger
    Jul 15, 2003
  2. Mumbai Joe
    Replies:
    0
    Views:
    622
    Mumbai Joe
    Jul 29, 2003
  3. Jeremy Haile

    To EJB or not to EJB

    Jeremy Haile, Sep 3, 2003, in forum: Java
    Replies:
    5
    Views:
    555
    Christopher Blunck
    Sep 10, 2003
  4. Massimiliano
    Replies:
    5
    Views:
    458
    Andrew Thompson
    Jan 4, 2004
  5. Raymond Schanks
    Replies:
    0
    Views:
    685
    Raymond Schanks
    Aug 3, 2010
Loading...

Share This Page