File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes strutstestcase - NPE in web.xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "strutstestcase - NPE in web.xml" Watch "strutstestcase - NPE in web.xml" New topic

strutstestcase - NPE in web.xml

wont poonolly

Joined: Aug 01, 2006
Posts: 2
I'm trying to test my struts actions. I jUnit test all of my DAOs and I'm trying to keep the testing momentum going. When I run this line in my code:

setServletConfigFile("C:/apache/tomcat 5.5.7/webapps/xxx/WEB-INF/web.xml");

I get this error:

junit.framework.AssertionFailedError: Received an exception while loading web.xml - class java.lang.NullPointerException : null
at servletunit.struts.MockStrutsTestCase.setServletConfigFile(
at junit.framework.TestCase.runBare(
at junit.framework.TestResult$1.protect(
at junit.framework.TestResult.runProtected(
at junit.framework.TestSuite.runTest(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(

My web.xml works fine in my tomcat container. The file is there. When I taek the line of code out it says it can't find the web.xml.

I've been all over the forums, google, I've rtFm, and I'm just about out of ideas. Thanks for any help anyone can provide.

I agree. Here's the link:
subject: strutstestcase - NPE in web.xml
It's not a secret anymore!