Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found;

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found;

Quentin_Tanioartino
Do you know why I am getting this error?

    SEVERE: Servlet.service() for servlet [spring] in context with path [/spring] threw exception [Request processing failed; nested exception is org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.github.dandelion.datatables.core.ajax.DatatablesCriterias.<init>()] with root cause
    java.lang.NoSuchMethodException: com.github.dandelion.datatables.core.ajax.DatatablesCriterias.<init>()

I changed my controller from this

@RequestMapping(value = "/results", method = RequestMethod.GET)
    public @ResponseBody DatatablesResponse<Results> findAllForDataTables(HttpServletRequest request) {
   
    DatatablesCriterias dataTableCriterias = DatatablesCriterias.getFromRequest(request);
    DataSet<Results> results = this.resultsServiceimpl.findResultsWithDatatablesCriterias(dataTableCriterias);
    return DatatablesResponse.build(results, dataTableCriterias);
    }


to this:

    @RequestMapping(value = "/results", method = RequestMethod.GET)
    public @ResponseBody
    DatatablesResponse<Results> findAllForDataTables(@DatatablesParams DatatablesCriterias criterias) {
   
    DataSet<Results> results = this.resultsServiceimpl.findResultsWithDatatablesCriterias(criterias);
    return DatatablesResponse.build(results, criterias);
    }
and suddenly stop working

any help highly appreciated.

I am using spring 3.2 and dandelion datatables 1.1.0
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found;

Thibault Duchateau
Administrator
Hi,

I've just tried with the datatables-ajax-sample, with the mentioned versions (Spring 3.2.10.RELEASE & Datatables-* 1.1.0) but everything works fine. :-(
Could you please post the result of a mvn dependency:tree?

Thanks!

Regards,
Thibault.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found;

Quentin_Tanioartino
This post was updated on .
Hi,

Thanks for your feedback

Please see the pom below

<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.result.web</groupId>
<artifactId>result</artifactId>
<version>0.0.1</version>
<packaging>war</packaging>
<dependencies>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-core</artifactId><version>4.3.11.Final</version>
</dependency>
<dependency><groupId>org.apache.tiles</groupId><artifactId>tiles-extras</artifactId><version>3.0.5</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-core</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-beans</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-web</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-webmvc</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>javax.servlet</groupId><artifactId>jstl</artifactId><version>1.2</version></dependency>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-entitymanager</artifactId><version>4.3.11.Final</version>
</dependency>
<dependency><groupId>org.hibernate</groupId><artifactId>hibernate-validator</artifactId><version>5.0.0.Final</version>
</dependency>
<dependency><groupId>mysql</groupId><artifactId>mysql-connector-java</artifactId><version>5.1.36</version>
</dependency>
<dependency><groupId>org.springframework</groupId><artifactId>spring-orm</artifactId><version>3.2.10.RELEASE</version>
</dependency>
<dependency><groupId>javax.servlet</groupId><artifactId>javax.servlet-api</artifactId><version>3.1.0</version>
</dependency>
<dependency><groupId>com.github.dandelion</groupId><artifactId>datatables-export-itext</artifactId><version>1.1.0</version>
</dependency>
<dependency><groupId>com.github.dandelion</groupId><artifactId>datatables-jsp</artifactId><version>1.1.0</version>
</dependency>
<dependency><groupId>com.github.dandelion</groupId><artifactId>datatables-spring3</artifactId><version>1.1.0</version>
</dependency>
<dependency><groupId>com.github.dandelion</groupId><artifactId>dandelion-core</artifactId><version>1.1.1</version>
</dependency>
</dependencies><properties><project.build.sourceEncoding>UTF-8</project.build.sourceEncoding></properties></project>

In mvc-core-config

        <mvc:annotation-driven>
                <mvc:argument-resolvers>
                        <bean class="com.github.dandelion.datatables.extras.spring3.ajax.DatatablesCriteriasMethodArgumentResolver" />
                </mvc:argument-resolvers>
        </mvc:annotation-driven>

Java 8
Dynamic Web Module 3.1
Tomcat 8 using jee:jndi

Below the dependency tree


[INFO] +- org.hibernate:hibernate-core:jar:4.3.11.Final:compile
[INFO] |  +- org.jboss.logging:jboss-logging:jar:3.1.3.GA:compile
[INFO] |  +- org.jboss.logging:jboss-logging-annotations:jar:1.2.0.Beta1:compile
[INFO] |  +- org.jboss.spec.javax.transaction:jboss-transaction-api_1.2_spec:jar:1.0.0.Final:compile
[INFO] |  +- dom4j:dom4j:jar:1.6.1:compile
[INFO] |  |  \- xml-apis:xml-apis:jar:1.0.b2:compile
[INFO] |  +- org.hibernate.common:hibernate-commons-annotations:jar:4.0.5.Final:compile
[INFO] |  +- org.hibernate.javax.persistence:hibernate-jpa-2.1-api:jar:1.0.0.Final:compile
[INFO] |  +- org.javassist:javassist:jar:3.18.1-GA:compile
[INFO] |  +- antlr:antlr:jar:2.7.7:compile
[INFO] |  \- org.jboss:jandex:jar:1.1.0.Final:compile
[INFO] +- org.apache.tiles:tiles-extras:jar:3.0.5:compile
[INFO] |  +- org.apache.tiles:tiles-core:jar:3.0.5:compile
[INFO] |  |  +- org.apache.tiles:tiles-api:jar:3.0.5:compile
[INFO] |  |  +- commons-digester:commons-digester:jar:2.0:compile
[INFO] |  |  \- org.slf4j:jcl-over-slf4j:jar:1.7.6:compile
[INFO] |  +- org.apache.tiles:tiles-request-servlet-wildcard:jar:1.0.6:compile
[INFO] |  |  \- org.apache.tiles:tiles-request-servlet:jar:1.0.6:compile
[INFO] |  +- org.apache.tiles:tiles-request-mustache:jar:1.0.6:compile
[INFO] |  |  +- org.apache.tiles:tiles-request-api:jar:1.0.6:compile
[INFO] |  |  \- com.github.spullara.mustache.java:compiler:jar:0.8.4:compile
[INFO] |  +- org.apache.tiles:tiles-jsp:jar:3.0.5:compile
[INFO] |  |  +- org.apache.tiles:tiles-servlet:jar:3.0.5:compile
[INFO] |  |  +- org.apache.tiles:tiles-template:jar:3.0.5:compile
[INFO] |  |  |  \- org.apache.tiles:tiles-autotag-core-runtime:jar:1.1.0:compile
[INFO] |  |  \- org.apache.tiles:tiles-request-jsp:jar:1.0.6:compile
[INFO] |  +- org.apache.tiles:tiles-freemarker:jar:3.0.5:compile
[INFO] |  |  \- org.apache.tiles:tiles-request-freemarker:jar:1.0.6:compile
[INFO] |  |     \- org.freemarker:freemarker:jar:2.3.15:compile
[INFO] |  +- org.apache.tiles:tiles-velocity:jar:3.0.5:compile
[INFO] |  |  +- org.apache.velocity:velocity-tools:jar:2.0:compile
[INFO] |  |  |  +- commons-collections:commons-collections:jar:3.2:compile
[INFO] |  |  |  +- oro:oro:jar:2.0.8:compile
[INFO] |  |  |  \- org.apache.velocity:velocity:jar:1.6.2:compile
[INFO] |  |  |     \- commons-lang:commons-lang:jar:2.4:compile
[INFO] |  |  \- org.apache.tiles:tiles-request-velocity:jar:1.0.6:compile
[INFO] |  +- org.apache.tiles:tiles-el:jar:3.0.5:compile
[INFO] |  +- org.apache.tiles:tiles-mvel:jar:3.0.5:compile
[INFO] |  |  \- org.mvel:mvel2:jar:2.0.11:compile
[INFO] |  +- org.apache.tiles:tiles-ognl:jar:3.0.5:compile
[INFO] |  |  \- ognl:ognl:jar:2.7.3:compile
[INFO] |  |     \- jboss:javassist:jar:3.7.ga:compile
[INFO] |  +- org.apache.tiles:tiles-compat:jar:3.0.5:compile
[INFO] |  +- com.google.guava:guava:jar:12.0.1:compile
[INFO] |  |  \- com.google.code.findbugs:jsr305:jar:1.3.9:compile
[INFO] |  \- org.slf4j:slf4j-api:jar:1.7.6:compile
[INFO] +- org.springframework:spring-core:jar:3.2.10.RELEASE:compile
[INFO] |  \- commons-logging:commons-logging:jar:1.1.3:compile
[INFO] +- org.springframework:spring-beans:jar:3.2.10.RELEASE:compile
[INFO] +- org.springframework:spring-web:jar:3.2.10.RELEASE:compile
[INFO] |  \- org.springframework:spring-aop:jar:3.2.10.RELEASE:compile
[INFO] |     \- aopalliance:aopalliance:jar:1.0:compile
[INFO] +- org.springframework:spring-webmvc:jar:3.2.10.RELEASE:compile
[INFO] |  \- org.springframework:spring-expression:jar:3.2.10.RELEASE:compile
[INFO] +- org.springframework:spring-context:jar:3.2.10.RELEASE:compile
[INFO] +- javax.servlet:jstl:jar:1.2:compile
[INFO] +- org.hibernate:hibernate-entitymanager:jar:4.3.11.Final:compile
[INFO] +- org.hibernate:hibernate-validator:jar:5.0.0.Final:compile
[INFO] |  +- javax.validation:validation-api:jar:1.1.0.Final:compile
[INFO] |  +- com.fasterxml:classmate:jar:0.8.0:compile
[INFO] |  \- org.glassfish.web:javax.el:jar:2.2.4:runtime
[INFO] |     \- javax.el:javax.el-api:jar:2.2.4:runtime
[INFO] +- mysql:mysql-connector-java:jar:5.1.36:compile
[INFO] +- org.springframework:spring-orm:jar:3.2.10.RELEASE:compile
[INFO] |  +- org.springframework:spring-jdbc:jar:3.2.10.RELEASE:compile
[INFO] |  \- org.springframework:spring-tx:jar:3.2.10.RELEASE:compile
[INFO] +- com.github.dandelion:datatables-export-itext:jar:1.1.0:compile
[INFO] |  +- com.github.dandelion:datatables-core:jar:1.1.0:compile
[INFO] |  |  +- com.googlecode.json-simple:json-simple:jar:1.1.1:compile
[INFO] |  |  |  \- junit:junit:jar:4.10:compile
[INFO] |  |  |     \- org.hamcrest:hamcrest-core:jar:1.1:compile
[INFO] |  |  \- commons-beanutils:commons-beanutils:jar:1.8.3:compile
[INFO] |  \- com.itextpdf:itextpdf:jar:5.4.5:compile
[INFO] +- com.github.dandelion:datatables-jsp:jar:1.1.0:compile
[INFO] |  \- com.github.dandelion:dandelion-jsp:jar:1.1.0:compile
[INFO] +- com.github.dandelion:datatables-spring3:jar:1.1.0:compile
[INFO] \- com.github.dandelion:dandelion-core:jar:1.1.1:compile
[INFO]    +- commons-io:commons-io:jar:2.4:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-core:jar:2.3.1:compile
[INFO]    +- com.fasterxml.jackson.core:jackson-annotations:jar:2.3.1:compile
[INFO]    \- com.fasterxml.jackson.core:jackson-databind:jar:2.3.1:compile



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Could not instantiate bean class [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found;

creamteam
In reply to this post by Thibault Duchateau
Thibault Duchateau wrote
Hi,

I've just tried with the datatables-ajax-sample, with the mentioned versions
(Spring 3.2.10.RELEASE & Datatables-* 1.1.0) but everything works fine. :-(
Could you please post the result of a mvn dependency:tree?

Thanks!

Regards,
Thibault.
Quoted from:
http://dandelion-forum.48353.x6.nabble.com/Could-not-instantiate-bean-class-com-github-dandelion-datatables-core-ajax-DatatablesCriterias-No-de-tp2039p2040.html


Hi Thibault!,

I try to do the same I was using "HttpServletRequest request" as parameter for findAllForDataTables but I got the same error:


2016-03-11 15:45:38.400 ERROR 6016 --- [nio-8080-exec-1] d.c.d.controller.GlobalExceptionHandler  : org.springframework.beans.BeanInstantiationException: Failed to instantiate [com.github.dandelion.datatables.core.ajax.DatatablesCriterias]: No default constructor found; nested exception is java.lang.NoSuchMethodException: com.github.dandelion.datatables.core.ajax.DatatablesCriterias.<init>()

In my case I#m using spring 4.2.3 and the same dandelion datatables version (1.1.0)
Loading...