Announcement Announcement Module

Spring Modules forum decommissioned in favor of Spring Extensions

As the Spring Modules project has been replaced by the Spring Extensions ( project, this forum has been decommissioned in favour of Spring Extensions one at:

Please see the Spring Extensions home page for a complete list of current projects in Java, .NET and ActionScript. You can also propose one if you want.

Costin Leau
SpringSource - Spring Training, Consulting, and Support - "From the Source"
See more
See less
java.lang.NoClassDefFoundError: AjaxInterceptor Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • java.lang.NoClassDefFoundError: AjaxInterceptor

    Hi, I'm trying to integrate AJAX on SpringMVC.

    I red the tutorial on this link:

    I created this handler
    import java.util.LinkedList;
    import java.util.List;
    import org.springmodules.xt.ajax.action.ReplaceContentAction;
    import org.springmodules.xt.ajax.component.Option;
    import org.springmodules.xt.ajax.AbstractAjaxHandler;
    import org.springmodules.xt.ajax.AjaxActionEvent;
    import org.springmodules.xt.ajax.AjaxResponse;
    import org.springmodules.xt.ajax.AjaxResponseImpl;
    import springmvc.domain.Product;
    import springmvc.service.ProductManager;
    public class LoadProductsHandler extends AbstractAjaxHandler{
    	private ProductManager productManager;
    	public AjaxResponse loadProducts(AjaxActionEvent event){
    		 List<Product> list = productManager.getListProduct();
    		 List options = new LinkedList();
    		 Option first = new Option("-1", "Select one ...");
             for(Product product : list) {
    	         Option option = new Option(product, "description", "price");
             ReplaceContentAction action = new ReplaceContentAction("products", options);
             AjaxResponse response = new AjaxResponseImpl();
             return response;
    	public void setProductManager(ProductManager productManager) {
    		this.productManager = productManager;
    and my spring-servlet.xml is this:
     <!-- AJAX -->
    	<bean id="ajaxInterceptor" class="org.springmodules.xt.ajax.AjaxInterceptor">
          <property name="handlerMappings">
    		      <prop key="/jsp/loadProducts.jsp">ajaxLoadProductsHandler</prop>		      
    	 <bean id="ajaxLoadProductsHandler" class="springmvc.ajax.LoadProductsHandler">
             <property name="productManager" ref="productManager"/>
    When I try to start the application I catch this exception:
    GRAVE: Allocate exception for servlet springmvc
    java.lang.NoClassDefFoundError: Could not initialize class org.springmodules.xt.ajax.AjaxInterceptor

    Why? I put the correct jar in the WEB-INF/lib.

    Anyone can help me?

  • #2
    I suggest you don't use that stuff anymore, I suggest Spring-JS which makes it a lot easier.