I'm getting a null pointer exception as follows:-
java.lang.NullPointerException
at org.jmanage.easymbean.impl.MBeanBuilder.getModelMBeanConstructorsInfo(Unknown Source)
at org.jmanage.easymbean.impl.MBeanBuilder.getModelMBean(Unknown Source)
at org.jmanage.easymbean.EasyMBean.getMBean(Unknown Source)
.....
I've taken a quick look at the source & noticed the following in getModelMBeanConstructorsInfo method:-
369 try {
370 managedConstructor =(ManagedConstructor) constructor.getAnnotation(ManagedConstructor.class);
371 }
372 catch(NullPointerException npe) {
373 System.out.println("Invalid type for constructor: " + constructor.getName());
374 }
It's great that you use a try/catch block there to catch Null Pointer. The most likely cause of a null pointer in that statement would be if constructor was null. However, in that case, the println in the catch block will throw another null pointer!
Anyway, I'm now going to do some debugging to see if that's the cause of my problems.
Logged In: NO
Actual bug is this line:-
if(constructor!=null) {
Should be:-
if(managedConstructor!=null) {