I have simple project Java Spring Starter Project, It is good to go all when export war and deploy on the Apache Tomcat Server with simple index file
But right after i do a few pom added dependencty spring security and mapping the SecurityFilterChain
@Bean SecurityFilterChain securityFilterChain(HttpSecurity httpSecurity) throws Exception { httpSecurity.csrf(AbstractHttpConfigurer::disable) .cors(Customizer.withDefaults()) .authorizeHttpRequests(request -> request.requestMatchers("/**").permitAll() .anyRequest().authenticated()) .sessionManagement(manager -> manager.sessionCreationPolicy(SessionCreationPolicy.STATELESS)) .authenticationProvider(authenticationProvider()).addFilterBefore( jwtAuthFIlter, UsernamePasswordAuthenticationFilter.class ); return httpSecurity.build(); }
The war file after deploy always show
HTTP Status 404 – Not Found
and
Type Status Report
Message The requested resource [/projecsample/] is not available
Description The origin server did not find a current representation for the target resource or is not willing to disclose that one exists.
I’ve tried all the relevant error via StackOverFlow but none solved
Truong Vu is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.