If your custom Inspector returns no <entity> blocks, or returns <entity> blocks with the wrong type attribute, Metawidget will ignore their result. Try wrapping your Inspector inside CompositeInspector and enabling TRACE logging, to see what your Inspector is returning.
If you are using Oracle's implementation of Java, Metawidget's annotation support requires Java 5.0u6 or later, which includes a fix for this bug (Bug Parade ID: 6322301).
First, if you are using custom annotations check they are marked to 'retain at runtime':
@Retention( RetentionPolicy.RUNTIME ) @Target( { ElementType.FIELD, ElementType.METHOD } ) public @interface MyAnnotation { String value(); }
Next, remember that annotations are designed to 'silently fall away' in environments that do not support them: they never throw ClassDefNotFoundError. For example, if a JPA-annotated class is transferred to an application tier without ejb3-persistence.jar (or equivalent) in its classpath, the JPA annotations will disappear. If this is the case, either add the appropriate JAR to the tier, or consider implementing a remote inspector (see Section 9.1, “Order Properties”).
Finally, note that by default Metawidget discovers annotations placed on public fields and public getter/setter methods, but not on private fields. Metawidget must work with public properties because the various widget libraries, binding frameworks and validation frameworks it wires together all need to access public properties. And because there is no standardized way to infer which private field relates to which public getter/setter method, Metawidget cannot relate the two. Either:
add your annotations to public getter/setter methods
use JavaBeanPropertyStyleConfig.setPrivateFieldConvention to specify a naming convention to relate public getter/setter methods to private fields (see the section called “JavaBeanPropertyStyle”)
implement your own PropertyStyle with your own way of relating public getter/setter methods to private fields (see the section called “Implementing Your Own PropertyStyle”, potentially overriding JavaBeanPropertyStyleConfig.getPrivateField)