I´m trying to create a simple CRUD application with SPRING MVC. The compilation is ok but on execution time I get the error:
org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'org.springframework.web.servlet.mvc.annotation.De faultAnnotationHandlerMapping#0': Initialization of bean failed; nested exception is org.springframework.beans.factory.BeanCreationExce ption: Error creating bean with name 'usuariosController' defined in file [C:\springsource\tc-server-developer-2.1.1.RELEASE\spring-insight-instance\wtpwebapps\GECODIMO\WEB-INF\classes\com\unlam\gecodimo\UsuariosController. class]: Instantiation of bean failed; nested exception is org.springframework.beans.BeanInstantiationExcepti on: Could not instantiate bean class [com.unlam.gecodimo.UsuariosController]: Constructor threw exception; nested exception is java.lang.NoClassDefFoundError: org/springframework/jdbc/core/RowMapper
This is the class:
package servicios;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.List;
import javax.sql.DataSource;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.jdbc.core.RowMapper;
import entidades.UsuarioEntity;
public class UsuariosService
{
private JdbcTemplate jdbcTemplate;
public UsuariosService()
{
}
public void setDataSource(DataSource dataSource)
{
this.jdbcTemplate = new JdbcTemplate(dataSource);
}
public List<UsuarioEntity> RecuperarTodos()
{
String sql = "SELECT * FROM Usuarios";
return jdbcTemplate.query(sql, new UsuarioMapper());
}
private static final class UsuarioMapper implements RowMapper<UsuarioEntity>
{
public UsuarioEntity mapRow(ResultSet rs, int rowNum) throws SQLException
{
UsuarioEntity usuario = new UsuarioEntity();
usuario.setActivo(rs.getBoolean("Activo"));
usuario.setCambiarClave(rs.getBoolean("CambiarClav e"));
usuario.setClave(rs.getString("Clave"));
usuario.setFechaCreacion(rs.getDate("FechaCreacion "));
usuario.setFechaModificacion(rs.getDate("FechaModi ficacion"));
usuario.setId(rs.getInt("IdUsuario"));
usuario.setNombreCompleto(rs.getString("NombreComp leto"));
usuario.setUsuario(rs.getString("Usuario"));
usuario.setUsuarioCreacionId(rs.getInt("IdUsuarioC reacion"));
usuario.setUsuarioModificacionId(rs.getInt("IdUsua rioModificacion"));
return usuario;
}
}
}
ANY IDEAS HOW TO SOLVE THE PROBLEM?


Reply With Quote
