hi,

I get errors like this while working on the forum:

java.lang.NullPointerException
        sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        java.lang.reflect.Method.invoke(Method.java:324)
        
org.mmbase.util.functions.SetFunction.getFunctionValue(SetFunction.java:44)

After a long search (and adding useful error messages ;-) I think I've nailed the problem down to and 'int' (small i, that's right) being 'null' .... I'm not completely sure though.

In this reflect stuff te parameters to a method are passed as an Object array, so you cannot use primitive types. You'll have to use the Object-types and they will be converted to primitive types as the method gets invoked.

I'd say in my case the system breaks at trying to convert an 'Integer' with value 'null' (the variable is not set in the page or something) to an 'int' ... what should it do in such a case? IllegalArgumentException or convert to '0'?

My (other) error message says this:

2005-07-06 20:32:33,801 ERROR   mmbase.util.functions.SetFunction - Function ca
ll failed (java.lang.NullPointerException) : getPostThreadNavigation, method: p
ublic org.mmbase.module.core.MMObjectNode org.mmbase.applications.mmbob.gui.Con
troller.getPostThreadNavigation(java.lang.String,java.lang.String,java.lang.Str
ing,int,int,int,java.lang.String,java.lang.String), instance: org.mmbase.applic
[EMAIL PROTECTED], parameters: [class java.lang.String forumid
=1041, class java.lang.String postareaid=1715, class java.lang.String postthrea
did=1717, int posterid=null, int page=1, int pagesize=5, class java.lang.String
 baseurl=thread.jsp, class java.lang.String cssclass=null]

Of which mainly the part 'int posterid=null' is really looking interesting, leading to the idea I've mentioned above.

I think this is closely related to the DataType stuff which only has been added recently - maybe something has been overlooked?

I'll keep searching, but maybe someone already knows what's it about...

groeten,

  Simon
_______________________________________________
Developers mailing list
[email protected]
http://lists.mmbase.org/mailman/listinfo/developers

Reply via email to