Stripes,
I don't know where to start looking. I am running JUnit and NetBeans
and MockServletContext(). This is my first day using the Stripes Mock
Objects.
My set up function in JUnit is :
@Before
public void setUp() throws Exception {
int i = 1;
mockServletContext = new MockServletContext("/webapp");
Map<String, String> params = new HashMap<String, String>();
params.put("ActionResolver.Packages"
,"com.<text removed for emailing>.stripes");
//params.put("Extension.Packages", "stripesbook.ext");
mockServletContext.addFilter(StripesFilter.class
,"StripesFilter", params);
mockServletContext.setServlet(DispatcherServlet.class
,"StripesDispatcher", null);
}
This runs correctly when I am not debugging. But when I debug in
NetBeans the following exception is thrown:
javax/servlet/ServletContext
java.lang.NoClassDefFoundError: javax/servlet/ServletContext
at java.lang.ClassLoader.defineClass1(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:621)
at
java.security.SecureClassLoader.defineClass(SecureClassLoader.java:124)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:260)
at java.net.URLClassLoader.access$000(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
at com. < text removed for
email>.stripes.dailysummary.SingleStateActionBeanTest.setUp(SingleStateActionBeanTest.java:59)
Caused by: java.lang.ClassNotFoundException: javax.servlet.ServletContext
at java.net.URLClassLoader$1.run(URLClassLoader.java:200)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
at java.lang.ClassLoader.loadClass(ClassLoader.java:252)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320)
Since MockServletContext() is required and is the first line executed I
am unable to debug.
Please point me to where I should start looking. I realize this may not
be a problem specific to Stripes, but maybe someone on the list has
solved this one. My thinking is that my class path is not set
correctly. But looking at all the settings I do not see any settings
where debug is different from non-debug.
I don't know if this is related but I am getting the following exception
when the test runs. Looking in Jula it looks like this was fixed. I can
live with this exception :
net.sourceforge.stripes.exception.StripesRuntimeException: Something is
trying to access the current Stripes configuration but the current
request was never routed through the StripesFilter! As a result the
appropriate Configuration object cannot be located. Please take a look
at the exact URL in your browser's address bar and ensure that any
requests to that URL will be filtered through the StripesFilter
according to the filter mappings in your web.xml.
Thanks
Fish
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________
Stripes-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/stripes-users