There are upcoming maintenance events which may impact our services. Learn more

java.lang.IllegalArgumentException: wrong number of arguments Print

  • 5

There are 2 listed ways to fix this issue, the first is the fastest and that is to download the latest version from the MuraCMS code base and replace the file located at: /requirements/mura/javaloader/JavaProxy.cfc

Option 1: Replace the JavaProxy.cfc

The latest JavaProxy can be found on the MuraCMS GitHub account. Click here to view the raw version of the stable version of javaProxy,cfc

Option 2: Update the JavaProxy.cfc with amended code

CF10, CF11 and CF2016 have some compatibility issues with the JavaLoader.cfc (/requirements/mura/javaloader/JavaProxy.cfc). This is fixed in the latest Mura build but some plugins for Slatwall and Mura may include their own JavaLoader.cfc that still needs fixing.

JavaProxy.cfc (line 67):

 		constructor = _resolveMethodByParams("Constructor", _getClass().getConstructors(), arguments);  
 
-		instance = constructor.newInstance(_buildArgumentArray(arguments));  
+		if (StructCount(arguments) > 0){  
+			   instance = constructor.newInstance(_buildArgumentArray(arguments));  
+		} else {  
+			   instance = constructor.newInstance(JavaCast("null", 0));  
+		}  
 
 		_setClassInstance(instance);

Example StackTrace:

java.lang.IllegalArgumentException: wrong number of arguments at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)


Was this answer helpful?

« Back