Code trials: Error: Error snapshot: Answer This error message… …implies that the file com/google/common/collect/ImmutableMap might be corrupted or there is some incompatibility between the version of the binaries you are using. Further you need to take care of a couple of things as follows: Instea…
Tag: java
Create custom finder with spring
I trying to implement a database with a many-to-many relationship.The database has been built, now we need queries to it. I’m using this article as an example: https://www.bezkoder.com/jpa-many-to-many/. When I create custom finder in Repository – server crushes at running. I have two Entity: Mass…
How to pass custom objects from an activity to a fragment?
I’ve been searching all day and couldn’t find a real answer. I created a fragment using the correct way, that is with a no-args constructor and using Fragment setArguments(Bundle) to pass data to it. I need to pass a Drawable and another custom object to the fragment. Everything I read talks about…
Spring Boot 2.6.4 -> 2.6.6 : strange NullPointerException within Logback when logging a mock Exception
while upgrading from Spring Boot 2.6.4 to 2.6.6 , one of my tests (written in Kotlin), fails : the build passes with Spring Boot 2.6.4. It works in Spring Boot 2.6.6 when I run the test individually in my IDE, but fails during the maven build. the stacktrace was not showing by default, but after surrounding t…
Working with multiple parameters in CriteriaBuilder
I have a need to use JpaSpecificationExecutor. Initially, I assumed that one parameter would be given as input and I would process it like this: CarRepository : However, I need to be able to work with: And in response to me came all the options for suitable machines. For example input: At the output, I want t…
My RecyclerView duplicates my items views
So I’m testing the Recycler View and facing some troubles when adding new item. I have a RecyclerView where I try to display a user’s contacts, but when I create a new elemen, all the contacts duplicate. I know that I should clean my view before adding new data, but I’m not sure how to do th…
post method not supported in patch method
I want edit entity with validating by hibernate-validator, but when calling the patch method, an error is thrown: post method not supported. How to make @PatchMapping work correctly? I am a beginner developer, help me please. Controller: Service: Repository: html form: Answer you can not use ‘PATCH̵…
How can I check if the user input is a string
I’m trying to check if the user inputs a string. If the user inputs a string, my program should output an error message. If the user enters an integer my program should proceed with the program Here’s my code so far, I need to add another condition to check if the user inputs string, I tried some …
Sorting an arraylist with lambda function isn’t working
I’m trying to use .sort() method with an arraylist. My method public void sortSurname() should sort alphabetically all the objects by their surname, these objects are contained in an arraylist ArrayList<Contact> contacts. Could someone please find the issue with this code? Here is what I’ve …
An APRI REST http request goes in 404
I am new with SpringBoot, and API REST, i used to develop in a Struts MVC SOAP project. When i try to run an API REST on a browser or with curl it goes in 404. here is my projec, the ide that I am using is IntelliJ IDEA 2021.3.3 (Community Edition): info about the ide pom.xml Controller The Object