gpt4 book ai didi

java - Eclipselink 异常 : Isolated Data is not currently supported

转载 作者:塔克拉玛干 更新时间:2023-11-03 03:57:36 24 4
gpt4 key购买 nike

Exception [EclipseLink-7114] (Eclipse Persistence Services - 2.5.1.v20130824-981335c): org.eclipse.persistence.exceptions.ValidationException Exception Description: Isolated Data is not currently supported within a Client Session Broker.

此异常发生在应用程序启动期间。 此异常令人沮丧的方面是它是随机发生的!

该应用程序使用 Eclipselink 的 Composite Persistence Unit特征。启动应用程序时,它会在抛出此异常之前打印以下日志消息:

[EL Info]: connection: 2016-11-27 12:26:24.125--ServerSession(1424344630)--PU1 login successful
[EL Info]: connection: 2016-11-27 12:26:24.14--ServerSession(1670276602)--PU2 login successful
[EL Info]: connection: 2016-11-27 12:26:24.14--ServerSession(780412982)-- PU3 login successful

随后打印了一些以下类型的消息:

[EL Warning]: metadata: 2016-11-27 12:26:24.156--ServerSession(1424344630)--Reverting the lazy setting on the OneToOne or ManyToOne attribute [attrname] for the entity class [class fully_qualified_class_name] since weaving was not enabled or did not occur. 

然后PU注销信息打印如下:

[EL Info]: connection: 2016-11-27 12:26:24.906--ServerSession(1424344630)--PU1 logout successful
[EL Info]: connection: 2016-11-27 12:26:24.906--ServerSession(1670276602)--PU2 logout successful
[EL Info]: connection: 2016-11-27 12:26:24.906--ServerSession(780412982)--PU3 logout successful

之后立即抛出有关孤立数据的验证异常:

Nov 27, 2016 12:26:24 PM org.apache.catalina.core.ApplicationContext log
SEVERE: StandardWrapper.Throwable
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'messageSource' defined in ServletContext resource [/WEB-INF/mvc dispatcher-servlet.xml]: Bean instantiation via constructor failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [fully_qualified_class_name]: Constructor threw exception; nested exception is Exception [EclipseLink-7114] (Eclipse Persistence Services - 2.5.3.v20150122-8d884e3): org.eclipse.persistence.exceptions.ValidationException Exception Description: Isolated Data is not currently supported within a Client Session Broker. Session named PU3 contains descriptors representing isolated data.
at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:275)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:1143)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:1046)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:510)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:482)
at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:306)
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:230)
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:302)
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
at org.springframework.context.support.AbstractApplicationContext.initMessageSource(AbstractApplicationContext.java:697)
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:526)
at org.springframework.web.servlet.FrameworkServlet.configureAndRefreshWebApplicationContext(FrameworkServlet.java:667)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:633)
at org.springframework.web.servlet.FrameworkServlet.createWebApplicationContext(FrameworkServlet.java:681)
at org.springframework.web.servlet.FrameworkServlet.initWebApplicationContext(FrameworkServlet.java:552)
at org.springframework.web.servlet.FrameworkServlet.initServletBean(FrameworkServlet.java:493)
at org.springframework.web.servlet.HttpServletBean.init(HttpServletBean.java:136)
at javax.servlet.GenericServlet.init(GenericServlet.java:160)
at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1280)
at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1193)
at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1088)
at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5176)
at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5460)
at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1559)
at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1549)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

以下是Composite PU persistence.xml:

<persistence xmlns="http://java.sun.com/xml/ns/persistence"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence persistence_1_0.xsd" version="1.0">
<persistence-unit name="compositePu" transaction-type="RESOURCE_LOCAL">
<provider> org.eclipse.persistence.jpa.PersistenceProvider </provider>
<jar-file>PU1-entities.jar</jar-file>
<jar-file>PU2-entities.jar</jar-file>
<jar-file>PU3-entities.jar</jar-file>
<properties>
<property name="eclipselink.composite-unit" value="true" />
</properties>
</persistence-unit>

以下是各个PU的persistence.xml的结构。它们都遵循相似的结构:

<?xml version="1.0" encoding="UTF-8"?>
<persistence version="2.0"
xmlns="http://java.sun.com/xml/ns/persistence" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd">
<persistence-unit name="PU3" transaction-type="RESOURCE_LOCAL">
<provider>org.eclipse.persistence.jpa.PersistenceProvider</provider>

---- list of fully qualified entity class names ----

<properties>
<property name="eclipselink.weaving" value="false" />
<property name="javax.persistence.validation.group.pre-update" value="none" />
<property name="eclipselink.target-database" value="MySQL" />
<property name="eclipselink.ddl-generation" value="none" />
<property name="eclipselink.persistence-context.flush-mode" value="COMMIT" />
<property name="eclipselink.persistence-context.close-on-commit" value="true" />
<property name="javax.persistence.validation.group.pre-persist" value="" />
<property name="eclipselink.cache.shared.default" value="false" />
<property name="eclipselink.logging.parameters" value="true" />
<property name="eclipselink.logging.level" value="FINEST" />
<property name="eclipselink.logging.parameters" value="true" />
<property name="eclipselink.cache.shared.default" value="false" />
</properties>
</persistence-unit>
</persistence>

最佳答案

警告:这不是正确答案。问题再次出现!

同时将 eclipselink.cache.shared.defaulteclipselink.multitenant.tenants-share-cache 设置为 false 消除了孤立数据异常.

eclipselink.cache.shared.default 设置为 false 并具有 Multi-Tenancy Joined Table Inheritance 实体,会触发随机发生的行为,如 Cache Isolation Level Warning on Parent Entity 中所述。 .但是,请注意,我对随机行为一无所知。

除了将 eclipselink.cache.shared.default 设置为 false 之外,将 eclipselink.multitenant.tenants-share-cache 设置为 false 会导致一致消除隔离-数据异常。

关于java - Eclipselink 异常 : Isolated Data is not currently supported,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35285956/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com