aspose file tools*
The moose likes Servlets and the fly likes MalformedURLException while testing Actionservlets Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Servlets
Bookmark "MalformedURLException while testing Actionservlets" Watch "MalformedURLException while testing Actionservlets" New topic
Author

MalformedURLException while testing Actionservlets

Marxman
Greenhorn

Joined: Mar 04, 2003
Posts: 3
Hi there,

I've got the following problem:

While trying to run an ActionServletTest with Mock strutstest i get the following error:

java.net.MalformedURLException: java.lang.NullPointerException
at java.net.URL.<init>(URL.java(Compiled Code))
at java.net.URL.<init>(URL.java:403)
at java.net.URL.<init>(URL.java:357)
at org.apache.xerces.impl.XMLEntityManager.startEntity(XMLEntityManager.java:748)
at org.apache.xerces.impl.XMLEntityManager.startDocumentEntity(XMLEntityManager.java:693)
at org.apache.xerces.impl.XMLDocumentScannerImpl.setInputSource(XMLDocumentScannerImpl.java:252)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:499)
at org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:581)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1158)
at org.apache.commons.digester.Digester.parse(Digester.java:1514)
at org.apache.struts.action.ActionServlet.initServlet(ActionServlet.java:1433)
at org.apache.struts.action.ActionServlet.init(ActionServlet.java:466)
at javax.servlet.GenericServlet.init(GenericServlet.java:258)
at servletunit.struts.MockStrutsTestCase.getActionServlet(MockStrutsTestCase.java:179)
at servletunit.struts.MockStrutsTestCase.actionPerform(MockStrutsTestCase.java:228)
at nl.iza.reis.informatieverzoek.actions.InformatieVerzoekActionTest.testVerstuurInformatieVerzoekMetOntbrekendeDrukwerkId(InformatieVerzoekActionTest.java:145)
at java.lang.reflect.Method.invoke(Native Method)
at junit.framework.TestCase.runTest(TestCase.java:166)
at junit.framework.TestCase.runBare(TestCase.java:140)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:131)
at junit.framework.TestSuite.runTest(TestSuite.java:173)
at junit.framework.TestSuite.run(TestSuite.java:168)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:329)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:218)
at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:151)

It starts when the actionPerform() methode is called in the testmethode. I'm using IBM websphere 5.0. It seems that the struts-config.xml cannot be found. I checked the url but and thats the correct url.

Tried to find it with google but without succes.

Thanks in forward!
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: MalformedURLException while testing Actionservlets