google-code-export / objectify-appengine

Automatically exported from code.google.com/p/objectify-appengine
MIT License
1 stars 0 forks source link

Unhelpful, late, error when registering an entity with no no-arg constructor #4

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Register a class with no public no-arg constructor (this works)
2. Do a get() or query() using that entity
3. Get an exception like:
     [java] java.lang.RuntimeException: java.lang.IllegalAccessException:
Class com.googlecode.objectify.EntityMetadata can not access a member of
class com.foo.SomeEntity with modifiers "protected"
     [java]     at
com.googlecode.objectify.EntityMetadata.toObject(EntityMetadata.java:288)
     [java]     at
com.googlecode.objectify.OPreparedQueryImpl$ToObjectIterator.next(OPreparedQuery
Impl.java:166)
     [java]     at
com.googlecode.objectify.OPreparedQueryImpl.asList(OPreparedQueryImpl.java:79)
     [java]     at com.foo.model.DAO.getHistory(DAO.java:43)

What is the expected output? What do you see instead?

An exception during register(), not after register().

What version of the product are you using? On what operating system?

1.0.1

Please provide any additional information below.

I've attached a patch (against trunk@187) that throws an exception during
register() (and a test, too!)

Original issue reported on code.google.com by spudbean on 25 Jan 2010 at 5:02

Attachments:

GoogleCodeExporter commented 9 years ago
Patch applied!

Original comment by lhori...@gmail.com on 25 Jan 2010 at 6:07