Discussions

EJB programming & troubleshooting: the simplest test

  1. the simplest test (1 messages)

    Hi,
    i'm really new to ejb so someone could think my question is very stupid, but i'm trying to test my ejb simply with a main:
    public static void main(String[] args) {
    Ejb1 one = null;
    Ejb2 two = null;
            EjbP p = new EjbP();
    try{
    one.ejbCreate(p);
    two.ejbCreate(p);
    }catch(javax.ejb.CreateException _e){
    _e.printStackTrace();
    System.out.println( _e.getMessage) );
    }
    }

    what's wrong with it?
    the error is nullpointer exception
    Thanks and happy Xmas

    Threaded Messages (1)

  2. the simplest test[ Go to top ]

    you should pickup a book on ejb's before moving any further...

    to answer your question:

    one and two ARE null. you never initialized them.