Bug 310 : NullPointerException at BeanEmbeddedMetaFactory.java: 46 ... when EmbeddedId class not registered
Priority 
Medium
Reported Version 
 
Logged By 
Rob
Status 
Fixed
Fixed Version 
2.7.0
Assigned To 
 
Product 
Ebean - core
Duplicate Of 
 
Created 
02/07/2010
Updated 
02/07/2010
Type 
Bug
 
Attachments 
No attachments

Hi - just found your framework and I think its great.
It is so easy! I am a professional Hibernate-wrestler and I am glad to
see your solution!

1 suggestion: In my test example I was using a class with and
composite key (@EmbeddedId).

I forgot to add the composite key class to the ebean server config:
config.addClass(TObjectResourcePK.class); (forgot this line)

I wrestled for some time with the configuration until I found and
fixed it.

The NullPointer I got is:
java.lang.NullPointerException

com.avaje.ebeaninternal.server.deploy.BeanEmbeddedMetaFactory.create(BeanEmbeddedMetaFactory.java:
46)

com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne.(BeanPropertyAssocOne.java:
96)

com.avaje.ebeaninternal.server.deploy.BeanPropertyAssocOne.(BeanPropertyAssocOne.java:
79)
.... and so on.

Looking at the source of line 46:
BeanProperty[] sourceProperties = targetDesc.propertiesBaseScalar();

My guess is that targetDesc is null b/c it couldn't find my PK-class.
Maybe you could add a more descriptive message (vs. a null pointer)?

I think that the messages that ebean puts out are first rate otherwise
- very descriptive and very helpful.

Thank you for your work,
Olaf

 
Rob 02 Jul 22:39
Fixed in HEAD

Fixed in HEAD.

woResponse

Upload a file