With dependency="yes" XTF can crash with the following error:
2007-nov-11 07:07:49 org.apache.catalina.core.StandardWrapperValve
invoke
ALLVARLIG: Servlet.service() for servlet dynaXML threw exception
java.lang.StackOverflowError
at java.net.URI$Parser.charAt(Unknown Source)
at java.net.URI$Parser.scan(Unknown Source)
at java.net.URI$Parser.checkChars(Unknown Source)
at java.net.URI$Parser.parseHierarchical(Unknown Source)
at java.net.URI$Parser.parse(Unknown Source)
at java.net.URI.<init>(Unknown Source)
at java.net.URI.create(Unknown Source)
at java.net.URI.resolve(Unknown Source)
at
net.sf.saxon.java.JavaPlatform.makeAbsolute(JavaPlatform.java:115)
at
net.sf.saxon.StandardURIResolver.resolve(StandardURIResolver.java:157)
at
org.cdlib.xtf.servletBase.StylesheetCache$DepResolver.resolve(StylesheetCache.java:225)
at
org.cdlib.xtf.servletBase.StylesheetCache$DepResolver.resolve(StylesheetCache.java:225)
(1000 more lines)
I skimmed through the source and found that if you enable dependency
checking a new URIResolver is set each time a new stylesheet is loaded.
The problem is: the new URIResolver calls recursively the old one.
The following code (found in the generate() function) should be moved
to the StylesheetCache constructor:
// Set a URI resolver for dependency checking, if enabled.
if (dependencyChecking)
factory.setURIResolver(new DepResolver(dependencyReceiver,
factory.getURIResolver()));
Regards,
Jakob
// Set a URI resolver for dependency checking, if enabled.
if (dependencyChecking && !(factory.getURIResolver() instanceof DepResolver))
factory.setURIResolver(new DepResolver(dependencyReceiver,
factory.getURIResolver()));
--Martin
Jakob
--Martin
You're right, it belongs in the constructor. I just checked in that change.
--Martin
On 11/13/07 10:56 AM, "Jakob Saternus" <ja...@uuc.se> wrote:
>> org.cdlib.xtf.servletBase.StylesheetCache$DepResolver.resolve(StylesheetCache
>> .java:225)
>> at
>> org.cdlib.xtf.servletBase.StylesheetCache$DepResolver.resolve(StylesheetCache