[英]Spring Data, EclipseLink, and SimpleLoadTimeWeaver; domain classes loaded by different ClassLoaders
I have a project using Spring Data and EclipseLink. 我有一个使用Spring Data和EclipseLink的项目。 When I try to run, I get this.
当我尝试跑步时,我得到了。
Caused by: java.lang.IllegalArgumentException: No [ManagedType] was found for the key class [CLASSNAME] in the Metamodel - please verify that the [Managed] class was referenced in persistence.xml using a specific <class>scrumspurs.domain.User</class> property or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element.
When I debug, I can see my domain classes are loaded into the Metamodel. 调试时,我可以看到域类已加载到元模型中。 However, they are not
equals
when the Spring Data repositories are being set up. 但是,在设置Spring Data存储库时,它们并不
equals
。 When I investigated I found that the ones that are loaded in the Metamodel are loaded by org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
and the ones being checked are loaded by sun.misc.Launcher$AppClassLoader
. 当我调查时,发现在Metamodel中加载的是由
org.springframework.instrument.classloading.SimpleInstrumentableClassLoader
加载的,而正在检查的是由sun.misc.Launcher$AppClassLoader
加载的。
I'm using a SimpleLoadTimeWeaver
with EclipseLink just to try to get up and running. 我正在将
SimpleLoadTimeWeaver
与EclipseLink一起使用,以尝试启动并运行。 Is this supported? 支持吗? Is there something that needs to be done to have this setup work properly?
要使此设置正常工作,是否需要做些什么?
I had exactly the same problem until I used InstrumentationLoadTimeWeaver. 在使用InstrumentationLoadTimeWeaver之前,我遇到了完全相同的问题。 I found answer here: loadTimeWeaver
我在这里找到答案: loadTimeWeaver
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.