Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » Multi tenancy - NullPointerException(InstanceVariableAttributeAccessor.isNull)
Multi tenancy - NullPointerException [message #1265203] Wed, 05 March 2014 15:21 Go to next message
Viliam Kois is currently offline 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?
Re: Multi tenancy - NullPointerException [message #1275910 is a reply to message #1265203] Sun, 23 March 2014 17:14 Go to previous message
Viliam Kois is currently offline Viliam Kois
Messages: 6
Registered: March 2014
Junior Member
In my opinion, this is a major bug in multi-tenancy functionality. When do you plan to fix it?
Previous Topic:append Postgres Full Text Search expression after having CriteriaQuery
Next Topic:NPE merging @ManyToOne entity
Goto Forum:
  


Current Time: Thu Jul 31 21:57:14 EDT 2014

Powered by FUDForum. Page generated in 0.01533 seconds