I got NullPointer Exception when I test my ejb (EJB3.0 version) using Junit with Cactus

"Alice Liu" <[email protected]>
Newsgroups gmane.comp.jakarta.cactus.user
Message-ID <E16F04F0E1803A45A6602A57BA1126E55F0A7F@axis41mail.axis41corp.internal>
HI,

 

 My code is like this.

 

public class SampleFacadeTest extends ServletTestCase {

 

    @EJB

    SampleFacadeLocal sampleFacade;

 

    public void setUp() {

        

    }

    

    public static Test suite()

    {

        return new TestSuite(SampleFacadeTest.class);

    }

    */

 

    public void testFind() throws Exception{

        String firsName =  "Rick";

        String testName = sampleFacade.find(112233).getFirstName();

        assertEquals(firsName , testName);

    }

    

     

 

}

 

The sampleFacade variable got null pointer exception at line

 

String testName = sampleFacade.find(112233).getFirstName();

 

EJB3.0 is new thing. I wish I could get answer from here.

 

Thanks.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.