Bug 53285 - Web app configuration fails when security-role-ref does not contain role-link
Web app configuration fails when security-role-ref does not contain role-link
Status: RESOLVED FIXED
Product: Tomcat 7
Classification: Unclassified
Component: Catalina
7.0.27
PC Windows XP
: P2 normal (vote)
: ---
Assigned To: Tomcat Developers Mailing List
:
Depends on:
Blocks:
  Show dependency tree
 
Reported: 2012-05-24 04:52 UTC by Stephen Davies
Modified: 2012-06-01 09:43 UTC (History)
0 users



Attachments
Sample WAR (3.32 KB, application/octet-stream)
2012-05-24 04:52 UTC, Stephen Davies
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stephen Davies 2012-05-24 04:52:55 UTC
Created attachment 28829 [details]
Sample WAR

The <role-link> element is optional content within <security-role-ref>. However, an application will fail to deploy if the optional element is missing.

I've attached a sample WAR that highlights the problem. Note, the attached WAR will deploy ok in 6.0.35.

Console output from running 7.0.27 embedded in Eclipse:
INFO: Starting Servlet Engine: Apache Tomcat/7.0.27
24/05/2012 2:32:34 PM org.apache.tomcat.util.digester.Digester endElement
SEVERE: End event threw exception
Throwable occurred: java.lang.IllegalArgumentException: Can't convert argument: null
	at org.apache.tomcat.util.IntrospectionUtils.convert(IntrospectionUtils.java:966)
	at org.apache.tomcat.util.digester.CallMethodRule.end(CallMethodRule.java:476)
	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1051)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1201)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
	at java.util.concurrent.FutureTask.run(FutureTask.java:149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
	at java.lang.Thread.run(Thread.java:736)
24/05/2012 2:32:34 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at jndi:/localhost/testApp/WEB-INF/web.xml
Throwable occurred: java.lang.IllegalArgumentException: Can't convert argument: null
	at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
	at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2719)
	at org.apache.tomcat.util.digester.Digester.endElement(Digester.java:1054)
	at org.apache.xerces.parsers.AbstractSAXParser.endElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(Unknown Source)
	at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XML11Configuration.parse(Unknown Source)
	at org.apache.xerces.parsers.XMLParser.parse(Unknown Source)
	at org.apache.xerces.parsers.AbstractSAXParser.parse(Unknown Source)
	at org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser.parse(Unknown Source)
	at org.apache.tomcat.util.digester.Digester.parse(Digester.java:1537)
	at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1825)
	at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1201)
	at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:855)
	at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:345)
	at org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:119)
	at org.apache.catalina.util.LifecycleBase.fireLifecycleEvent(LifecycleBase.java:90)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5161)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1566)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1556)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:314)
	at java.util.concurrent.FutureTask.run(FutureTask.java:149)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:897)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:919)
	at java.lang.Thread.run(Thread.java:736)
24/05/2012 2:32:34 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 18 column 23
Comment 1 Mark Thomas 2012-06-01 09:43:44 UTC
Thanks for the report and the test case.

This has been fixed in trunk and 7.0.x and will be included in 7.0.28 onwards.