« Return to Thread: unit test compiles but throws NoClassDefFound exception

unit test compiles but throws NoClassDefFound exception

by beel :: Rate this Message:

Reply to Author | View in Thread

Hi,

I'm just starting with trails. Using http://docs.codehaus.org/display/TRAILS/Testing as a guide, I'm trying to test the mappings and eventually load my database with data from files.

        public void testCreate() {
                DomainObj o = new DomainObj();
                o.setName("some name");
                o = persistenceService.save(o);
// assertEquals(o.getName(), "some name");
// assertNotNull(o.getId());
        }

The method compiles but throws an exception at persistenceService.save(o).

 java.lang.NoClassDefFoundError: javax/servlet/http/HttpServlet

The website Trails has generated runs fine, so I'm missing something simple.

Thanks,

 -Bill

 « Return to Thread: unit test compiles but throws NoClassDefFound exception