ant-notifications mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Maarten Coene (JIRA)" <>
Subject [jira] Resolved: (IVY-1147) Use of a shared DocumentBuilder causes SAXException during parallel resolutions
Date Thu, 03 Dec 2009 20:15:20 GMT


Maarten Coene resolved IVY-1147.

       Resolution: Fixed
    Fix Version/s: trunk
         Assignee: Maarten Coene

Fixed in trunk. Both DocumentBuilderFactory and DocumentBuilder aren't required to be thread-safe,
so we always recreate them now;
Could you give it a try (if possible) to see if it solves your problems?


> Use of a shared DocumentBuilder causes SAXException during parallel resolutions
> -------------------------------------------------------------------------------
>                 Key: IVY-1147
>                 URL:
>             Project: Ivy
>          Issue Type: Bug
>          Components: Core
>    Affects Versions: 2.1.0
>         Environment: Vista 32bit Sun JDK 1.6.0_17
>            Reporter: Brian Atkinson
>            Assignee: Maarten Coene
>             Fix For: trunk
> I am in need of running multiple instances of ivy in parallel from within the same jvm.
 When I do this I am seeing the following exception:
> org.xml.sax.SAXException: FWK005 parse may not be called while parsing.
> 	at
> 	at
> 	at javax.xml.parsers.DocumentBuilder.parse(
> 	at org.apache.ivy.util.XMLHelper.parseToDom(
> 	at org.apache.ivy.plugins.parser.m2.PomReader.<init>(
> 	at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(
> 	at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(
> 	at org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(
> 	at org.apache.ivy.plugins.resolver.BasicResolver.parse(
> 	at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(
> 	at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(
> 	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(
> 	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(
> 	at org.apache.ivy.core.resolve.IvyNode.loadData(
> 	at org.apache.ivy.core.resolve.VisitNode.loadData(
> 	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(
> 	at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(
> 	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(
> 	at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(
> 	at org.apache.ivy.Ivy.resolve(
> It seems that the DocumentBuilder created in org.apache.ivy.util.XMLHelper.getDocBuilder(EntityResolver)
is stored in a static variable and only initialized once.  Would it be possible to cache the
DocumentBuilderFactory rather then the DocumentBuilder?  Doing this would allow for parallel
XML parsing.  Additionally the entity resolver provided on the first call is the only one
used for the lifetime of the DocumentBuilder.  I don't know if this was intended, but the
method signature does not seem to suggest it.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message