Project

General

Profile

Bug #8223

XMLSchemaService.getInstance().doRefresh not threadsafe

Added by Rob Nahf about 7 years ago. Updated almost 7 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Metacat
Target version:
Start date:
2017-11-29
Due date:
% Done:

100%

Milestone:
None
Product Version:
*
Story Points:
Sprint:

Description

The SMLSchemaService singleton is throwing ConcurrentModificationExcpetions from doRefresh method.

This routine should be synchronized or otherwise made thread safe.

rnahf@cn-sandbox-ucsb-1:/var/metacat/logs$ grep -A10 MetacatHandler metacat.log
metacat 20171128-19:47:48: [ERROR]: MetacatHandler.handleInsertOrUpdateAction - General error when writing the xml object document to the database: null [edu.ucsb.nceas.metacat.MetacatHandler]
java.util.ConcurrentModificationException
at java.util.Vector$Itr.checkForComodification(Vector.java:1184)
at java.util.Vector$Itr.next(Vector.java:1137)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.createRegisteredNameSpaceAndLocationString(XMLSchemaService.java:417)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.doRefresh(XMLSchemaService.java:133)
at edu.ucsb.nceas.metacat.MetacatHandler.handleInsertOrUpdateAction(MetacatHandler.java:1774)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.insertOrUpdateDocument(D1NodeService.java:1551)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.create(D1NodeService.java:483)
at edu.ucsb.nceas.metacat.dataone.CNodeService.create(CNodeService.java:1871)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.putObject(CNResourceHandler.java:709)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.handle(CNResourceHandler.java:257)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPost(D1RestServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

metacat 20171128-20:08:34: [ERROR]: MetacatHandler.handleInsertOrUpdateAction - General error when writing the xml object document to the database: null [edu.ucsb.nceas.metacat.MetacatHandler]
java.util.ConcurrentModificationException
at java.util.Vector$Itr.checkForComodification(Vector.java:1184)
at java.util.Vector$Itr.next(Vector.java:1137)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.createRegisteredNameSpaceAndLocationString(XMLSchemaService.java:417)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.doRefresh(XMLSchemaService.java:133)
at edu.ucsb.nceas.metacat.MetacatHandler.handleInsertOrUpdateAction(MetacatHandler.java:1774)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.insertOrUpdateDocument(D1NodeService.java:1551)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.create(D1NodeService.java:483)
at edu.ucsb.nceas.metacat.dataone.CNodeService.create(CNodeService.java:1871)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.putObject(CNResourceHandler.java:709)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.handle(CNResourceHandler.java:257)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPost(D1RestServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

metacat 20171128-20:13:58: [ERROR]: MetacatHandler.handleInsertOrUpdateAction - General error when writing the xml object document to the database: null [edu.ucsb.nceas.metacat.MetacatHandler]
java.util.ConcurrentModificationException
at java.util.Vector$Itr.checkForComodification(Vector.java:1184)
at java.util.Vector$Itr.next(Vector.java:1137)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.createRegisteredNameSpaceAndLocationString(XMLSchemaService.java:417)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.doRefresh(XMLSchemaService.java:133)
at edu.ucsb.nceas.metacat.MetacatHandler.handleInsertOrUpdateAction(MetacatHandler.java:1774)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.insertOrUpdateDocument(D1NodeService.java:1551)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.create(D1NodeService.java:483)
at edu.ucsb.nceas.metacat.dataone.CNodeService.create(CNodeService.java:1871)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.putObject(CNResourceHandler.java:709)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.handle(CNResourceHandler.java:257)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPost(D1RestServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)

at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

metacat 20171128-20:20:42: [ERROR]: MetacatHandler.handleInsertOrUpdateAction - General error when writing the xml object document to the database: null [edu.ucsb.nceas.metacat.MetacatHandler]
java.util.ConcurrentModificationException
at java.util.Vector$Itr.checkForComodification(Vector.java:1184)
at java.util.Vector$Itr.next(Vector.java:1137)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.createRegisteredNameSpaceAndLocationString(XMLSchemaService.java:417)
at edu.ucsb.nceas.metacat.service.XMLSchemaService.doRefresh(XMLSchemaService.java:133)
at edu.ucsb.nceas.metacat.MetacatHandler.handleInsertOrUpdateAction(MetacatHandler.java:1774)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.insertOrUpdateDocument(D1NodeService.java:1551)
at edu.ucsb.nceas.metacat.dataone.D1NodeService.create(D1NodeService.java:483)
at edu.ucsb.nceas.metacat.dataone.CNodeService.create(CNodeService.java:1871)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.putObject(CNResourceHandler.java:709)
at edu.ucsb.nceas.metacat.restservice.v2.CNResourceHandler.handle(CNResourceHandler.java:257)
at edu.ucsb.nceas.metacat.restservice.D1RestServlet.doPost(D1RestServlet.java:86)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

History

#1 Updated by Jing Tao almost 7 years ago

  • % Done changed from 0 to 100
  • Target version set to CCI-2.3.7
  • Status changed from New to Closed

Made this method synchronized.

Also available in: Atom PDF

Add picture from clipboard (Maximum size: 14.8 MB)