Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/spring/14.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java Spring启动登录方法中的奇怪错误;筛选器执行引发了异常";_Java_Spring_Spring Boot - Fatal编程技术网

Java Spring启动登录方法中的奇怪错误;筛选器执行引发了异常";

Java Spring启动登录方法中的奇怪错误;筛选器执行引发了异常";,java,spring,spring-boot,Java,Spring,Spring Boot,我在尝试登录spring boot服务器时遇到了一个奇怪的异常,我使用的是Jwt身份验证系统,只有当war文件在我的google云服务器上运行时才出现异常,我已经在我的本地服务器上测试了它,它运行得很好。我甚至在windows上下载了tomcat,用war文件测试了它,它运行得很好 我想知道为什么会发生这种奇怪的错误。 谢谢 我的安全配置: 保护空隙c onfigure(AuthenticationManagerBuilder auth) throws Exception { a

我在尝试登录spring boot服务器时遇到了一个奇怪的异常,我使用的是Jwt身份验证系统,只有当war文件在我的google云服务器上运行时才出现异常,我已经在我的本地服务器上测试了它,它运行得很好。我甚至在windows上下载了tomcat,用war文件测试了它,它运行得很好

我想知道为什么会发生这种奇怪的错误。 谢谢

我的安全配置: 保护空隙c

onfigure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService)
        .passwordEncoder(bCryptPasswordEncoder);
    }
    
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.csrf().disable();
        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
        http.formLogin();
        http.authorizeRequests().antMatchers("/login/**", "/index.html", "/register/**", "/resources/**").permitAll();
        http.authorizeRequests().antMatchers("/login/**", "/all/**").permitAll();

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/yata/**").hasAuthority("ADMIN");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/yata/**").hasAuthority("ADMIN");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/coordinate/**").hasAuthority("COORDINATEUR");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/coordinate/**").hasAuthority("COORDINATEUR");

        http.authorizeRequests().antMatchers(HttpMethod.POST, "/count/**").hasAuthority("COMPTABLE");
        http.authorizeRequests().antMatchers(HttpMethod.GET,  "/count/**").hasAuthority("COMPTABLE");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/api/**").hasAuthority("MEDECIN");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/api/**").hasAuthority("MEDECIN");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/user/**").hasAuthority("USER");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/user/**").hasAuthority("USER");

        http.authorizeRequests().anyRequest().authenticated();
        http.addFilter(new JWTAuthentificationFilter(authenticationManager(), repostoryMedecin, medecinBlockRepository, allowedVersionsRepository, sessionRepository, repostoryAppuser));
        http.addFilterBefore(new JWTAuthorisationFilter(repostoryAppuser, sessionRepository), UsernamePasswordAuthenticationFilter.class);
    }

java.lang.NoSuchMethodError:'void io.jsonwebtoken.SignatureAlgorithm.assertValidSigningKey
onfigure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService)
        .passwordEncoder(bCryptPasswordEncoder);
    }
    
    @Override
    protected void configure(HttpSecurity http) throws Exception {
        http.csrf().disable();
        http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS);
        http.formLogin();
        http.authorizeRequests().antMatchers("/login/**", "/index.html", "/register/**", "/resources/**").permitAll();
        http.authorizeRequests().antMatchers("/login/**", "/all/**").permitAll();

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/yata/**").hasAuthority("ADMIN");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/yata/**").hasAuthority("ADMIN");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/coordinate/**").hasAuthority("COORDINATEUR");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/coordinate/**").hasAuthority("COORDINATEUR");

        http.authorizeRequests().antMatchers(HttpMethod.POST, "/count/**").hasAuthority("COMPTABLE");
        http.authorizeRequests().antMatchers(HttpMethod.GET,  "/count/**").hasAuthority("COMPTABLE");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/api/**").hasAuthority("MEDECIN");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/api/**").hasAuthority("MEDECIN");

        http.authorizeRequests().antMatchers(HttpMethod.POST,"/user/**").hasAuthority("USER");
        http.authorizeRequests().antMatchers(HttpMethod.GET,"/user/**").hasAuthority("USER");

        http.authorizeRequests().anyRequest().authenticated();
        http.addFilter(new JWTAuthentificationFilter(authenticationManager(), repostoryMedecin, medecinBlockRepository, allowedVersionsRepository, sessionRepository, repostoryAppuser));
        http.addFilterBefore(new JWTAuthorisationFilter(repostoryAppuser, sessionRepository), UsernamePasswordAuthenticationFilter.class);
    }