#StackBounty: #java #spring #multithreading #spring-batch #partitioning Is it possible to partition across single file in spring batch?

Bounty: 50

I have read about partitioning in spring-batch I’ve found example which demonstrates partitioning. The example reads persons from CSV files, does some processing and insert data into database. So at this example 1 partitioning = 1 file and so partitioner implementation looks like this:

public class MultiResourcePartitioner implements Partitioner {

    private final Logger logger = LoggerFactory.getLogger(MultiResourcePartitioner.class);
    public static final String FILE_PATH = "filePath";

    private static final String PARTITION_KEY = "partition";

    private final Collection<Resource> resources;


    public MultiResourcePartitioner(Collection<Resource> resources) {
        this.resources = resources;
    }

    @Override
    public Map<String, ExecutionContext> partition(int gridSize) {
        Map<String, ExecutionContext> map = new HashMap<>(gridSize);
        int i = 0;
        for (Resource resource : resources) {
            ExecutionContext context = new ExecutionContext();
            context.putString(FILE_PATH, getPath(resource)); //Depends on what logic you want to use to split
            map.put(PARTITION_KEY + i++, context);
        }
        return map;
    }

    private String getPath(Resource resource) {
        try {
            return resource.getFile().getPath();
        } catch (IOException e) {
            logger.warn("Can't get file from from resource {}", resource);
            throw new RuntimeException(e);
        }
    }
}

But what if I have single 10TB file? Does spring batch allow to partition it in some way?

update:

I tried following approach to achieve what I want:

make 2 steps – first step to divide file into pieces and second step to process pieces we got after the first step:

@Configuration
public class SingleFilePartitionedJob {

    @Autowired
    private JobBuilderFactory jobBuilderFactory;

    @Autowired
    private StepBuilderFactory stepBuilderFactory;

    @Autowired
    private ToLowerCasePersonProcessor toLowerCasePersonProcessor;

    @Autowired
    private DbPersonWriter dbPersonWriter;

    @Autowired
    private ResourcePatternResolver resourcePatternResolver;

    @Value("${app.file-to-split}")
    private Resource resource;


    @Bean
    public Job splitFileProcessingJob() throws IOException {
        return jobBuilderFactory.get("splitFileProcessingJob")
                .incrementer(new RunIdIncrementer())
                .flow(splitFileIntoPiecesStep())
                .next(csvToDbLowercaseMasterStep())
                .end()
                .build();
    }

    private Step splitFileIntoPiecesStep() throws IOException {
        return stepBuilderFactory.get("splitFile")
                .tasklet(new FileSplitterTasklet(resource.getFile()))
                .build();
    }

    @Bean
    public Step csvToDbLowercaseMasterStep() throws IOException {
        MultiResourcePartitioner partitioner = new MultiResourcePartitioner();
        partitioner.setResources(resourcePatternResolver.getResources("split/*.csv"));
        return stepBuilderFactory.get("csvReaderMasterStep")
                .partitioner("csvReaderMasterStep", partitioner)
                .gridSize(10)
                .step(csvToDataBaseSlaveStep())
                .taskExecutor(jobTaskExecutorSplitted())
                .build();
    }

    @Bean
    public Step csvToDataBaseSlaveStep() throws MalformedURLException {
        return stepBuilderFactory.get("csvToDatabaseStep")
                .<Person, Person>chunk(50)
                .reader(csvPersonReaderSplitted(null))
                .processor(toLowerCasePersonProcessor)
                .writer(dbPersonWriter)
                .build();

    }

    @Bean
    @StepScope
    public FlatFileItemReader csvPersonReaderSplitted(@Value("#{stepExecutionContext[fileName]}") String fileName) throws MalformedURLException {
        return new FlatFileItemReaderBuilder()
                .name("csvPersonReaderSplitted")
                .resource(new UrlResource(fileName))
                .delimited()
                .names(new String[]{"firstName", "lastName"})
                .fieldSetMapper(new BeanWrapperFieldSetMapper<Person>() {{
                    setTargetType(Person.class);
                }})
                .build();

    }

    @Bean
    public TaskExecutor jobTaskExecutorSplitted() {
        ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
        taskExecutor.setMaxPoolSize(30);
        taskExecutor.setCorePoolSize(25);
        taskExecutor.setThreadNamePrefix("cust-job-exec2-");
        taskExecutor.afterPropertiesSet();
        return taskExecutor;
    }

}

tasklet:

public class FileSplitterTasklet implements Tasklet {
    private final Logger logger = LoggerFactory.getLogger(FileSplitterTasklet.class);
    private File file;

    public FileSplitterTasklet(File file) {
        this.file = file;
    }

    @Override
    public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception {
        int count = FileSplitter.splitTextFiles(file, 100);
        logger.info("File was split on {} files", count);
        return RepeatStatus.FINISHED;

    }
}

logic for splitting file:

  public static int splitTextFiles(File bigFile, int maxRows) throws IOException {    
        int fileCount = 1;
        try (BufferedReader reader = Files.newBufferedReader(Paths.get(bigFile.getPath()))) {
            String line = null;
            int lineNum = 1;
            Path splitFile = Paths.get(bigFile.getParent() + "/" + fileCount + "split.txt");
            BufferedWriter writer = Files.newBufferedWriter(splitFile, StandardOpenOption.CREATE);

            while ((line = reader.readLine()) != null) {

                if (lineNum > maxRows) {
                    writer.close();
                    lineNum = 1;
                    fileCount++;
                    splitFile = Paths.get("split/" + fileCount + "split.txt");
                    writer = Files.newBufferedWriter(splitFile, StandardOpenOption.CREATE);
                }

                writer.append(line);
                writer.newLine();
                lineNum++;
            }
            writer.close();
        }

        return fileCount;
    }

So I put all file pieces to the special directory.

But this doesn’t work because on the moment of context initialization folder /split is not exist yet.

update

I’ve generated workaround which works:

public class MultiResourcePartitionerWrapper implements Partitioner {
    private final MultiResourcePartitioner multiResourcePartitioner = new MultiResourcePartitioner();
    private final ResourcePatternResolver resourcePatternResolver;
    private final String pathPattern;

    public MultiResourcePartitionerWrapper(ResourcePatternResolver resourcePatternResolver, String pathPattern) {
        this.resourcePatternResolver = resourcePatternResolver;
        this.pathPattern = pathPattern;
    }

    @Override
    public Map<String, ExecutionContext> partition(int gridSize) {
        try {
            Resource[] resources = resourcePatternResolver.getResources(pathPattern);
            multiResourcePartitioner.setResources(resources);
            return multiResourcePartitioner.partition(gridSize);

        } catch (IOException e) {
            throw new RuntimeException(e);
        }
    }
}

But it looks ugly. Is it correct solution?


Get this bounty!!!

#StackBounty: #spring #hibernate #bean-validation #hibernate-validator ConstraintValidator dependency injection leads to ValidationExce…

Bounty: 100

I’ve encountered an unexpected behaviour when using dependency injection in a ConstraintValidator which is getting evaluated at class level.

Entity class:

@Entity
@ValidDemoEntity
public class DemoEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

}

Validation annotation:

@Target({ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = {DemoEntityValidator.class})
public @interface ValidDemoEntity {

    String message() default "{some.demo.validator.message}";
    Class<?>[] groups() default {};
    Class<? extends Payload>[] payload() default {};

}

Validator:

public class DemoEntityValidator implements ConstraintValidator<ValidDemoEntity, DemoEntity> {

    private DemoEntityRepository demoEntityRepository;

    public DemoEntityValidator(DemoEntityRepository demoEntityRepository) {
        this.demoEntityRepository = demoEntityRepository;
    }

    @Override
    public void initialize(ValidDemoEntity constraintAnnotation) {

    }

    @Override
    public boolean isValid(DemoEntity demoEntity, ConstraintValidatorContext constraintValidatorContext) {
        return true;
    }
}

Test class:

@SpringBootTest
public class ValidatorInstantiationTest {

    private Validator validator;

    @Before
    public void setUp() throws Exception {
        ValidatorFactory validatorFactory = Validation.buildDefaultValidatorFactory();
        validator = validatorFactory.getValidator();
    }

    @Test
    public void shouldInitiateAndCallDemoEntityValidator() {
        DemoEntity demoEntity = new DemoEntity();
        validator.validate(demoEntity);
    }

}

Validating the entity leads to:

javax.validation.ValidationException: HV000064: Unable to instantiate ConstraintValidator: com.example.demo.DemoEntityValidator.

and further down the stack trace:

Caused by: java.lang.NoSuchMethodException: com.example.demo.DemoEntityValidator.<init>()

which indicates that Hibernate tried to initiate the the class instead of letting Spring take care of that.

The strange thing about this is that dependency injection works fine for validations applied on field level.

The code is available at GitHub.


Get this bounty!!!

#StackBounty: #java #object-oriented #spring #rock-paper-scissors Spring service for playing Rock Paper Scissors

Bounty: 50

I had created a service which does the actual play of Rock Paper Scissors.

Below is the service which takes a PlayRequest and updates the State of Player objects given by the PlayerService.

So the consumer of the API knows about winner, loser or tie by doing a GET on a Player.

One of the things I feel wrong NOW is that the method play takes a PlayerRequest but uses it only for two lines, all other work is done from the injected dependencies.

Would appreciate any comments related to State as well as SOLID principles.

@Service
public class GameplayService {

  private PlayerService playerService;

  private GameSessionService gameSessionService;

  public GameplayService(GameSessionService gameSessionService, PlayerService playerService) {
    this.gameSessionService = gameSessionService;
    this.playerService = playerService;
  }

  public void play(PlayRequest playRequest) throws RPSException {
    GameSession currentSession = gameSessionService.sessions().get(playRequest.getInviteCode());
    Player player = playerService.changePlayerState(playRequest.getPlayerName(), State.PLAYING);
    currentSession.changeStateTo(GameSession.State.PLAYING);
    try {
      Turn turn = new Turn(player, Enum.valueOf(Move.class, playRequest.getMove()));
      if (currentSession.rounds().isEmpty()) {
        createNewRound(turn, currentSession);
      } else if (!currentSession.rounds().isEmpty()) {
        Round latestRound = currentSession.latestRound();
        if (OVER.equals(latestRound.getState())) {
          createNewRound(turn, currentSession);
        } else if (PLAYING.equals(latestRound.getState())) {
          latestRound.pushLatestTurn(turn);
        }
      }
      Round latestRoundAfterAllUpdates = currentSession.latestRound();
      Optional<Result> resultOptional = latestRoundAfterAllUpdates.getResult();
      if (resultOptional.isPresent()) {
        currentSession.changeStateTo(GameSession.State.WAITING);
        Result result = resultOptional.get();
        if (result.isTie()) {
          currentSession.setTie(true);
        } else {
          currentSession.setWinner(result.getWinner());
        }
        currentSession.getFirstPlayer().changeStateTo(State.WAITING);
        currentSession.getSecondPlayer().changeStateTo(State.WAITING);
      }
    } catch (InvalidOperationException e) {
      throw new RPSException(e.getMessage());
    }
  }

  private void createNewRound(Turn turn, GameSession gameSession) {
    gameSession.addRound(new Round(turn));
  }

}


Get this bounty!!!

#StackBounty: #spring #spring-boot #docker #oauth-2.0 #keycloak Keycloak and Spring Boot web app in dockerized environment

Bounty: 100

Consider the following environment:

  • one docker container is keycloak
  • another docker container is our web app that uses keycloak for authentication

The web app is a Spring Boot application with “keycloak-spring-boot-starter” applied. In application.properties:

keycloak.auth-server-url = http://localhost:8028/auth

A user accessing our web app will be redirected to keycloak using the URL for the exposed port of the keycloak docker container. Login is done without problems in keycloak and the user (browser) is redirected to our web app again. Now, the authorization code needs to be exchanged for an access token. Hence, our web app (keycloak client) tries to connect to the same host and port configured in keycloak.auth-server-url. But this is a problem because the web app resides in a docker container and not on the host machine, so it should rather access http://keycloak:8080 or something where keycloak is the linked keycloak docker container.

So the question is: How can I configure the keycloak client to apply different URLs for browser redirection and access token endpoints?


Get this bounty!!!

#StackBounty: #java #spring #spring-boot #redis #spring-data-redis Redis: Set different time to live for methods annotated with @Cachea…

Bounty: 200

I have a set of cached methods that look somewhat like this:

@Cacheable(value = "myCacheName", keyGenerator = "myKeyGenerator")
public Product getProduct(ProductRequest request) {
    // ...
}

And I need to set different time to live (expiration interval) for objects returned by these methods.

Problem: According to the documentation, the offered way is using @RedisHash(timeToLive=…​) or @TimeToLive annotations on the return type of the methods. However, I don’t want to pollute my domain classes with caching related logic. In addition, some of my methods return strings or objects of classes which I can not modify. I would prefer to implement it in a more configurable way. There is also a configuration property called spring.cache.redis.time-to-live, but it applies the same time-to-live in all places.

Question: Is there a way to specify time to live/expiration interval on the method level? Or generally, how to implement it in a more elegant way?


Get this bounty!!!

#StackBounty: #java #spring #mongodb #spring-boot #tomcat8.5 Spring boot + tomcat 8.5 + mongoDB, AsyncRequestTimeoutException

Bounty: 50

I have created a spring boot web application and deployed war of the same to tomcat container.
The application connects to mongoDB using Async connections. I am using mongodb-driver-async library for that.

At startup everything works fine. But as soon as load increases, It shows following exception in DB connections:

org.springframework.web.context.request.async.AsyncRequestTimeoutException: null
        at org.springframework.web.context.request.async.TimeoutDeferredResultProcessingInterceptor.handleTimeout(TimeoutDeferredResultProcessingInterceptor.java:42)
        at org.springframework.web.context.request.async.DeferredResultInterceptorChain.triggerAfterTimeout(DeferredResultInterceptorChain.java:75)
        at org.springframework.web.context.request.async.WebAsyncManager$5.run(WebAsyncManager.java:392)
        at org.springframework.web.context.request.async.StandardServletAsyncWebRequest.onTimeout(StandardServletAsyncWebRequest.java:143)
        at org.apache.catalina.core.AsyncListenerWrapper.fireOnTimeout(AsyncListenerWrapper.java:44)
        at org.apache.catalina.core.AsyncContextImpl.timeout(AsyncContextImpl.java:131)
        at org.apache.catalina.connector.CoyoteAdapter.asyncDispatch(CoyoteAdapter.java:157)

I am using following versions of software:

  1. Spring boot -> 1.5.4.RELEASE
  2. Tomcat (installed as standalone binary) -> apache-tomcat-8.5.37
  3. Mongo DB version: v3.4.10
  4. mongodb-driver-async: 3.4.2

As soon as I restart the tomcat service, everything starts working fine.

Please help, what could be the root cause of this issue.

P.S.: I am using DeferredResult and CompletableFuture to create Async REST API.

I have also tried using spring.mvc.async.request-timeout in application and configured asynTimeout in tomcat. But still getting same error.


Get this bounty!!!

#StackBounty: #java #spring #sorting #configuration Sort spring @Beans by method level @Order annotation

Bounty: 50

My library has to deal with multiple beans (interceptors) that are specified in arbitrary order (because they are spread over multiple configuration files).
Before I can apply them I have to sort them by their priority. I use AnnotationAwareOrderComparator.sort(beans) for that. This works well as long as the @Order annotation is added on the class level of that interceptor.
But it does not work when I try to use it in @Configuration classes on @Bean methods:

@Configuration
public class Config {

    @Bean
    @Order(1)
    public ServerInterceptor exceptionTranslatingServerInterceptor() {
        return ...;
    }

    @Bean
    @Order(2)
    public ServerInterceptor authenticatingServerInterceptor() {
        return ...;
    }

    @Bean
    @Order(3)
    public ServerInterceptor authorizationCheckingServerInterceptor() {
        return ...
    }

}

But if I add a test like this:

@Test
void testOrderingOfTheDefaultInterceptors() {
    List<ServerInterceptor> expected = new ArrayList<>();
    expected.add(applicationContext.getBean(ExceptionTranslatingServerInterceptor.class));
    expected.add(applicationContext.getBean(AuthenticatingServerInterceptor.class));
    expected.add(applicationContext.getBean(AuthorizationCheckingServerInterceptor.class));

    List<ServerInterceptor> actual = new ArrayList<>(this.registry.getServerInterceptors());
    assertEquals(expected, actual); // Accidentally passes
    // System.out.println(actual);

    Collections.shuffle(actual);
    AnnotationAwareOrderComparator.sort(actual);
    assertEquals(expected, actual); // Fails
    // System.out.println(actual);
}

Then the test will fail.
From my debugging I know that AnnotationAwareOrderComparator.findOrder(Object) always returns null (unspecified) for the order of those beans. Probably because the bean instances aren’t proxied and thus neither implement order nor have the order annotation on their class level. Is there a BeanPostProcessor or an config option that I have to enable?

Controll-Flow

How do I tell spring to either preserve the annotated order or use the application context’s bean definitions to sort the beans appropriately?


Get this bounty!!!

#StackBounty: #java #spring #spring-boot #spring-security Initialize repositories protected by Spring authentication

Bounty: 50

I use Spring Boot Data REST to map Hibernate repositories of entities to REST routes. I also use Spring Security’s @PreAuthorize annotation to secure certain methods of those repositories. This works fine during production, but when I want to programmatically initialize the repositories with data (e.g. adding a first user to get started and some other sample data), it complains that “An Authentication object was not found in the SecurityContext”. I realize that this is because there is no authenticated user in the security context at the time I configure the database (with an autowired component saving objects to repositories). However, I’d like to temporarily circumvent this authorization during configuration, so that I can initialize the database.

Is there any way to achieve this? And if not, how can I manually log in in the initialization method? I’ve seen some attempts to the second approach, but they all require access to an AuthenticationManager, which I don’t know how to obtain.


Get this bounty!!!

#StackBounty: #spring #cas Configuring CAS for Database Audits

Bounty: 450

I’m trying to save the cas audits to a postgres database. For whatever reason, CAS is trying to use the hsqldb driver, even though I’ve specified the postgres driver.

I’m using a CAS 6.0.3 docker image built with the cas-overlay-template project.

Here is my configuration:

cas.audit.jdbc.driverClass=org.postgresql.Driver
cas.audit.jdbc.url=jdbc:postgresql://postgres:5432/cas_audits
cas.audit.jdbc.dialect=org.hibernate.dialect.PostgresPlusDialect
cas.audit.jdbc.user=someuser
cas.audit.jdbc.password=somepassword

I’ve included the cas server support for jdbc audits in the grade build file.

compile "org.apereo.cas:cas-server-support-audit-jdbc:${casServerVersion}"

Here is the stacktrace:

aod_cas.1.kblf4acydbtx@ptzolov-leader    | 2019-05-02 20:54:40,568 WARN [com.zaxxer.hikari.util.DriverDataSource] - <Registered driver with driverClassName=org.hsqldb.jdbcDriver was not found, trying direct instantiation.>
aod_cas.1.kblf4acydbtx@ptzolov-leader    | 2019-05-02 20:54:41,127 ERROR [org.apache.catalina.core.ContainerBase.[Tomcat].[localhost].[/cas].[dispatcherServlet]] - <Servlet.service() for servlet [dispatcherServlet] in context with path [/cas] threw exception [Request processing failed; nested exception is org.springframework.jdbc.BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar [SELECT AUD_DATE FROM COM_AUDIT_TRAIL WHERE AUD_CLIENT_IP = ? AND AUD_USER = ? AND AUD_ACTION = ? AND APPLIC_CD = ? AND AUD_DATE >= ? ORDER BY AUD_DATE DESC]; nested exception is java.sql.SQLSyntaxErrorException: user lacks privilege or object not found: COM_AUDIT_TRAIL in statement [SELECT AUD_DATE FROM COM_AUDIT_TRAIL WHERE AUD_CLIENT_IP = ? AND AUD_USER = ? AND AUD_ACTION = ? AND APPLIC_CD = ? AND AUD_DATE >= ? ORDER BY AUD_DATE DESC]] with root cause>
aod_cas.1.kblf4acydbtx@ptzolov-leader    | org.hsqldb.HsqlException: user lacks privilege or object not found: COM_AUDIT_TRAIL
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.error.Error.error(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.readTableName(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.readTableOrSubquery(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadTableReference(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadFromClause(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadTableExpression(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadQuerySpecification(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadSimpleTable(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadQueryPrimary(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadQueryTerm(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadQueryExpressionBody(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.XreadQueryExpression(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserDQL.compileCursorSpecification(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserCommand.compilePart(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.ParserCommand.compileStatement(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.Session.compileStatement(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.StatementManager.compile(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.Session.execute(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.jdbc.JDBCPreparedStatement.<init>(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.hsqldb.jdbc.JDBCConnection.prepareStatement(Unknown Source) ~[hsqldb-2.4.1.jar!/:2.4.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at com.zaxxer.hikari.pool.ProxyConnection.prepareStatement(ProxyConnection.java:311) ~[HikariCP-3.2.0.jar!/:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at com.zaxxer.hikari.pool.HikariProxyConnection.prepareStatement(HikariProxyConnection.java) ~[HikariCP-3.2.0.jar!/:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate$SimplePreparedStatementCreator.createPreparedStatement(JdbcTemplate.java:1557) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate.execute(JdbcTemplate.java:615) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:669) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:700) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:706) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.jdbc.core.JdbcTemplate.query(JdbcTemplate.java:758) ~[spring-jdbc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.web.support.JdbcThrottledSubmissionHandlerInterceptorAdapter.exceedsThreshold(JdbcThrottledSubmissionHandlerInterceptorAdapter.java:55) ~[cas-server-support-throttle-jdbc-6.0.3.jar!/:6.0.3]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.web.support.AbstractThrottledSubmissionHandlerInterceptorAdapter.preHandle(AbstractThrottledSubmissionHandlerInterceptorAdapter.java:83) ~[cas-server-support-throttle-core-6.0.3.jar!/:6.0.3]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at java.lang.reflect.Method.invoke(Method.java:566) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:246) ~[spring-core-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.cloud.context.scope.GenericScope$LockedScopedProxyFactoryBean.invoke(GenericScope.java:494) ~[spring-cloud-context-2.1.0.RELEASE.jar!/:2.1.0.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212) ~[spring-aop-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at com.sun.proxy.$Proxy208.preHandle(Unknown Source) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.HandlerExecutionChain.applyPreHandle(HandlerExecutionChain.java:136) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:1033) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:942) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:1005) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:908) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at javax.servlet.http.HttpServlet.service(HttpServlet.java:665) ~[javax.servlet-api-4.0.1.jar!/:4.0.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:882) ~[spring-webmvc-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at javax.servlet.http.HttpServlet.service(HttpServlet.java:750) ~[javax.servlet-api-4.0.1.jar!/:4.0.1]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:231) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.web.support.AuthenticationCredentialsThreadLocalBinderClearingFilter.doFilter(AuthenticationCredentialsThreadLocalBinderClearingFilter.java:28) ~[cas-server-core-web-api-6.0.3.jar!/:6.0.3]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.security.RequestParameterPolicyEnforcementFilter.doFilter(RequestParameterPolicyEnforcementFilter.java:261) ~[cas-server-security-filter-2.0.10.4.jar!/:2.0.10.4]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.security.ResponseHeadersEnforcementFilter.doFilter(ResponseHeadersEnforcementFilter.java:240) ~[cas-server-security-filter-2.0.10.4.jar!/:2.0.10.4]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.security.AddResponseHeadersFilter.doFilter(AddResponseHeadersFilter.java:94) ~[cas-server-security-filter-2.0.10.4.jar!/:2.0.10.4]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.boot.actuate.web.trace.servlet.HttpTraceFilter.doFilterInternal(HttpTraceFilter.java:90) ~[spring-boot-actuator-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:320) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.invoke(FilterSecurityInterceptor.java:127) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.access.intercept.FilterSecurityInterceptor.doFilter(FilterSecurityInterceptor.java:91) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.access.ExceptionTranslationFilter.doFilter(ExceptionTranslationFilter.java:119) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.session.SessionManagementFilter.doFilter(SessionManagementFilter.java:137) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.authentication.AnonymousAuthenticationFilter.doFilter(AnonymousAuthenticationFilter.java:111) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter.doFilter(SecurityContextHolderAwareRequestFilter.java:170) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.savedrequest.RequestCacheAwareFilter.doFilter(RequestCacheAwareFilter.java:63) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.context.SecurityContextPersistenceFilter.doFilter(SecurityContextPersistenceFilter.java:105) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter.doFilterInternal(WebAsyncManagerIntegrationFilter.java:56) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.access.channel.ChannelProcessingFilter.doFilter(ChannelProcessingFilter.java:157) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy$VirtualFilterChain.doFilter(FilterChainProxy.java:334) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy.doFilterInternal(FilterChainProxy.java:215) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.security.web.FilterChainProxy.doFilter(FilterChainProxy.java:178) ~[spring-security-web-5.1.2.RELEASE.jar!/:5.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.DelegatingFilterProxy.invokeDelegate(DelegatingFilterProxy.java:357) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.DelegatingFilterProxy.doFilter(DelegatingFilterProxy.java:270) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.RequestContextFilter.doFilterInternal(RequestContextFilter.java:99) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.FormContentFilter.doFilterInternal(FormContentFilter.java:92) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.HiddenHttpMethodFilter.doFilterInternal(HiddenHttpMethodFilter.java:93) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.filterAndRecordMetrics(WebMvcMetricsFilter.java:117) ~[spring-boot-actuator-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.boot.actuate.metrics.web.servlet.WebMvcMetricsFilter.doFilterInternal(WebMvcMetricsFilter.java:106) ~[spring-boot-actuator-2.1.2.RELEASE.jar!/:2.1.2.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.cas.logging.web.ThreadContextMDCServletFilter.doFilter(ThreadContextMDCServletFilter.java:98) ~[cas-server-core-logging-6.0.3.jar!/:6.0.3]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.CharacterEncodingFilter.doFilterInternal(CharacterEncodingFilter.java:200) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.springframework.web.filter.OncePerRequestFilter.doFilter(OncePerRequestFilter.java:107) ~[spring-web-5.1.3.RELEASE.jar!/:5.1.3.RELEASE]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apereo.inspektr.common.web.ClientInfoThreadLocalFilter.doFilter(ClientInfoThreadLocalFilter.java:66) ~[inspektr-common-1.8.4.GA.jar!/:1.8.4.GA]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:193) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:166) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:200) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:96) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:490) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:139) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:92) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:74) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.valves.AbstractAccessLogValve.invoke(AbstractAccessLogValve.java:678) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.valves.RemoteIpValve.invoke(RemoteIpValve.java:679) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:343) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.coyote.http11.Http11Processor.service(Http11Processor.java:408) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.coyote.AbstractProcessorLight.process(AbstractProcessorLight.java:66) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.coyote.AbstractProtocol$ConnectionHandler.process(AbstractProtocol.java:834) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1415) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.tomcat.util.net.SocketProcessorBase.run(SocketProcessorBase.java:49) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) ~[?:?]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61) ~[tomcat-embed-core-9.0.17.jar!/:9.0.17]
aod_cas.1.kblf4acydbtx@ptzolov-leader    |  at java.lang.Thread.run(Thread.java:834) [?:?]

The first line : Registered driver with driverClassName=org.hsqldb.jdbcDriver was not found, trying direct instantiation makes me think that my config settings for the driverClass aren’t being registered.

Please let me know if I can add any additional information to help get to the bottom of this.

Thanks!


Get this bounty!!!

#StackBounty: #spring #spring-boot #spring-security #jwt #spring-security-oauth2 OAuth2 + Spring Boot 2 – ResourceServer in ZuulGateway…

Bounty: 50

I am trying OAuth 2 + JWT integration using Spring Boot 2 + Netflix OSS. On requesting access token, I am getting the below error in Zuul Gateway which acts as a Resource Server.

2019-05-04 14:41:29.157 DEBUG 23272 — [nio-8765-exec-2] o.s.s.w.a.ExceptionTranslationFilter : Authentication exception occurred; redirecting to authentication entry point
org.springframework.security.authentication.AuthenticationCredentialsNotFoundException: An Authentication object was not found in the SecurityContext

Can someone help and tell me what am I missing in the code ?

Zuul Gateway + Resource Server

@Configuration
@EnableResourceServer
@Order(value = 0)
@EnableOAuth2Sso
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {

    @Override
    protected void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests()
            .antMatchers("/oauth/token/**").permitAll()
            //.antMatchers("/login/**,/oauth/**").permitAll()
            .antMatchers("/trips/**").hasAnyRole("CLIENT", "USER", "ANONYMOUS")
            .and().csrf().disable()
            .anonymous().disable();

    }
}

application.yml

logging:
  level:
    org.springframework: DEBUG

server:
  port: 8765

spring:
  application:
    name: gateway


# Map path to auth service
zuul:
  routes:
    trips:
      path: /trips/**
      url: http://localhost:1000/api/trips
    rides:
      path: /rides/**
      url: http://localhost:1000/api/rides
    mauth:
      path: /oauth/**
      url: http://localhost:1000/oauth



#OAuth Configurations
security:
  oauth2:
    client:
      #access-token-uri: https://auth/login
      #user-authorization-uri: /auth/oauth/authorize
      accessTokenUri: http://localhost:1000/oauth/authorize
      userAuthorizationUri: http://localhost:1000/oauth/token
      client-id: sapepool
      client-secret: sapepool
    resource:
      jwt:
        key-uri: http://localhost:1000/oauth/token_key
        #key-value:

Authorization Server

@Configuration
@EnableAuthorizationServer
public class AuthorizationServerConfig extends AuthorizationServerConfigurerAdapter {

        @Autowired
        @Qualifier("authenticationManagerBean")
        private AuthenticationManager authenticationManager;

        @Autowired
        @Qualifier("customUserDetailsService")
        private UserDetailsService userDetailsService;

        /**
         * Token store.
         *
         * @return the token store
         */
        /*@Bean
        public DatastoreTokenStore tokenStore() {
            return new DatastoreTokenStore(datastoreDataSource);
        }*/
        @Bean
        public TokenStore tokenStore() {
            return new JwtTokenStore(jwtAccessTokenConverter());
        }

        @Bean
        public JwtAccessTokenConverter jwtAccessTokenConverter() {
            JwtAccessTokenConverter converter = new JwtAccessTokenConverter();
            converter.setKeyPair(new KeyStoreKeyFactory(new ClassPathResource("jwt.jks"), "password".toCharArray()).getKeyPair("jwt"));
            converter.setSigningKey("123");
            converter.setVerifierKey("123");
            return converter;
        }

        /**
         * 
         */
        @Override
        public void configure(AuthorizationServerEndpointsConfigurer endpoints) throws Exception {

            endpoints.authenticationManager(authenticationManager).userDetailsService(userDetailsService)
                    .tokenStore(tokenStore())//.tokenServices(tokenServices())
                    .tokenEnhancer(jwtAccessTokenConverter())
                    .accessTokenConverter(jwtAccessTokenConverter())
                    .allowedTokenEndpointRequestMethods(HttpMethod.GET, HttpMethod.POST);
        }

         /**
         * Authorization server security Configuration.
         *
         * @param oauthServer
         *            the oauth server
         * @throws Exception
         *             the exception
         */
        @Override
        public void configure(AuthorizationServerSecurityConfigurer oauthServer) throws Exception {
            oauthServer.tokenKeyAccess("permitAll()").checkTokenAccess("isAuthenticated()");
        }

        @Override
        public void configure(ClientDetailsServiceConfigurer clients) throws Exception {
            clients.inMemory()
                .withClient("sapepool")
                .secret("{noop}sapepool")
                //.secret("sapepool")
                .authorizedGrantTypes("client_credentials", "password","refresh_token")
                .authorities("ROLE_CLIENT", "ROLE_ANDROID_CLIENT", "ROLE_ANONYMOUS")
                .scopes("read", "write", "trust")
                .accessTokenValiditySeconds(5000)
                .refreshTokenValiditySeconds(50000);
                //.resourceIds("oauth2-resource") - isAutoApprove()
        }
    }

Authorization Server – Web Security Config

@Configuration
@EnableWebSecurity
@EnableGlobalMethodSecurity(prePostEnabled = true, securedEnabled = true)
public class WebSecurityConfig extends WebSecurityConfigurerAdapter {

    private static Logger log = LoggerFactory.getLogger(WebSecurityConfig.class);


    @Autowired
    private UserDetailsService userDetailsService;


    @Override
    @Bean
    public UserDetailsService userDetailsServiceBean() throws Exception {
        return super.userDetailsServiceBean();
    }

    @Override
    @Bean
    public AuthenticationManager authenticationManagerBean() throws Exception {
        return super.authenticationManagerBean();
    }

    @Override
    public void configure(HttpSecurity http) throws Exception {

        http.authorizeRequests()
            .antMatchers("/oauth/token/**").permitAll()
            .anyRequest().permitAll()
            //.antMatchers("*/oauth/**").permitAll()
            //.antMatchers("/**").permitAll()
            .and().csrf().disable();
            //.anonymous().disable();

        /*
         * http.csrf().disable().exceptionHandling() //.authenticationEntryPoint( //
         * (request, response, authException) ->
         * response.sendError(HttpServletResponse.SC_UNAUTHORIZED))
         * .and().authorizeRequests().antMatchers("/**").authenticated().and().httpBasic
         * ();
         */
    }

    @Bean
    public PasswordEncoder passwordEncoder() {
        return PasswordEncoderFactories.createDelegatingPasswordEncoder();
    }

    @Override
    protected void configure(AuthenticationManagerBuilder auth) throws Exception {
        auth.userDetailsService(userDetailsService).passwordEncoder(passwordEncoder());
    }
}


Get this bounty!!!