ishara / orika

Automatically exported from code.google.com/p/orika
0 stars 0 forks source link

java.lang.ClassNotFoundException: org.eclipse.core.resources.IWorkspaceRoot #179

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. JUnit test 
2. Spring
3. Java 8
4. Run in eclipse 4.4

Log:

06:30:47.904 [main] DEBUG m.g.orika.impl.DefaultMapperFactory - No mapper 
registered for (UserDto, User): attempting to generate
06:30:47.948 [main] DEBUG m.g.orika.metadata.ClassMapBuilder - ClassMap created:
    ClassMapBuilder.map(UserDto, User)
06:30:48.024 [main] DEBUG m.g.o.impl.generator.MapperGenerator - Generating new 
mapper for (UserDto, User)
    Orika_User_UserDto_Mapper132796226667916$0.mapAToB(UserDto, User) {
    }
    Orika_User_UserDto_Mapper132796226667916$0.mapBToA(User, UserDto) {
    }
06:30:48.305 [main] DEBUG o.s.t.c.s.DirtiesContextTestExecutionListener - After 
test class: context [DefaultTestContext@6c3708b3 testClass = MappingTest, 
testInstance = [null], testMethod = [null], testException = [null], 
mergedContextConfiguration = [MergedContextConfiguration@185d8b6 testClass = 
MappingTest, locations = '{classpath*:/conf/context.xml, 
classpath*:/conf/context-test.xml}', classes = '{}', contextInitializerClasses 
= '[]', activeProfiles = '{}', propertySourceLocations = '{}', 
propertySourceProperties = '{}', contextLoader = 
'org.springframework.test.context.support.DelegatingSmartContextLoader', parent 
= [null]]], dirtiesContext [false].

Stack trace:

java.lang.NoClassDefFoundError: Lorg/eclipse/core/resources/IWorkspaceRoot;
    at java.lang.Class.getDeclaredFields0(Native Method)
    at java.lang.Class.privateGetDeclaredFields(Class.java:2570)
    at java.lang.Class.getDeclaredFields(Class.java:1903)
    at com.carrotsearch.sizeof.RamUsageEstimator.createCacheEntry(RamUsageEstimator.java:568)
    at com.carrotsearch.sizeof.RamUsageEstimator.measureSizeOf(RamUsageEstimator.java:532)
    at com.carrotsearch.sizeof.RamUsageEstimator.sizeOfAll(RamUsageEstimator.java:380)
    at com.carrotsearch.sizeof.RamUsageEstimator.sizeOfAll(RamUsageEstimator.java:361)
    at ma.glasnost.orika.StateReporter.humanReadableSizeInMemory(StateReporter.java:48)
    at ma.glasnost.orika.impl.DefaultMapperFactory.reportCurrentState(DefaultMapperFactory.java:1556)
    at ma.glasnost.orika.StateReporter.reportCurrentState(StateReporter.java:33)
    at ma.glasnost.orika.impl.ExceptionUtility.decorate(ExceptionUtility.java:65)
    at ma.glasnost.orika.impl.DefaultMapperFactory.lookupObjectFactory(DefaultMapperFactory.java:1014)
    at ma.glasnost.orika.impl.DefaultMapperFactory.lookupObjectFactory(DefaultMapperFactory.java:925)
    at ma.glasnost.orika.impl.MapperFacadeImpl.resolveMappingStrategy(MapperFacadeImpl.java:218)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:734)
    at ma.glasnost.orika.impl.MapperFacadeImpl.map(MapperFacadeImpl.java:714)
    at org.jresearch.commons.gwt.server.service.mapper.OrikaSpringMapper.map(OrikaSpringMapper.java:142)
    at org.jresearch.commons.flexess.umi.BaseUmiUserManager.getUser(BaseUmiUserManager.java:214)
    at org.jresearch.flexess.core.api.impl.UserService.getUser(UserService.java:35)
    at org.jresearch.flexess.client.impl.UserManager.getUser(UserManager.java:48)
    at org.jresearch.flexess.client.impl.AuthorizationManager.loadRoles(AuthorizationManager.java:197)
    at org.jresearch.flexess.client.impl.AuthorizationManager.initUserContext(AuthorizationManager.java:487)
    at com.jresearchsoft.booking.flexess.datacreator.ServerDataCreator.createApplicationData(ServerDataCreator.java:33)
    at org.jresearch.commons.flexess.datacreator.AbstractServerDataCreator.processLoadedEvent(AbstractServerDataCreator.java:117)
    at org.jresearch.commons.flexess.datacreator.AbstractServerDataCreator.processEvent(AbstractServerDataCreator.java:93)
    at org.jresearch.commons.flexess.datacreator.AbstractServerDataCreator.processEvent(AbstractServerDataCreator.java:1)
    at org.jresearch.commons.flexess.datacreator.AbstractBeanApplicationListener.onApplicationEvent(AbstractBeanApplicationListener.java:49)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
    at org.jresearch.flexess.core.api.load.impl.ModelLoader.reloadModels(ModelLoader.java:146)
    at org.jresearch.flexess.core.api.load.impl.ModelLoader.onApplicationEvent(ModelLoader.java:55)
    at org.jresearch.flexess.core.api.load.impl.ModelLoader.onApplicationEvent(ModelLoader.java:1)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.invokeListener(SimpleApplicationEventMulticaster.java:151)
    at org.springframework.context.event.SimpleApplicationEventMulticaster.multicastEvent(SimpleApplicationEventMulticaster.java:128)
    at org.springframework.context.support.AbstractApplicationContext.publishEvent(AbstractApplicationContext.java:331)
    at org.springframework.context.support.AbstractApplicationContext.finishRefresh(AbstractApplicationContext.java:773)
    at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:483)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:125)
    at org.springframework.test.context.support.AbstractGenericContextLoader.loadContext(AbstractGenericContextLoader.java:60)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.delegateLoading(AbstractDelegatingSmartContextLoader.java:108)
    at org.springframework.test.context.support.AbstractDelegatingSmartContextLoader.loadContext(AbstractDelegatingSmartContextLoader.java:260)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContextInternal(DefaultCacheAwareContextLoaderDelegate.java:63)
    at org.springframework.test.context.DefaultCacheAwareContextLoaderDelegate.loadContext(DefaultCacheAwareContextLoaderDelegate.java:83)
    at org.springframework.test.context.DefaultTestContext.getApplicationContext(DefaultTestContext.java:74)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.injectDependencies(DependencyInjectionTestExecutionListener.java:116)
    at org.springframework.test.context.support.DependencyInjectionTestExecutionListener.prepareTestInstance(DependencyInjectionTestExecutionListener.java:82)
    at org.springframework.test.context.TestContextManager.prepareTestInstance(TestContextManager.java:212)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.createTest(SpringJUnit4ClassRunner.java:199)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner$1.runReflectiveCall(SpringJUnit4ClassRunner.java:251)
    at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.methodBlock(SpringJUnit4ClassRunner.java:253)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:216)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.runChild(SpringJUnit4ClassRunner.java:82)
    at org.junit.runners.ParentRunner$3.run(ParentRunner.java:238)
    at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:63)
    at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:236)
    at org.junit.runners.ParentRunner.access$000(ParentRunner.java:53)
    at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:229)
    at org.springframework.test.context.junit4.statements.RunBeforeTestClassCallbacks.evaluate(RunBeforeTestClassCallbacks.java:60)
    at org.springframework.test.context.junit4.statements.RunAfterTestClassCallbacks.evaluate(RunAfterTestClassCallbacks.java:67)
    at org.junit.runners.ParentRunner.run(ParentRunner.java:309)
    at org.springframework.test.context.junit4.SpringJUnit4ClassRunner.run(SpringJUnit4ClassRunner.java:162)
    at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:50)
    at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:38)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:459)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:675)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:382)
    at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:192)
Caused by: java.lang.ClassNotFoundException: 
org.eclipse.core.resources.IWorkspaceRoot
    at java.net.URLClassLoader$1.run(URLClassLoader.java:372)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:360)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
    ... 69 more

Original issue reported on code.google.com by sspirido...@gmail.com on 31 Oct 2014 at 5:43

GoogleCodeExporter commented 8 years ago
Ok. I find out the problem and there is the result: 

1. Orika try to map something
2. Get the exception during the mapping
3. Try to build report
4. And get the SECOND exception, which HIDE the original one.

Possible solutions:
1. Switch off the report generation on exception, e.g. 
factoryBuilder.dumpStateOnException(false);
2. Catch the exception on the report generation in ExceptionUtility.
3. Find out why the org.eclipse.core.resources.IWorkspaceRoot can't be loaded. 
My objects does not use the eclipse classes, so I assume that it is Orika 
class. 

Original comment by sspirido...@gmail.com on 21 Nov 2014 at 5:40