[
https://issues.apache.org/jira/browse/TUSCANY-1810?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12530663
]
Kelvin Goodson commented on TUSCANY-1810:
-----------------------------------------
This looks like an EMF problem. The failure seems to be in the EMF code at
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl$Delegator.getEFactory(EPackageRegistryImpl.java:250)
which is ......
return delegateRegistry().getEFactory(key);
suggesting null return from ...
protected EPackage.Registry delegateRegistry()
{
return delegateRegistry(Thread.currentThread().getContextClassLoader());
}
which eventually ends up in ...
public static synchronized EPackage.Registry getRegistry(ClassLoader
classLoader)
{
EPackage.Registry result =
(EPackage.Registry)classLoaderToRegistryMap.get(classLoader);
if (result == null)
{
if (classLoader == null)
{
result = null;
}
else
{
result = new EPackageRegistryImpl(getRegistry(classLoader.getParent()));
classLoaderToRegistryMap.put(classLoader, result);
}
}
return result;
}
it would appear to me by eyeballing that code that the supplied ClassLoader is
null (obtained by Thread.currentThread().getContextClassLoader()). I'm not
expert in understanding in what circumstances that might happen.
Could you please run this tiny program which I think embodies the issue in your
environments, with the EMF 2.2.3 jars on your classpath, please and report the
result. If this fails then the problem needs to be reported to EMF.
package org.apache.tuscany.sdo.test;
import org.eclipse.emf.ecore.EDataType;
import org.eclipse.emf.ecore.EcoreFactory;
public class EMFInit {
protected static final EDataType UNINITIALIZED_EDATA_TYPE =
EcoreFactory.eINSTANCE.createEDataType();
public static void main(String[] args) {
System.out.println("Uninitialised data type is " +
(UNINITIALIZED_EDATA_TYPE == null ? "null" : "not null"));
}
}
> SDOUtil.createHelperContext() fails with NPE on HP-UX and Solaris
> -----------------------------------------------------------------
>
> Key: TUSCANY-1810
> URL: https://issues.apache.org/jira/browse/TUSCANY-1810
> Project: Tuscany
> Issue Type: Bug
> Components: Java SDO Implementation
> Affects Versions: Java-SDO-1.0
> Environment: This fails on HP-UX and Solaris. It works fine on all
> other platforms tested.
> Reporter: Travis Nelson
> Priority: Blocker
>
> The following exception is thrown when attempting to create the helper
> context:
> java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl$Delegator.getEFactory(EPackageRegistryImpl.java:250)
> at
> org.eclipse.emf.ecore.impl.EcoreFactoryImpl.init(EcoreFactoryImpl.java:55)
> at org.eclipse.emf.ecore.EcoreFactory.<clinit>(EcoreFactory.java:35)
> at
> org.eclipse.emf.ecore.util.BasicExtendedMetaData.<clinit>(BasicExtendedMetaData.java:2139)
> at
> org.apache.tuscany.sdo.helper.DefaultHelperContextImpl.<init>(DefaultHelperContextImpl.java:31)
> at
> org.apache.tuscany.sdo.helper.HelperProviderImpl.createDefaultHelpers(HelperProviderImpl.java:37)
> at
> org.apache.tuscany.sdo.spi.HelperProviderBase.<init>(HelperProviderBase.java:81)
> at
> org.apache.tuscany.sdo.helper.HelperProviderImpl.<init>(HelperProviderImpl.java:30)
> at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
> at
> sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
> at
> sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
> at java.lang.reflect.Constructor.newInstance(Constructor.java:494)
> at java.lang.Class.newInstance0(Class.java:350)
> at java.lang.Class.newInstance(Class.java:303)
> at
> commonj.sdo.impl.HelperProvider.loadImplementation(HelperProvider.java:157)
> at commonj.sdo.impl.HelperProvider.getInstance(HelperProvider.java:126)
> at commonj.sdo.impl.HelperProvider.<clinit>(HelperProvider.java:69)
> at org.apache.tuscany.sdo.api.SDOUtil.<clinit>(SDOUtil.java:47)
> at
> org.apache.tuscany.sdo.util.SDOUtil.createHelperContext(SDOUtil.java:389)
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]