Un curso mal explicado, mal editado
Bienvenida e Introducción
Qué aprenderás sobre Hibernate y Java Spring
Instalar ambiente de desarrollo en Windows
¿Qué es una Aplicación Empresarial?
¿Cómo funcionan las Aplicaciones Web?
Servidores Web vs Servidores de Aplicación
Instalar ambiente de desarrollo Mac
Patrón de Arquitectura MVC
Características de los Servlet
Utilización del Servlet
Características y práctica de JSP
Comenzar con Spring Boot
Arquitectura de las Aplicaciones Web
Características de Spring Framework
Características de Spring Boot
Crear, cargar y configurar una aplicación en Spring Boot
Crear la estructura del proyecto
Spring Data JPA
Persistencia de objetos
Spring Data, Spring Data JPA
Iniciar la base de datos postgres utilizando Docker
Optimizar Pojos con Lombok
Mapear Tablas de la Base de Datos
Configurar la persistencia con Hibernate
Manejo de Negocio
Añadir JPA Repository
Implementar las operaciones de Consulta con JPA Repository
Implementar servicio de negocio para las operaciones CRUD
Manejar la transaccionalidad de un servicio de negocio
Spring REST
Instalar y configurar Swagger
Características de los Servicios Web y Spring Rest
Implementar las operaciones REST para crear y actualizar información
Implementar las operaciones REST para eliminar y consultar información
Documentación de los servicios REST con Swagger
Spring Security
Manejar la seguridad en una aplicación web
Características, instalación e integración de Spring Security
Personalizar la página de Login
Despliegue Aplicaciones Docker
Realizar la configuración de Docker Plugin
Crear una imagen docker de la aplicación
Subir la aplicación a docker hub
Ejecutar la aplicación dockerizada
Despedida del curso
No tienes acceso a esta clase
¡Continúa aprendiendo! Únete y comienza a potenciar tu carrera
Swagger es una herramienta que nos permite documentar y ejecutar APIs Web de forma interactiva, provee una manera muy sencilla de implementar clientes un múltiples lenguajes. Para configurar esta herramienta junto con Spring, vamos a utilizar el proyecto Spring Fox configurando las dependencias en el archivo pom.xml
.
Aportes 35
Preguntas 6
Un curso mal explicado, mal editado
que mal curso, no esta bien editado, parece como si se hubieran saltado partes.
Recuerden que los @Temporal solo pueden ser utilizados importando desde java.util.Date.
Yo tenia un error y era porque estaba importando desde java.sql.Date
pague mucha plata por estos tutos que mal
Me daba errores de swagger, finalmente pude solucionarlos siguiendo los consejos de este tutorial:
https://www.baeldung.com/swagger-2-documentation-for-spring-rest-api
En donde usan la version 2.9…
@Configuration
@EnableSwagger
Public Class SwaggerConfiguration{
Public Docket documentation{
return new Docket(DocumentationType.SWAGGER_2).select().apis(RequestHandlerSelectors.withClassAnnotation(RestController.class)).paths(PathSelectors.any()).build();
}
}
Me daba un error en RequestHandlerSelectors.
he tenido que añadir la dependencia de Guava al pom.xml. ( y clean-update proyect) para solucionarlo.
por si alguien tiene el mismo problema.
<dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>r05</version> </dependency>
Buena explicación!!!
Este vídeo quedó mal editado y se escucha al docente hablar sobre su error.
excelente clase!!!
No vi ningún video sobre la creación de clases con la anotación de @RestController y no sé de dónde salieron las clases del paquete VO, estoy perdido. Ya revisé todos los videos de nuevo y nada 😦
A mi me ah funcionado de esta manera =
<dependency>
<groupId>io.springfox.ui</groupId>
<artifactId>springfox-swagger-ui</artifactId>
<version>2.8.0</version>
</dependency>
Muy bien
Si el atributo en la clase cliente lo declaran “private String idCliente;”, el metodo findBy… , por id se debería llamar. findByIdCliente, y no findByIdentification. Tenia ese error y por eso no me dejaba ejecutar.
Me genera este error, alguien me puede ayudar?
Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:2.22.1:test (default-test) on project e-reservation: There are test failures.
y el link del repository de git?
Tests run: 1, Failures: 0, Errors: 1, Skipped: 0, Time elapsed: 5.092 s <<< FAILURE! - in com.platzi.ereservation.EReservationApplicationTests
contextLoads(com.platzi.ereservation.EReservationApplicationTests) Time elapsed: 0.002 s <<< ERROR!
java.lang.IllegalStateException: Failed to load ApplicationContext
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘documentationPluginsBootstrapper’ defined in URL [jar:file:/C:/Users/jgris/.m2/repository/io/springfox/springfox-spring-web/2.7.0/springfox-spring-web-2.7.0.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]: Unsatisfied dependency expressed through constructor parameter 1; nested exception is org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘webMvcRequestHandlerProvider’ defined in URL [jar:file:/C:/Users/jgris/.m2/repository/io/springfox/springfox-spring-web/2.7.0/springfox-spring-web-2.7.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerMapping’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method ‘requestMappingHandlerMapping’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mvcConversionService’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘webMvcRequestHandlerProvider’ defined in URL [jar:file:/C:/Users/jgris/.m2/repository/io/springfox/springfox-spring-web/2.7.0/springfox-spring-web-2.7.0.jar!/springfox/documentation/spring/web/plugins/WebMvcRequestHandlerProvider.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerMapping’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method ‘requestMappingHandlerMapping’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mvcConversionService’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘requestMappingHandlerMapping’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method ‘requestMappingHandlerMapping’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mvcConversionService’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandlerMapping]: Factory method ‘requestMappingHandlerMapping’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mvcConversionService’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘mvcConversionService’ defined in class path resource [org/springframework/boot/autoconfigure/web/servlet/WebMvcAutoConfiguration$EnableWebMvcConfiguration.class]: Bean instantiation via factory method failed; nested exception is org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.BeanInstantiationException: Failed to instantiate [org.springframework.format.support.FormattingConversionService]: Factory method ‘mvcConversionService’ threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘reservaRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: java.lang.IllegalArgumentException: Validation failed for query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ReservaRepository.find(java.util.Date,java.util.Date)!
Caused by: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: Reserva is not mapped [SELECT r FROM Reserva r WHERE r.fechaIngresoRes =:fechaInicio and r.fechaSalidaRes =:fechaSalida]
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Reserva is not mapped [SELECT r FROM Reserva r WHERE r.fechaIngresoRes =:fechaInicio and r.fechaSalidaRes =:fechaSalida]
Caused by: org.hibernate.hql.internal.ast.QuerySyntaxException: Reserva is not mapped
Ya en un par de videos anteriores tuve algunos errores que solucioné, pero con este si no he podido.
Apreciaría algo de ayuda
Un saludo.
Dejo este curso en este punto hasta no resolver el problema.
¿De dónde salierón las clases de los packages de vista?
Muy buen resumen marcos,ahora solo hay que ponerlo en practica.
Hola me da un error podrían por favor ayudarme a corregirlo
BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 36.882 s
[INFO] Finished at: 2019-03-28T12:05:40-06:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.2.0.M1:run (default-cli) on project e-reservation: An exception occurred while running. null: InvocationTargetException: Failed to start bean ‘documentationPluginsBootstrapper’; nested exception is java.lang.NoSuchMethodError: org.springframework.plugin.core.PluginRegistry.getPluginFor(Ljava/lang/Object;Lorg/springframework/plugin/core/Plugin;)Lorg/springframework/plugin/core/Plugin; -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Presente el error : EReservationApplicationTests.**contextLoads ** el cual fue producto de que en la clase de prueba contenía el método **contextLoads ** para evaluar. Temporalmente lo comente @test para poder continuar con las clases.
<code>public class EReservationApplicationTests {
//@Test
public void contextLoads() {
}
}
</code>
Hola, tengo el siguiente error a partir de esta clase:
Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.2.RELEASE:run (default-cli) on project e-reservation: An exception occurred while running. null: InvocationTargetException: Error creating bean with name ‘documentationPluginsBootstrapper’ defined in URL [jar:file:/C:/Users/emvcxsdza/.m2/repository/io/springfox/springfox-spring-web/2.9.2/springfox-spring-web-2.9.2.jar!/springfox/documentation/spring/web/plugins/DocumentationPluginsBootstrapper.class]
Las dependencias y la clase están iguales que en el ejemplo, ¿alguien sabe de que se podría tratar?
Creo que usare okhttp para REST, esto solo hizo que todo el codigo me reventara a punto de frustrarme demasiado.
Me marcaba error en la configuración indicando un error en el parámetro 6, actualicé la versión de swagger “<version>2.10.5</version>” y cambié la anotación por “@EnableSwagger2WebMvc”…Funcionó…
Creo que aprendí mas en este curso que en los 6 meses de Java SE en la Universidad
No podía Solucionar un Error…!!
Tuve que volver a crear el Proyecto.!
Alguien sabe alguna dependencia en Maven para descargar la clase siguiente:
import org.springframework.web.bind.annotation.RestController;
No la encuentra en el paquete de spring que hicimos, les agradecería mucho.
Me da el siguiente error: Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:2.1.6.RELEASE:run (default-cli) on project e-reservation: An exception occurred while running. null: InvocationTargetException: Error creating bean with name ‘clienteService’ defined in file [C:\Users\Sistemas nirvek\Documents\spring\e-reservation\e-reservation\target\classes\com\platzi\ereservation\negocio\services\ClienteService.class]: Unsatisfied dependency expressed through constructor parameter 0; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name ‘clienteRepository’: Invocation of init method failed; nested exception is java.lang.IllegalArgumentException: Failed to create query for method public abstract java.util.List com.platzi.ereservation.negocio.repository.ClienteRepository.findbyApellidoCli(java.lang.String)! No property findbyApellidoCli found for type Cliente! -> [Help 1]
[ERROR]
En caso que se desee realizar con gradle, ¿como sería la configuración ya que no solo sería implementar las dependencias o sí?
Listo 😃
Este vídeo está mal ubicado.
Debe dar claridad que hay paquetes que se van a trabajar mas adelante y que se debe incluir la dependencia de Spring web para importar la anotación RestController.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Desarrollo/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Desarrollo/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Desarrollo/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Desarrollo/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
Tengo este error alguien podria ayudarme?
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Desarrollo/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Desarrollo/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/C:/Desarrollo/sts-4.7.0.RELEASE/plugins/org.eclipse.m2e.maven.runtime.slf4j.simple_1.16.0.20200610-1735/jars/slf4j-simple-1.7.5.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [file:/C:/Desarrollo/sts-4.7.0.RELEASE/configuration/org.eclipse.osgi/5/0/.cp/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory]
[INFO] Scanning for projects…
[INFO]
[INFO] ----------------------< com.pltzi:e-reservation >-----------------------
[INFO] Building e-reservation 0.0.1-SNAPSHOT
[INFO] --------------------------------[ jar ]---------------------------------
[INFO]
[INFO] — maven-clean-plugin:3.1.0:clean (default-clean) @ e-reservation —
[INFO] Deleting C:\Desarrollo\e-reservation\target
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.510 s
[INFO] Finished at: 2020-07-02T20:38:37-05:00
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-clean-plugin:3.1.0:clean (default-clean) on project e-reservation: Failed to clean project: Failed to delete C:\Desarrollo\e-reservation\target\surefire-reports -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
Seguí los pasos del profesor y no tuve ningún error, funciona correctamente.
¿Quieres ver más aportes, preguntas y respuestas de la comunidad?