Skip to content
Advertisement

Tag: spring-mvc

Spring Boot URL mapping not working when files are present in multiple packages

I tried making a simple REST API using Spring Boot. I have put the classes in separate packages. In this case, the URL mapping is not working (checked using Postman), whereas its working fine if I put them all in the same package as that of the main class. “”” Hierarchy of the packages : com.example.ProductCRUD |—–ProductCrudApplication.java (main) com.example.ProductCRUD.Controller |—–ProductController.java(controller)

Cant run my spring application on ubuntu with jdk11

Pls, help. Can’t run my application on ubuntu 18.04.5 Java version: openjdk 11.0.10 2021-01-19 Apache Maven 3.6.0 Maven home: /usr/share/maven Java version: 11.0.10, vendor: Ubuntu, runtime: /usr/lib/jvm/java-11-openjdk-amd64 Default locale: en_US, platform encoding: UTF-8 OS name: “linux”, version: “5.4.0-66-generic”, arch: “amd64”, family: “unix” There is app output: pom.xml: UserService.java RegistarionCotroller.java WebSecurityConfig.java Answer When initializing the WebSecurityConfig, Spring Container will attempt to

RestClientTest annotation fails to autocnfigure RestTemplate

I have a class with RestTemplate dependency And in the test I wish to use @RestClientTest for auto configuring the RestTemplate But the test fails with unable to find autowiring candidate for RestTemplate error. Answer In the documentation of @RestClientTest you can read: If you are testing a bean that doesn’t use RestTemplateBuilder but instead injects a RestTemplate directly, you

Unable to Run my Spring Security MVC WebApp SpringChainFilter throwing exception, rawPassword cannot be null

So I was trying to make a simple spring security hardcoded security just to check how my app is working before connecting it to the DB but before that it start showing me error 500. Here is my Configuration file Here is my webSecurity Configuration class with In memory authentication with some sample data. Here is my Servlet Initializer Class

Deployed .war generating error: template might not exist or might not be accessible

I have a spring boot application that runs fine on localhost. I access it with http://localhost:8080/home. Now I want to deploy the application to a hosting server. Generated the .war and deployed it there. Configured http://www.customdomain.com/hostingpath/ to be the root path for the app. So that should map to what locally is http://localhost:8080/. Now when I access http://www.customdomain.com/hostingpath/home I’m getting

Advertisement