Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EclipseLink » MultiTenancy/Inheritance: Strange NPE
MultiTenancy/Inheritance: Strange NPE [message #933092] Thu, 04 October 2012 18:21 Go to next message
Thomas Kratz is currently offline Thomas Kratz
Messages: 163
Registered: July 2009
Senior Member
Hi, I'm not getting it. I have a
@javax.persistence.Entity
@DiscriminatorValue("ArticleBook")
public class ArticleBook extends AbstractArticle implements java.io.Serializable {

....
        @ManyToOne
	public Book getBook() {
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}
...


that extends
@javax.persistence.Entity
@Table(name = "acc_article")
@Inheritance(strategy=InheritanceType.SINGLE_TABLE)
@Multitenant( value=MultitenantType.TABLE_PER_TENANT)
public abstract class AbstractArticle extends BasePropertyChangeSupport implements java.io.Serializable,DeletableEntity {


and
Book itself is multitenant,too.

with this setup I can reproduce

Caused by: java.lang.NullPointerException
	at org.eclipse.persistence.mappings.ForeignReferenceMapping.isLockableMapping(ForeignReferenceMapping.java:1000)
	at org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3613)
	at org.eclipse.persistence.descriptors.ClassDescriptor.postInitialize(ClassDescriptor.java:3583)
	at org.eclipse.persistence.internal.sessions.AbstractSession.updateTablePerTenantDescriptors(AbstractSession.java:1216)
	at org.eclipse.persistence.sessions.server.ClientSession.<init>(ClientSession.java:126)
	at org.eclipse.persistence.sessions.server.ServerSession.acquireClientSession(ServerSession.java:390)
	at org.eclipse.persistence.internal.jpa.EntityManagerImpl.getActivePersistenceContext(EntityManagerImpl.java:1714)
	at org.eclipse.persistence.internal.jpa.transaction.EntityTransactionImpl.begin(EntityTransactionImpl.java:49)
	at org.springframework.orm.jpa.DefaultJpaDialect.beginTransaction(DefaultJpaDialect.java:70)
	at org.springframework.orm.jpa.JpaTransactionManager.doBegin(JpaTransactionManager.java:332)


Can anyone give me an idea what causes the referenceDescriptor to be null here?

Any (quick Smile help will be appreciated.

Thomas

[Updated on: Thu, 04 October 2012 18:21]

Report message to a moderator

Re: MultiTenancy/Inheritance: Strange NPE [message #939171 is a reply to message #933092] Wed, 10 October 2012 13:43 Go to previous message
James Sutherland is currently offline James Sutherland
Messages: 1939
Registered: July 2009
Location: Ottawa, Canada
Senior Member

Do you get the error if you remove @Multitenant?

There could be an issue with this an inheritance. Does it work without the inheritance?

Ensure you have created your persistence unit correctly.

It could be a bug, try the latest 2.4 patch version to see if it has been fixed, otherwise log a bug with all of your code and details.


James : Wiki : Book : Blog : Twitter
Previous Topic:Implemeting postMerge events
Next Topic:Templates for CREATE, INSERT, UPDATE, DELETE queries
Goto Forum:
  


Current Time: Wed Sep 17 05:54:25 GMT 2014

Powered by FUDForum. Page generated in 0.01502 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software