ant-notifications mailing list archives

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

     [ https://issues.apache.org/jira/browse/IVY-1147?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

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?

thanks,
Maarten

> Use of a shared DocumentBuilder causes SAXException during parallel resolutions
> -------------------------------------------------------------------------------
>
>                 Key: IVY-1147
>                 URL: https://issues.apache.org/jira/browse/IVY-1147
>             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 com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:253)
> 	at com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:283)
> 	at javax.xml.parsers.DocumentBuilder.parse(DocumentBuilder.java:153)
> 	at org.apache.ivy.util.XMLHelper.parseToDom(XMLHelper.java:198)
> 	at org.apache.ivy.plugins.parser.m2.PomReader.<init>(PomReader.java:94)
> 	at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:115)
> 	at org.apache.ivy.plugins.parser.m2.PomModuleDescriptorParser.parseDescriptor(PomModuleDescriptorParser.java:105)
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager$MyModuleDescriptorProvider.provideModule(DefaultRepositoryCacheManager.java:638)
> 	at org.apache.ivy.core.cache.ModuleDescriptorMemoryCache.getStale(ModuleDescriptorMemoryCache.java:68)
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.getStaledMd(DefaultRepositoryCacheManager.java:655)
> 	at org.apache.ivy.core.cache.DefaultRepositoryCacheManager.cacheModuleDescriptor(DefaultRepositoryCacheManager.java:942)
> 	at org.apache.ivy.plugins.resolver.BasicResolver.parse(BasicResolver.java:542)
> 	at org.apache.ivy.plugins.resolver.BasicResolver.getDependency(BasicResolver.java:263)
> 	at org.apache.ivy.plugins.resolver.IBiblioResolver.getDependency(IBiblioResolver.java:501)
> 	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
> 	at org.apache.ivy.plugins.resolver.ChainResolver.getDependency(ChainResolver.java:130)
> 	at org.apache.ivy.core.resolve.IvyNode.loadData(IvyNode.java:170)
> 	at org.apache.ivy.core.resolve.VisitNode.loadData(VisitNode.java:274)
> 	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:671)
> 	at org.apache.ivy.core.resolve.ResolveEngine.doFetchDependencies(ResolveEngine.java:757)
> 	at org.apache.ivy.core.resolve.ResolveEngine.fetchDependencies(ResolveEngine.java:679)
> 	at org.apache.ivy.core.resolve.ResolveEngine.getDependencies(ResolveEngine.java:551)
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:235)
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:193)
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:138)
> 	at org.apache.ivy.core.resolve.ResolveEngine.resolve(ResolveEngine.java:134)
> 	at org.apache.ivy.Ivy.resolve(Ivy.java:473)
> 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.


Mime
View raw message