tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-francois Arcand <jeanfrancois.arc...@sun.com>
Subject Re: [PATCH][Catalina] Use fully qualified URI for locating local schema
Date Sat, 10 Aug 2002 19:10:46 GMT
Patrick,

you also have to apply the catalina pache where it is defined the local 
schema location (Constants.java). I made some change to avoid having 
Xerces resolving with the wrong URI.

Thanks,

Jeanfrancois.

Patrick Luby wrote:

> Jean-Fran├žois,
>
> When I apply this patch and your jakarta-servletapi-5 patch and build 
> with the latest commons-digester, I get the following exception. I 
> seems that with your patches, Xerces no longer looks locally for the 
> XML files.
>
> Accordingly, I think we should figure out what is happening before 
> these patches should be applied as these patches make it impossible 
> for anyone running behind a firewall to run Tomcat.
>
> Patrick
>
> org.xml.sax.SAXParseException: src-import.0: Failed to read imported 
> schema document 'http://www.w3.org/2001/xml.xsd'.
>         at 
> org.apache.xerces.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:232)

>
>         at 
> org.apache.xerces.util.ErrorHandlerWrapper.warning(ErrorHandlerWrapper.java:141) 
>
>         at 
> org.apache.xerces.impl.XMLErrorReporter.reportError(XMLErrorReporter.java:358) 
>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.reportSchemaWarning(XSDHandler.java:1837)

>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1298) 
>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.getSchema(XSDHandler.java:1240) 
>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:611) 
>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.constructTrees(XSDHandler.java:654) 
>
>         at 
> org.apache.xerces.impl.xs.traversers.XSDHandler.parseSchema(XSDHandler.java:403) 
>
>         at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.processJAXPSchemaSource(XMLSchemaValidator.java:2302)

>
>         at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1632)

>
>         at 
> org.apache.xerces.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:568)

>
>         at 
> org.apache.xerces.impl.XMLNamespaceBinder.handleStartElement(XMLNamespaceBinder.java:832)

>
>         at 
> org.apache.xerces.impl.XMLNamespaceBinder.startElement(XMLNamespaceBinder.java:568) 
>
>         at 
> org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:796) 
>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:752)

>
>         at 
> org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:927)

>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1519)

>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)

>
>         at 
> org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)

>
>         at 
> org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)

>
>         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148) 
>
>         at org.apache.commons.digester.Digester.parse(Digester.java:1512)
>         at 
> org.apache.catalina.startup.ContextConfig.defaultConfig(ContextConfig.java:573) 
>
>         at 
> org.apache.catalina.startup.ContextConfig.start(ContextConfig.java:711)
>         at 
> org.apache.catalina.startup.ContextConfig.lifecycleEvent(ContextConfig.java:247) 
>
>         at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)

>
>         at 
> org.apache.catalina.core.StandardContext.start(StandardContext.java:3493)
>         at 
> org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821) 
>
>         at 
> org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
>         at 
> org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
>         at 
> org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:617)

>
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at 
> org.apache.commons.beanutils.MethodUtils.invokeMethod(MethodUtils.java:216) 
>
>         at 
> org.apache.commons.digester.SetNextRule.end(SetNextRule.java:260)
>         at 
> org.apache.commons.digester.Digester.endElement(Digester.java:1036)
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.endElement(AbstractSAXParser.java:559) 
>
>         at 
> org.apache.xerces.impl.XMLNamespaceBinder.endElement(XMLNamespaceBinder.java:646) 
>
>         at 
> org.apache.xerces.impl.dtd.XMLDTDValidator.handleEndElement(XMLDTDValidator.java:2978)

>
>         at 
> org.apache.xerces.impl.dtd.XMLDTDValidator.endElement(XMLDTDValidator.java:918) 
>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.handleEndElement(XMLDocumentFragmentScannerImpl.java:1145)

>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanEndElement(XMLDocumentFragmentScannerImpl.java:988)

>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1446)

>
>         at 
> org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:333)

>
>         at 
> org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:529)

>
>         at 
> org.apache.xerces.parsers.StandardParserConfiguration.parse(StandardParserConfiguration.java:585)

>
>         at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:147)
>         at 
> org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1148) 
>
>         at org.apache.commons.digester.Digester.parse(Digester.java:1531)
>         at 
> org.apache.catalina.core.StandardHostDeployer.install(StandardHostDeployer.java:423)

>
>         at 
> org.apache.catalina.core.StandardHost.install(StandardHost.java:803)
>         at 
> org.apache.catalina.startup.HostConfig.deployDescriptors(HostConfig.java:452) 
>
>         at 
> org.apache.catalina.startup.HostConfig.deployApps(HostConfig.java:409)
>         at 
> org.apache.catalina.startup.HostConfig.start(HostConfig.java:879)
>         at 
> org.apache.catalina.startup.HostConfig.lifecycleEvent(HostConfig.java:368) 
>
>         at 
> org.apache.catalina.util.LifecycleSupport.fireLifecycleEvent(LifecycleSupport.java:166)

>
>         at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1196)
>         at 
> org.apache.catalina.core.StandardHost.start(StandardHost.java:738)
>         at 
> org.apache.catalina.core.ContainerBase.start(ContainerBase.java:1188)
>         at 
> org.apache.catalina.core.StandardEngine.start(StandardEngine.java:347)
>         at 
> org.apache.catalina.core.StandardService.start(StandardService.java:497)
>         at 
> org.apache.catalina.core.StandardServer.start(StandardServer.java:2231)
>         at org.apache.catalina.startup.Catalina.start(Catalina.java:516)
>         at 
> org.apache.catalina.startup.Catalina.execute(Catalina.java:402)
>         at 
> org.apache.catalina.startup.Catalina.process(Catalina.java:180)
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
>         at 
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) 
>
>         at 
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)

>
>         at java.lang.reflect.Method.invoke(Method.java:324)
>         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:203)
>
>
> Jean-francois Arcand wrote:
>
>> Hi,
>>
>> this patch change the way local schema are stored -> use the full URI 
>> instead a the file name.
>>
>> Thanks,
>>
>> -- Jeanfrancois
>>
>>
>> ------------------------------------------------------------------------
>>
>> Index: Constants.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/Constants.java,v

>>
>> retrieving revision 1.3
>> diff -u -r1.3 Constants.java
>> --- Constants.java    1 Aug 2002 04:53:03 -0000    1.3
>> +++ Constants.java    10 Aug 2002 14:46:08 -0000
>> @@ -93,9 +93,9 @@
>>          "/javax/servlet/jsp/resources/web-jsptaglibrary_1_2.dtd";
>>  
>>      public static final String TldSchemaPublicId_20 =
>> -        "web-jsptaglibrary_2_0.xsd";
>> +        "http://java.sun.com/xml/ns/j2ee/web-jsptaglibrary_2_0.xsd";
>>      public static final String TldSchemaResourcePath_20 =
>> -        "/javax/servlet/jsp/resources/web-jsptaglibrary_2_0.xsd";
>> +        "/javax/servlet/resources/web-jsptaglibrary_2_0.xsd";
>>  
>>      public static final String WebDtdPublicId_22 =
>>          "-//Sun Microsystems, Inc.//DTD Web Application 2.2//EN";
>> @@ -110,23 +110,23 @@
>>          "/javax/servlet/resources/web-app_2_3.dtd";
>>  
>>      public static final String WebSchemaPublicId_24 =
>> -        "web-app_2_4.xsd";
>> +        "http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd";
>>      public static final String WebSchemaResourcePath_24 =
>>          "/javax/servlet/resources/web-app_2_4.xsd";
>>  
>>      public static final String J2eeSchemaPublicId_14 =
>> -        "j2ee_1_4.xsd";
>> +        "http://java.sun.com/xml/ns/j2ee/j2ee_1_4.xsd";
>>      public static final String J2eeSchemaResourcePath_14 =
>>          "/javax/servlet/resources/j2ee_1_4.xsd";
>>  
>>      public static final String W3cSchemaPublicId_10 =
>> -        "xml.xsd";
>> +        "http://www.w3.org/2001/xml.xsd";
>>      public static final String W3cSchemaResourcePath_10 =
>>          "/javax/servlet/resources/xml.xsd";
>>  
>>      public static final String JspSchemaPublicId_20 =
>> -        "jsp_2_0.xsd";
>> +        "http://java.sun.com/xml/ns/j2ee/jsp_2_0.xsd";
>>      public static final String JspSchemaResourcePath_20 =
>> -        "/javax/servlet/jsp/resources/jsp_2_0.xsd";
>> +        "/javax/servlet/resources/jsp_2_0.xsd";
>>  
>>  }
>> Index: ContextConfig.java
>> ===================================================================
>> RCS file: 
>> /home/cvspublic/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/startup/ContextConfig.java,v

>>
>> retrieving revision 1.7
>> diff -u -r1.7 ContextConfig.java
>> --- ContextConfig.java    8 Aug 2002 18:31:33 -0000    1.7
>> +++ ContextConfig.java    10 Aug 2002 14:46:08 -0000
>> @@ -493,10 +493,9 @@
>>          // to support servlet.jar that does not contains the schema
>>          if (url != null){
>>              tldDigester.setSchema(url.toString());
>> +            tldDigester = registerLocalSchema(tldDigester);
>>          }
>>  
>> -        tldDigester = registerLocalSchema(tldDigester);
>> -
>>          tldDigester.addRuleSet(new TldRuleSet());
>>          return (tldDigester);
>>  
>> @@ -527,9 +526,8 @@
>>          // to support servlet.jar that does not contains the schema
>>          if (url != null){
>>              webDigester.setSchema(url.toString());
>> +            webDigester = registerLocalSchema(webDigester);
>>          }
>> -
>> -        webDigester = registerLocalSchema(webDigester);
>>  
>>          webDigester.addRuleSet(new WebRuleSet());
>>          return (webDigester);
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> --
>> To unsubscribe, e-mail:   
>> <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
>> For additional commands, e-mail: 
>> <mailto:tomcat-dev-help@jakarta.apache.org>
>
>


--
To unsubscribe, e-mail:   <mailto:tomcat-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:tomcat-dev-help@jakarta.apache.org>


Mime
View raw message