Hi, I have a problem with my webapps once in a while deploys with a
ConcurrentModificationException when it tries to read a resource. For some
reason we cant figure out, the delegates list in Glassfish
DelegatingClassLoader.java is modified while we are reading it. We are using
Glassfish 3.1.2 and deploying several webapps and as far as we have seen, it
is always the same one(the first) that has this problem. The rows I have
problem with in my code are in two different places, the first one is the one
that causes the Exception below, the second one causes a similar exception in
another area in the code, same root cause: JarDeployer: URLClassLoader
classLoader = new URLClassLoader(new URL[] { jarFile.toURI().toURL() },
Thread.currentThread().getContextClassLoader()); URL url =
classLoader.getResource(MOAPPLICATION_CONTEXT_NAME); //This is where it
causes an exception in like one out of 20 times. SimpleAuthorization: URL
policyUrl =
this.policyTargetFinderModule.getClass().getResource("/com/company/dve/security/xacml/dve-authorization-policy-spid.xml");
// Second line that causes the same problem, even more rarely. Exception:
2013-02-28 16:35:55,330 [gerDeployThread] ERROR
[com.company.dve.core.assembly.deploy.DeployManager] Could not deploy file:
/home/asuser/nodes/10/domains/dve-domain/config/dve/deploy/JDV-HLR-Subscriber-Provisioning-1.0.0.jar
com.company.dve.common.DVEException: Error while deploying component. Could
not read application context 'META-INF/managedobjects-descriptor.xml' from
JAR file
'/home/asuser/nodes/10/domains/dve-domain/config/dve/tmp/JDV-HLR-Subscriber-Provisioning-1.0.06816300804817707763.jar'
at
com.company.dve.core.assembly.deploy.JarDeployer.loadMoApplicationContext(JarDeployer.java:570)
at
com.company.dve.core.assembly.deploy.JarDeployer.registerManagedObjects(JarDeployer.java:458)
at
com.company.dve.core.assembly.deploy.JavaDataViewDeployer.deploy(JavaDataViewDeployer.java:92)
at
com.company.dve.core.assembly.deploy.DeployManager$DeploymentInfo.deploy(DeployManager.java:112)
at
com.company.dve.core.assembly.deploy.DeployManager$DeploymentInfo.access$1000(DeployManager.java:91)
at
com.company.dve.core.assembly.deploy.DeployManager.deployNewFile(DeployManager.java:578)
at
com.company.dve.core.assembly.deploy.DeployManager.scanDeployDir(DeployManager.java:553)
at
com.company.dve.core.assembly.deploy.DeployManager$DeployThread.run(DeployManager.java:230)
Caused by: org.springframework.beans.factory.BeanDefinitionStoreException:
Unexpected exception parsing XML document from file
[/cluster/home/asuser/nodes/10/domains/dve-domain/config/managedobjects-descriptor-tmp.xml];
nested exception is java.util.ConcurrentModificationException at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:412)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:334)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.loadBeanDefinitions(XmlBeanDefinitionReader.java:302)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:143)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:178)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:149)
at
org.springframework.beans.factory.support.AbstractBeanDefinitionReader.loadBeanDefinitions(AbstractBeanDefinitionReader.java:212)
at
org.springframework.context.support.AbstractXmlApplicationContext.loadBeanDefinitions(AbstractXmlApplicationContext.java:126)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.loadBeanDefinitions(FileSystemXmlApplicationContext.java:168)
at
org.springframework.context.support.AbstractRefreshableApplicationContext.refreshBeanFactory(AbstractRefreshableApplicationContext.java:130)
at
org.springframework.context.support.AbstractApplicationContext.obtainFreshBeanFactory(AbstractApplicationContext.java:467)
at
org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:397)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:149)
at
org.apache.xbean.spring.context.FileSystemXmlApplicationContext.(FileSystemXmlApplicationContext.java:48)
at
com.company.dve.core.assembly.deploy.JarDeployer.loadMoApplicationContext(JarDeployer.java:543)
... 7 more Caused by: java.util.ConcurrentModificationException at
java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372) at
java.util.AbstractList$Itr.next(AbstractList.java:343) at
org.glassfish.internal.api.DelegatingClassLoader.findResources(DelegatingClassLoader.java:208)
at java.lang.ClassLoader.getResources(ClassLoader.java:1040) at
org.glassfish.web.loader.WebappClassLoader.getResources(WebappClassLoader.java:1305)
at
org.springframework.core.io.support.PropertiesLoaderUtils.loadAllProperties(PropertiesLoaderUtils.java:103)
at
org.springframework.beans.factory.xml.PluggableSchemaResolver.getSchemaMappings(PluggableSchemaResolver.java:144)
at
org.springframework.beans.factory.xml.PluggableSchemaResolver.resolveEntity(PluggableSchemaResolver.java:110)
at
org.springframework.beans.factory.xml.DelegatingEntityResolver.resolveEntity(DelegatingEntityResolver.java:85)
at
org.springframework.beans.factory.xml.ResourceEntityResolver.resolveEntity(ResourceEntityResolver.java:74)
at
com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:107)
at
com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntity(XMLEntityManager.java:1098)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaLoader.resolveDocument(XMLSchemaLoader.java:599)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.findSchemaGrammar(XMLSchemaValidator.java:2438)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.handleStartElement(XMLSchemaValidator.java:1788)
at
com.sun.org.apache.xerces.internal.impl.xs.XMLSchemaValidator.startElement(XMLSchemaValidator.java:711)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.scanStartElement(XMLNSDocumentScannerImpl.java:400)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl$NSContentDriver.scanRootElementHook(XMLNSDocumentScannerImpl.java:626)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl$FragmentContentDriver.next(XMLDocumentFragmentScannerImpl.java:3104)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:921)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:647)
at
com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:140)
at
com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:511)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:808)
at
com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:737)
at
com.sun.org.apache.xerces.internal.parsers.XMLParser.parse(XMLParser.java:119)
at
com.sun.org.apache.xerces.internal.parsers.DOMParser.parse(DOMParser.java:232)
at
com.sun.org.apache.xerces.internal.jaxp.DocumentBuilderImpl.parse(DocumentBuilderImpl.java:284)
at
org.springframework.beans.factory.xml.DefaultDocumentLoader.loadDocument(DefaultDocumentLoader.java:75)
at
org.springframework.beans.factory.xml.XmlBeanDefinitionReader.doLoadBeanDefinitions(XmlBeanDefinitionReader.java:388)
... 21 more Anyone have any ideas on where our problem might be? If you need
more information, please specify and I will fill in what I can. Best regards
Samuel
--
[Message sent by forum member 'SamuelSmith']
View Post: http://forums.java.net/node/895405