Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I get a NullPointerException from BasicEMap.entryForKey() while loading in a multi-threaded application. Whats the problem?

0
Posted

I get a NullPointerException from BasicEMap.entryForKey() while loading in a multi-threaded application. Whats the problem?

0

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

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123