简体   繁体   English

Spring Data,EclipseLink和SimpleLoadTimeWeaver; 由不同的ClassLoader加载的域类

[英]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.

相关问题 在Spring Boot和Logback中由不同的Classloader加载的类 - Classes loaded by different Classloaders in Spring Boot and Logback 检测不同ClassLoader加载的类的Class对象等效性 - Detecting Class object equivalence for classes loaded by different ClassLoaders 从不同ClassLoader加载的类访问静态方法 - Access static method from classes loaded by different ClassLoaders 当通过Spring持久化数据时,不同的类加载器会导致ClassCastException - Different classloaders cause ClassCastException when persisting data via Spring 为什么不同自定义类加载器加载的类不能互相调用 - Why the classes loaded by different custom classloaders can't invoke each other 更改对不同类加载器加载的单例类的影响 - Impact of changes on singleton class loaded by different classloaders 使用不同的类加载器加载类,以便在不需要时从JVM卸载它们 - loading classes with different classloaders to unload them from the JVM when not needed 为什么以及在哪些情况下使用不同的类加载器两次加载 bean? - Why and in which cases spring load bean twice using different classLoaders? 如果一个类是由不同的类加载器加载的,那么(sun-jvm)热点优化会发生多次吗? - Does (sun-jvm) hotspot optimization take place multiple times, if a class is loaded by different classloaders? 使用EclipseLink作为JPA提供程序的Spring Data JPA:EclipseLink中可能存在错误? - Spring Data JPA using EclipseLink as JPA provider: possible bug in EclipseLink?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM