Hibernate Version: 3.2
user127 wrote:
I would have expected an error message saying a
required attribute is missing...
I would have expected that it finds the type via reflection! I have encountered the same problem (following) and so have taken a closer look.
Code:
org.hibernate.MappingException: class fully.qualified.ClassName not found while looking for property: ...
at org.hibernate.util.ReflectHelper.reflectedPropertyClass(ReflectHelper.java:74)
at org.hibernate.mapping.SimpleValue.setTypeUsingReflection(SimpleValue.java:276)
...
Caused by: java.lang.ClassNotFoundException: fully.qualified.ClassName
...
I am looking at the code where the exception originates on line 100 of org.hibernate.util.ReflectHelper (as follows).
Code:
91: public static Class classForName(String name) throws ClassNotFoundException {
...
100: return Class.forName( name );
101: }
Note, SimpleValue.setTypeUsingReflection is in the stack trace, which seems reasonable. I don't see why it can't find the class; I don't want to have specify a type for each property. I thought the whole point was that type was optional and reflection would be used. :(
Is there something wrong with my class path? What class loader is being used? What class loader
should be used?