I have two objects that have two fields in common, code field and position field. I use two distinct lists, one of Object1 and another of Object2. Object2 was filtered before and had missing elements compared to Object1. I need to stream() on Object1 to compare code value and position value of objects that ar…
Tag: java
Method call error manufacturingcontroller
I don’t understand what the mistake is. Task: You are given two methods, requestProduct and getNumberOfProducts: getNumberOfProducts should return the total number of requested products; requestProduct should keep track of requested products, and format the product argument in the format: No. Requested …
RestTemplate parsing from Response entity to an Object
First I created this method to get me a Pokemon by Id and parse it to a POJO class using RestTemplate. So far everything works fine, but now I have to parse a list of Pokemons and I can’t find a way to do the same thing with a list of objects. I already have the response correct but cant
Why can’t my phone app open a file it stored in a Room Database?
Problem: My Android phone app can open various file types stored in an Android Room pre-populated SQLite database but it cannot open files the app itself has added to the pre-populated database (except it can open .txt files). I believe the issue is probably with how the I coded the copying and conversion of …
Using ant patterns to match on path variable
I have several different controllers, configured with endpoints like below. Where {id} is a numeric @PathVariable. Using HttpSecurity, I want to implement security around all endpoints that have {id} in them. So I created an ant pattern like this: The ant pattern is correctly matching on the endpoints with {i…
jdeps can’t print-module-deps due to a MultiReleaseException
We have a JavaFX based application which is not modularized (there are reasons, a legacy library is involved) but we build an custom runtime using jdeps and jlink. We’ve recently rewritten the app and added a couple of new dependencies, as well as removing others. Now the script that is building the app…
Getting error : org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: javax/validation/ValidatorFactory
I have a project Webservice with Hibernate in Eclipse (Tomcat v10.0 et java JDK 8). When I run, I got this error: ” Servlet.service() for servlet [Jersey Web Application] in context with path [/musichall] threw exception [org.glassfish.jersey.server.ContainerException: java.lang.NoClassDefFoundError: ja…
Flink: java.lang.NoSuchMethodError: AvroSchemaConverter
I am trying to connect to Kafka. When I run a simple JAR file, I get the following error: Yes, I am aware that NoSuchMethod can potentially mean that there is a conflict between versions; however, there is no Flink instance running on YARN cluster. I have also tried to play with pom.xml but no luck The versio…
Spring Data with Redis: How do I use a different LocalDateTime format or a different convertor?
I have data in my DB for field date with the following format: 2021-09-21 11:25:36. The Redis field is of type TEXT. When I’m trying to read the data from date field from the DB, I get following exception: How can I assign a different convertor to this field in my entity or annotate that my LocalDateTim…
Extend Micronaut CustomJWTClaimsSetGenerator to provide all attributes
I have the following two classes which provide the JWT authentication mechanisem. CustomDelegatingAuthenticationProvider CustomJWTClaimsSetGenerator The default response to the client looks like this: My question. How can I extend the class to return all user attributes? Besides username I want to have the us…