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

Re: unit test compiles but throws NoClassDefFound exception

by Kalle Korhonen-2 :: Rate this Message:

Reply to Author | View in Thread

You are missing servlet-api from your test classpath.

Kalle


On Sun, Mar 15, 2009 at 8:36 AM, warner <wwarner@...> wrote:

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
--
View this message in context: http://www.nabble.com/unit-test-compiles-but-throws-NoClassDefFound-exception-tp22524377p22524377.html
Sent from the Trails - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

   http://xircles.codehaus.org/manage_email



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