Exception [EclipseLink-7114] (Eclipse Persistence Services - 2.5.1.v20130824-981335c): org.eclipse.persistence.exceptions.ValidationException Exception Description: Isolated data is not currently supported inside Client Session Broker.
This exception occurs during application startup. The disgusting aspect of this exception is that it happens randomly!
The application uses the Eclipselink Composite Persistence Unit function. After starting the application, it prints the following log messages before throwing this exception:
[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
After that, several messages of the following type are printed:
[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.
The PU logout messages are then printed as follows:
[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
Immediately after this, the exclusion check from isolated data is excluded:
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)
The following is 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>
The structure of the corresponding PU persistence.xml is shown below. They all follow a similar structure:
<?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>