Hello Thank you for your suggestion .
In fact, the type was Integer but I change it to int
because I have almost the same error. That's it :
Code:
org.springframework.beans.BeanInstantiationException: Could not instantiate bean class [java.lang.Integer]: No default constructor found; nested exception is java.lang.NoSuchMethodException: java.lang.Integer.<init>()
org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:81)
org.springframework.web.servlet.mvc.multiaction.MultiActionController.newCommandObject(MultiActionController.java:521)
org.springframework.web.servlet.mvc.multiaction.MultiActionController.invokeNamedMethod(MultiActionController.java:468)
org.springframework.web.servlet.mvc.multiaction.MultiActionController.handleRequestInternal(MultiActionController.java:410)
org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:809)
org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
org.springframework.web.servlet.FrameworkServlet.doGet(FrameworkServlet.java:501)
javax.servlet.http.HttpServlet.service(HttpServlet.java:617)
javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
this my Dao Object
Code:
package com.proxymit.grh.model;
/
/**
* Employes generated by hbm2java
*/
@Entity
@Table(name = "employes", catalog = "proxym")
public class Employes implements java.io.Serializable {
private Integer idemployees;
private String firstame;
private String lastname;
private String mail;
private String function;
private String sheet;
private Integer rib;
private String maritalStatus;
private Integer numberOfChildren;
public Employes() {
super();
}
public Employes(Integer idemployees) {
setIdemployees(getIdemployees());
}
public Employes(String firstame, String lastname, String mail,
String function) {
this.firstame = firstame;
this.lastname = lastname;
this.mail = mail;
this.function = function;
}
public Employes( String firstame, String lastname,
String mail, String function, String sheet, Integer rib,
String maritalStatus, Integer numberOfChildren) {
this.firstame = firstame;
this.lastname = lastname;
this.mail = mail;
this.function = function;
this.sheet = sheet;
this.rib = rib;
this.maritalStatus = maritalStatus;
this.numberOfChildren = numberOfChildren;
}
public Employes(Integer idemployees, String firstame, String lastname,
String mail, String function, String sheet, Integer rib,
String maritalStatus, Integer numberOfChildren) {
setLastname(lastname);
setFirstame(firstame);
setMail(mail);
setFunction(function);
setSheet(sheet);
setNumberOfChildren(numberOfChildren);
setMaritalStatus(maritalStatus);
setRib(rib);
setIdemployees(idemployees);
}
public Employes(Employes employe) {
setLastname(getLastname());
setFirstame( getFirstame());
setMail(getMail());
setFunction(getFunction());
setSheet(getSheet());
setNumberOfChildren( getNumberOfChildren());
setMaritalStatus(getMaritalStatus());
setRib(getRib());
setIdemployees(getIdemployees());
}
@Id
@GeneratedValue(strategy = IDENTITY)
@Column(name = "idemployees", unique = true, nullable = false)
public Integer getIdemployees() {
return this.idemployees;
}
public void setIdemployees(Integer idemployees) {
this.idemployees = idemployees;
}
@Column(name = "firstame", nullable = false, length = 45)
public String getFirstame() {
return this.firstame;
}
public void setFirstame(String firstame) {
this.firstame = firstame;
}
@Column(name = "lastname", nullable = false, length = 45)
public String getLastname() {
return this.lastname;
}
public void setLastname(String lastname) {
this.lastname = lastname;
}
@Column(name = "mail", nullable = false, length = 45)
public String getMail() {
return this.mail;
}
public void setMail(String mail) {
this.mail = mail;
}
@Column(name = "function", nullable = false, length = 45)
public String getFunction() {
return this.function;
}
public void setFunction(String function) {
this.function = function;
}
@Column(name = "sheet")
public String getSheet() {
return this.sheet;
}
public void setSheet(String sheet) {
this.sheet = sheet;
}
@Column(name = "rib")
public Integer getRib() {
return this.rib;
}
public void setRib(Integer rib) {
this.rib = rib;
}
@Column(name = "MaritalStatus", length = 45)
public String getMaritalStatus() {
return this.maritalStatus;
}
public void setMaritalStatus(String maritalStatus) {
this.maritalStatus = maritalStatus;
}
@Column(name = "number_of_children")
public Integer getNumberOfChildren() {
return this.numberOfChildren;
}
public void setNumberOfChildren(Integer numberOfChildren) {
this.numberOfChildren = numberOfChildren;
}
}
and here is my xml configuration
Code:
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:p="http://www.springframework.org/schema/p"
xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
<!--Choisir une stratégie de résolution de vue BeanNameViewResolver -->
<bean id="viewResolver" class="org.springframework.web.servlet.view.InternalResourceViewResolver" p:prefix="/WEB-INF/jsp/" p:suffix=".jsp" />
<!-- Configuration de DataSource -->
<bean id="myDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close">
<property name="driverClassName" value="com.mysql.jdbc.Driver"/>
<property name="url" value="jdbc:mysql://localhost:3306/proxym"/>
<property name="username" value="root"/>
<property name="password" value=""/>
</bean>
<!-- Configuration de Session -->
<bean id="mySessionFactory" class="org.springframework.orm.hibernate3.annotation.AnnotationSessionFactoryBean">
<property name="dataSource" ref="myDataSource" />
<property name="annotatedClasses">
<list>
<value>com.proxymit.grh.model.Vacation</value>
<value>com.proxymit.grh.model.Employes</value>
<value>com.proxymit.grh.model.Vacationtype</value>
<value>com.proxymit.grh.model.Experiences</value>
<value>com.proxymit.grh.model.Adressemployes</value>
<value>com.proxymit.grh.model.Adresstrainee</value>
<value>com.proxymit.grh.model.Cv</value>
<value>com.proxymit.grh.model.Permission</value>
<value>com.proxymit.grh.model.Phoneemployees</value>
<value>com.proxymit.grh.model.Phonetrainee</value>
<value>com.proxymit.grh.model.Rules</value>
<value>com.proxymit.grh.model.Salary</value>
<value>com.proxymit.grh.model.Technologie</value>
<value>com.proxymit.grh.model.Trainee</value>
</list>
</property>
<property name="hibernateProperties">
<props>
<prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop>
<prop key="hibernate.show_sql">true</prop>
</props>
</property>
</bean>
<!-- Configuration de bean de la couche daoImpl -->
<bean id="myvacationDAO" class="com.proxymit.grh.service.interfImpl.VacationDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean name="/vacation/*.htm" class="com.proxymit.grh.web.VacationController" >
<property name="vacationDAO" ref="myvacationDAO" />
</bean>
<bean id="myemployeDAO" class="com.proxymit.grh.service.interfImpl.EmployeDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean name="/employe/add.htm" class="com.proxymit.grh.web.EmployeControllerAdd" >
<property name="employeDAO" ref="myemployeDAO" />
</bean>
<bean name="/employe/list.htm" class="com.proxymit.grh.web.EmployeControllerList" >
<property name="employeDAO" ref="myemployeDAO" />
</bean>
<bean name="/employe/delete.htm" class="com.proxymit.grh.web.EmployeControllerDelete" >
<property name="employeDAO" ref="myemployeDAO" />
</bean>
<bean id="myvacationtypeDAO" class="com.proxymit.grh.service.interfImpl.VacationtypeDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean name="/vacationtype/*.htm" class="com.proxymit.grh.web.VacationtypeController" >
<property name="vacationtypeDAO" ref="myvacationtypeDAO" />
</bean>
<bean id="mysalaryDAO" class="com.proxymit.grh.service.interfImpl.SalaryDAOImpl">
<property name="sessionFactory" ref="mySessionFactory"/>
</bean>
<bean name="/salary/*.htm" class="com.proxymit.grh.web.SalaryController" >
<property name="salaryDAO" ref="mysalaryDAO" />
</bean>
<bean name="/accueil.htm" class="com.proxymit.grh.web.AcceuilController"/>
</beans>
I would appreciate if you could help to carry on my project.
Thank you.