Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » ExceptionInitializationError
ExceptionInitializationError [message #417252] Mon, 03 March 2008 22:29 Go to next message
Xavier Coulon is currently offline Xavier CoulonFriend
Messages: 58
Registered: July 2009
Member
Hello,

I just generated a model with EMF. I've got the core, edit, editor and
tests plugin projects in my workspace. When I run the JUnit Tests from the
tests projects, I get the following error, because the
call to
eclipse.emf.ecore.impl.EPackageRegistryImpl,delegateRegistry (Thread.currentThread().getContextClassLoader())
takes null as a parameter, or said another way, the value of
Thread.currentThread().getContextClassLoader() is null.

The problem occurs on MacOSX 10.5 with Eclipse 3.3.2 / EMF 2.3.0 (build
20080205)
Here is the statcktrace :

java.lang.ExceptionInInitializerError
at
org.log4jconfig.model.DocumentOutputTest.setUp(DocumentOutpu tTest.java:65)
at junit.framework.TestCase.runBare(TestCase.java:128)
at junit.framework.TestResult$1.protect(TestResult.java:106)
at junit.framework.TestResult.runProtected(TestResult.java:124)
at junit.framework.TestResult.run(TestResult.java:109)
at junit.framework.TestCase.run(TestCase.java:120)
at junit.framework.TestSuite.runTest(TestSuite.java:230)
at junit.framework.TestSuite.run(TestSuite.java:225)
at
org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
at
org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
at
org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
Caused by: java.lang.NullPointerException
at
org.eclipse.emf.ecore.impl.EPackageRegistryImpl$Delegator.ge tEPackage(EPackageRegistryImpl.java:245)
at
org.log4jconfig.metadata.Log4jElementsPackage.init(Log4jElem entsPackage.java:984)
at
org.log4jconfig.metadata.Log4jElementsPackage.<clinit>(Log4jElementsPackage.java:78)
... 14 more




Thanks in advance
Xavier
Re: ExceptionInitializationError [message #417254 is a reply to message #417252] Mon, 03 March 2008 23:02 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Xavier,

I've never seen a case there the thread context class loader is null,
except during process shutdown. I think this is a problem in the SDK
itself. I think changes in EMF 2.4 avoid this problem as well...


Xavier wrote:
> Hello,
>
> I just generated a model with EMF. I've got the core, edit, editor and
> tests plugin projects in my workspace. When I run the JUnit Tests from
> the tests projects, I get the following error, because the call to
> eclipse.emf.ecore.impl.EPackageRegistryImpl,delegateRegistry (Thread.currentThread().getContextClassLoader())
> takes null as a parameter, or said another way, the value of
> Thread.currentThread().getContextClassLoader() is null.
>
> The problem occurs on MacOSX 10.5 with Eclipse 3.3.2 / EMF 2.3.0
> (build 20080205)
> Here is the statcktrace :
>
> java.lang.ExceptionInInitializerError
> at
> org.log4jconfig.model.DocumentOutputTest.setUp(DocumentOutpu tTest.java:65)
>
> at junit.framework.TestCase.runBare(TestCase.java:128)
> at junit.framework.TestResult$1.protect(TestResult.java:106)
> at junit.framework.TestResult.runProtected(TestResult.java:124)
> at junit.framework.TestResult.run(TestResult.java:109)
> at junit.framework.TestCase.run(TestCase.java:120)
> at junit.framework.TestSuite.runTest(TestSuite.java:230)
> at junit.framework.TestSuite.run(TestSuite.java:225)
> at
> org.eclipse.jdt.internal.junit.runner.junit3.JUnit3TestRefer ence.run(JUnit3TestReference.java:130)
>
> at
> org.eclipse.jdt.internal.junit.runner.TestExecution.run(Test Execution.java:38)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:460)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTe sts(RemoteTestRunner.java:673)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(R emoteTestRunner.java:386)
>
> at
> org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main( RemoteTestRunner.java:196)
>
> Caused by: java.lang.NullPointerException
> at
> org.eclipse.emf.ecore.impl.EPackageRegistryImpl$Delegator.ge tEPackage(EPackageRegistryImpl.java:245)
>
> at
> org.log4jconfig.metadata.Log4jElementsPackage.init(Log4jElem entsPackage.java:984)
>
> at
> org.log4jconfig.metadata.Log4jElementsPackage.<clinit>(Log4jElementsPackage.java:78)
>
> ... 14 more
>
>
>
>
> Thanks in advance
> Xavier
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ExceptionInitializationError [message #417294 is a reply to message #417254] Tue, 04 March 2008 18:23 Go to previous messageGo to next message
Xavier Coulon is currently offline Xavier CoulonFriend
Messages: 58
Registered: July 2009
Member
Hello Ed,

I just tried with the latest milestone of Eclipse Ganymede and the problem
still occurs...
What other pieces of information should I provide to solve this problem ?

Thank you in advance
/Xavier
Re: ExceptionInitializationError [message #417297 is a reply to message #417294] Tue, 04 March 2008 18:52 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Xavier,

I guess the null pointer exception has just moved elsewhere. Is
something fiddling with your thread's context class loader that it's
null? I've never seen a case of it being before. It's expect it to be
just ClassLoader.getSystemClassLoader...

You can use the VM option
-Dorg.eclipse.emf.ecore.EPackage.Registry.INSTANCE=org.eclip se.emf.ecore.impl.EPackageRegistryImpl
to use the other implementation...


Xavier wrote:
> Hello Ed,
>
> I just tried with the latest milestone of Eclipse Ganymede and the
> problem still occurs...
> What other pieces of information should I provide to solve this problem ?
>
> Thank you in advance
> /Xavier
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Re: ExceptionInitializationError [message #417301 is a reply to message #417297] Tue, 04 March 2008 21:38 Go to previous messageGo to next message
Xavier Coulon is currently offline Xavier CoulonFriend
Messages: 58
Registered: July 2009
Member
Ed,

I clean every project (removed all generated classes), then re-generated
all classes from the gen model. It works now, but i still can't say what
was wrong...

Thanks anyway for your help.
/Xavier
Re: ExceptionInitializationError [message #417302 is a reply to message #417301] Tue, 04 March 2008 22:01 Go to previous message
Ed Merks is currently offline Ed MerksFriend
Messages: 33147
Registered: July 2009
Senior Member
Xavier,

Very odd indeed. I'm glad it's working for you now...


Xavier wrote:
> Ed,
>
> I clean every project (removed all generated classes), then
> re-generated all classes from the gen model. It works now, but i still
> can't say what was wrong...
> Thanks anyway for your help.
> /Xavier
>


Ed Merks
Professional Support: https://www.macromodeling.com/
Previous Topic:Question about persistence in EMF
Next Topic:Customized getters and setters
Goto Forum:
  


Current Time: Sun May 12 04:57:39 GMT 2024

Powered by FUDForum. Page generated in 0.04099 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top