Multi tenancy - NullPointerException [message #1265203] |
Wed, 05 March 2014 20:21 |
Viliam Kois Messages: 6 Registered: March 2014 |
Junior Member |
|
|
I'm using Spring with EclipseLink. After adding:
@Multitenant(MultitenantType.TABLE_PER_TENANT)
@TenantTableDiscriminator(type= TenantTableDiscriminatorType.SCHEMA, contextProperty="employee-tenant.id")
I got this exception:
Caused by: Exception [EclipseLink-69] (Eclipse Persistence Services - 2.5.1.v20130918-f2b9fc5): org.eclipse.persistence.exceptions.DescriptorException
...
Caused by: java.lang.NullPointerException
at org.eclipse.persistence.internal.descriptors.InstanceVariableAttributeAccessor.getAttributeValueFromObject(InstanceVariableAttributeAccessor.java:76)
... 75 more
I've put property "eclipselink.tenant-id" to EntityManager after transaction begun, by extending org.springframework.orm.jpa.JpaTransactionManager. I don't have any extra settings on persistence.xml. I was playing with share-emf and share-cache, but it didn't help. I was trying different JVM (6,7,8 ) (i saw mark in your code), but it didn't help too.
After debuging, I've realize, that instance of InstanceVariableAttributeAccessor is created by cloning. The source instance have attribute attributeField null.
Selecting objects from DB works without error, but when I'm trying persist new instance, i got this exception.
Please, could you help me?
|
|
|
|
Powered by
FUDForum. Page generated in 0.04096 seconds