This may be a somewhat complicated problem that may not in fact relate directly to STC, but I want to see if it rings any bells here. I recently got logging working using log4j, and although my app still works fine when I'm not running the tests, my test suite now causes multiple occurrences of the following exception:
StandardWrapperValve[ServletRedirector]: Servlet.service() for servlet
ServletRedirector threw exception
java.lang.NullPointerException
at
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.toString(I18nFactorySet.java:577)
at
org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.toString(ComponentDefinitionsFactoryWrapper.java:152)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.recordContextAttributes(MonitorFilter.java:1205)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.recordContextData(MonitorFilter.java:901)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.getDataBefore(MonitorFilter.java:531)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:180)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
This only happens when I've got logging turned on and I'm running the test cases -- (logging + normal usage) and (no logging + test cases) all work fine.
Now, the weird thing to me is that I'm not even using Tiles -- I switched from TilesRequestProcessor to RequestProcessor, removed the Tiles plugin section
from my struts-config.xml and removed tiles-defs.xml file as well just to be sure. The logs do not contain any Tiles initialization entries as they did before I removed Tiles. Why are Tiles classes still being used?
It may be that this is a Cactus etc. problem that's not related to StrutsTestCase, but I thought I'd start here since the root of the problem appears to be that something erroneously is trying to print out/log Tiles-related objects.
Any insights?
This test package is otherwise great, BTW.
Ryan Olson
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This may be a somewhat complicated problem that may not in fact relate directly to STC, but I want to see if it rings any bells here. I recently got logging working using log4j, and although my app still works fine when I'm not running the tests, my test suite now causes multiple occurrences of the following exception:
StandardWrapperValve[ServletRedirector]: Servlet.service() for servlet
ServletRedirector threw exception
java.lang.NullPointerException
at
org.apache.struts.tiles.xmlDefinition.I18nFactorySet.toString(I18nFactorySet.java:577)
at
org.apache.struts.tiles.definition.ComponentDefinitionsFactoryWrapper.toString(ComponentDefinitionsFactoryWrapper.java:152)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.recordContextAttributes(MonitorFilter.java:1205)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.recordContextData(MonitorFilter.java:901)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.getDataBefore(MonitorFilter.java:531)
at
org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:180)
at
org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:213)
at
org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:193)
at
org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:243)
at
org.apache.catalina.core.StandardPipeline.invokeNext(StandardPipeline.java:566)
This only happens when I've got logging turned on and I'm running the test cases -- (logging + normal usage) and (no logging + test cases) all work fine.
Now, the weird thing to me is that I'm not even using Tiles -- I switched from TilesRequestProcessor to RequestProcessor, removed the Tiles plugin section
from my struts-config.xml and removed tiles-defs.xml file as well just to be sure. The logs do not contain any Tiles initialization entries as they did before I removed Tiles. Why are Tiles classes still being used?
It may be that this is a Cactus etc. problem that's not related to StrutsTestCase, but I thought I'd start here since the root of the problem appears to be that something erroneously is trying to print out/log Tiles-related objects.
Any insights?
This test package is otherwise great, BTW.
Ryan Olson