tomcat-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Tanglin, Oliver" <OLIVER.TANG...@saic.com>
Subject RE: Class cast exception when starting tomcat 7.0.1
Date Wed, 12 Jun 2013 10:53:48 GMT


Oliver Tanglin | SAIC
Software Appl. Engineer | C3 Systems and Analysis Division
Phone: 703-676-7449 | Mobile: 727-207-1037
tanglino@saic.com



-----Original Message-----
From: users-return-242256-OLIVER.TANGLIN=saic.com@tomcat.apache.org on behalf of Jane Muse
Sent: Tue 6/11/2013 7:42 PM
To: users@tomcat.apache.org
Subject: Class cast exception when starting tomcat 7.0.1
 
I'm getting a class cast exception when starting up tomcat 7.0.1. I've migrated from 6.0.18
to 7.0.1. I got the same error when migrating directly to 7.0.4. The error is:

SEVERE: Begin event threw exception
Throwable occurred: java.lang.ClassCastException: org.apache.catalina.deploy.SecurityConstraint
incompatible with org.apache.catalina.deploy.SecurityConstraint
at org.apache.catalina.startup.SetAuthConstraintRule.begin(WebRuleSet.java:745)
 at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1282)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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:1543)
 at org.apache.catalina.startup.ContextConfig.parseWebXml(ContextConfig.java:1686)
 at org.apache.catalina.startup.ContextConfig.webConfig(ContextConfig.java:1201)
 at org.apache.catalina.startup.ContextConfig.configureStart(ContextConfig.java:874)
 at org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:317)
.
.
.

Jun 11, 2013 2:17:07 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Parse error in application web.xml file at jndi:/localhost/aldonsecurityservice/WEB-INF/web.xml
Throwable occurred: java.lang.ClassCastException: org.apache.catalina.deploy.SecurityConstraint
incompatible with org.apache.catalina.deploy.SecurityConstraint
at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2687)
 at org.apache.tomcat.util.digester.Digester.createSAXException(Digester.java:2713)
 at org.apache.tomcat.util.digester.Digester.startElement(Digester.java:1285)
 at org.apache.xerces.parsers.AbstractSAXParser.startElement(Unknown Source)
 at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(Unknown Source)
 at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(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 java.lang.reflect.Method.invoke(Method.java:611)
 at org.apache.catalina.startup.Bootstrap.start(Bootstrap.java:303)
 at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:431)
Jun 11, 2013 2:17:07 PM org.apache.catalina.startup.ContextConfig parseWebXml
SEVERE: Occurred at line 147 column 20
class load: java/util/LinkedHashMap$2
class load: java/util/LinkedHashMap$ValueIterator
class load: org.apache.catalina.core.StandardWrapperFacade from: file:/ALDON/ALDONLS/tomcat_alcsq/lib/catalina.jar
class load: org.apache.catalina.util.InstanceSupport from: file:/ALDON/ALDONLS/tomcat_alcsq/lib/catalina.jar
class load: org.apache.catalina.InstanceListener from: file:/ALDON/ALDONLS/tomcat_alcsq/lib/catalina.jar
class load: org.apache.catalina.core.StandardWrapperValve from: file:/ALDON/ALDONLS/tomcat_alcsq/lib/catalina.jar
class load: javax.servlet.descriptor.TaglibDescriptor from: file:/ALDON/ALDONLS/tomcat_alcsq/lib/servlet-api.jar

Is it possible my XML parsers need updating. I'm still using the same ones in my WEB-INF/lib
of the webapp:

      xalan.jar
      xerces.jar
      xerces-2.6.2.jar
      xml-apis.jar
      xmlrpc-1.2-b1.jar

Thanks,

JMuse

Yes. The XML libraries you are using are notorious for this type of issue. Make sure you are
compiling against the same ones provided with your instance of Tomcat. And do not include
them in your WAR. For example, if you are using Maven, use <scope>provided</scope>
in your <dependency/> element to filter them out when building your WAR. 




Mime
View raw message