DWR-Newbie-Troubleshooting

– org.directwebremoting.extend.MarshallException caused by InstantiationException: It is logical, but I didn’t find the problem for hours: You’re dealing with beans here, so don’t forget a standard no-arg constructor!

org.directwebremoting.extend.MarshallExceptionNo converter found for class“: Have a look in your DWR-Config. A def <dwr:convert type=”bean” class=”de.company.project.DWRBean*” /> will convert a bean with the name DWRBean, but not a bean DWRBean2. The * is misleading and does only work ‘properly’ in combination with a package: e.g. de.company.project.dwr.*”.

Calls in JS to remote java-methods don’t return a value: If you call a remote method, you cannot simply assign the return value to a var. var x = remote.getX(); is wrong. The calls are done async, so you got to define callback-handler: remote.getX({callback: this.handleResponse.createDelegate(this, object), errorHandler: this.handleError.createDelegate(this, object)}); The createDelegate-method is ExtJs-specific and allows you to use ‘this’ in your callback. If you’re not working with extjs, just leave it out. (Hint for JS-Newbies: the callback-handler in this case only got one parameter, the returned object).