question on using dwr with spring

Posted on 2009-07-09
Last Modified: 2012-08-14
This is my first time using dwr. I am using dwr 1.0 library and trying to integrate it with spring. I have a service class and a main AJAXUser class in which i am getting the bean name for my service layer through WebApplicationContextUtils and in the same AJAXUser class i am calling the service layer to get some values from the DB. Below you can see my configuration for dwr.xml.

EVerytime i run my JSP page and tries to click on a button which will call an Ajax function to output the values  i get a javascript error 'name cannot be null' and i get an exception in my console. I am sure that my service layer is defined properly in applicationContext.xml. It looks like the dwr.xml cannot instantiate my AJAXUser class.


"-//GetAhead Limited//DTD Direct Web Remoting 1.0//EN"




 <create creator="spring" javascript="AJAX">

 <param name="class" value="user.AJAXUser"></param>





Error :-


WARNING: Method execution failed: 

java.lang.IllegalArgumentException: 'name' must not be null

	at org.springframework.util.Assert.notNull(

	at org.springframework.beans.factory.BeanFactoryUtils.transformedBeanName(










Open in new window

Question by:Micheal_Male
  • 2
  • 2
LVL 10

Expert Comment

ID: 24820772
If you are using Spring you use the param beanname and specfiy this name. Class is only used for creator "new".
So it have to be something like this:

Also have a look here:

<create creator="spring" javascript="AJAX">

    <param name="beanName" value="ajaxUser"/>


Open in new window


Author Comment

ID: 24828370
Thank you mahome. I created a beanName by the name ajaxUser in my applicationContext and had the property set to my userService and now my class is getting compiled. I actually thought the beanname was the ACTUAL beanname of my controller class.

LVL 10

Accepted Solution

mahome earned 250 total points
ID: 24837732
Yes it's a little bit confusing, as there are two ways. If you use the creator "new" (see snippet) it would be the classname, but in that case DWR would instantiate your class and not Spring. In the spring way it's not necessary to declare the class as the declaration of the spring bean already contains the class-info.

<create creator="new" javascript="AJAX">

    <param name="class" value="user.ajaxUser"/>


Open in new window


Author Closing Comment

ID: 31601951
Perfect explanation. Thanks

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 103
solarwind tftp server 2 45
ForLoop Example 3 40
Why my table column Id is not passed to java object? 4 28
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
This tutorial explains how to use the VisualVM tool for the Java platform application. This video goes into detail on the Threads, Sampler, and Profiler tabs.

863 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now