Bug #8223
XMLSchemaService.getInstance().doRefresh not threadsafe
100%
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.