|
Re: [Teneo] Multiple class loader problem [message #988741 is a reply to message #988739] |
Sun, 02 December 2012 11:36 |
Ed Merks Messages: 33141 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Cristian,<br>
<br>
You could use this VM option to specify just the plain old
(non-classloader-scoped) package registry implementation:<br>
<blockquote>-Dorg.eclipse.emf.ecore.EPackage.Registry.INSTANCE=org.eclipse.emf.ecore.impl.EPackageRegistryImpl<br>
</blockquote>
<br>
<br>
<div class="moz-cite-prefix">On 02/12/2012 12:03 PM, Cristian
Prevedello wrote:<br>
</div>
<blockquote cite="mid:k9fchn$2e5$1@xxxxxxxxe.org" type="cite">We
are experiencing some problems inside an EAR deployment. (yes i
know we should use Texo, but it's not feasible for now).
<br>
<br>
Inside our EAR we have some web services, some servlets and some
EJB.
<br>
<br>
We are registering our hbds with the following code in a static
syncronized method, so we get only one hbds instance.
<br>
<br>
hbds=HbHelper.INSTANCE.createRegisterDataStore(dataStoreId);
<br>
<br>
hbds.setDataStoreProperties(props);
<br>
hbds.setEPackages(new
EPackage[]{ViewshapemodelPackage.eINSTANCE});
<br>
hbds.initialize();
<br>
<br>
<br>
We tracked down the problem to the following method:
<br>
<br>
public static synchronized EPackage.Registry
getRegistry(ClassLoader classLoader)
<br>
{
<br>
EPackage.Registry result =
classLoaderToRegistryMap.get(classLoader);
<br>
if (result == null)
<br>
{
<br>
if (classLoader != null)
<br>
{
<br>
result = new
EPackageRegistryImpl(getRegistry(classLoader.getParent()));
<br>
classLoaderToRegistryMap.put(classLoader, result);
<br>
}
<br>
}
<br>
return result;
<br>
}
<br>
<br>
inside EPackageRegistryImpl
<br>
<br>
From what i get, withh classLoaderToRegistryMap EMF tracks an
EPackage registry for each classloader, but somehow, such registry
is only initialized for one classloadr, and not for all
classloaders involved.
<br>
<br>
Any hint on how to fix this behaviour?
<br>
<br>
thank you
<br>
</blockquote>
<br>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.02635 seconds