I get a NullPointerException from BasicEMap.entryForKey() while loading in a multi-threaded application. Whats the problem?
This is a known bug involving access to Ecore metadata from multiple threads. The details map in an annotation on your model (probably an extended metadata annotation on a model originally defined as an XML Schema) is lazily initializing an index as a side-effect of being accessed for the first time. This is not thread-safe. The problem was originally fixed in EMF 2.2 (bug 131151) and later backported to 2.0.6 and 2.1.3. If you are encountering this problem in an earlier release of EMF 2.0 or 2.1, you should move up to the latest release in the stream to pick up the fix. Failing that, there is a workaround: you can simply ensure that you access the details map on each annotation in your model before the multiple loads start occuring.
Related Questions
- I get a NullPointerException from EcoreUtil.getAdapter() while using SDO in a multi-threaded application. Whats the problem?
- Sometimes, when I click on a link or button, the page looks like it is loading, but nothing happens. Whats the problem?
- How do I improve the loading speed of the EASi application?