Category "java"

How to write a KafkaAvro Serde for GenericData.Record

I'm using Kafka 0.10.2 and Avro for the serialization of my messages, both for the key and for the value data. Now I would like to use Kafka Streams but I'm stu

Method to box primitive type

Here is a table of primitive types and their equivalent wrapper class. Primitive type Wrapper class ============== ============= boolean Boolean byt

What is wrong with my native query in jpa?

I'm sending a very simple query to the database, but I'm getting an error. It feels like I'm missing something very simple. I guess it wouldn't allow me to crea

"message":"Head \"https://registry-1.docker.io/v2/testcontainers/ryuk/manifests/0.3.0\": unauthorized: incorrect username or password" when run test

I have added testcontainer in spring boot app import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; @SpringBootTest @Testcont

Spring-mvc + Spring-Security + Thymeleaf - Error Resolving Template

I'm following a simple online tutorial for building a Spring + Spring Security + Thymeleaf + Maven project and I'm getting the following error: [ERROR] [tomcat

swagger-ui No mapping found for HTTP request

I'm trying to document and existing Rest API a Spring MVC project (NOT spring boot!). My application is called api so http://localhost:9090/api would be the r

Compile a JDK 8 project + a JDK 9 "module-info.java" in Gradle

I'm working on a Java library targeting JDK 8, and I'm building it in Gradle 5 using OpenJDK 11. In order to target JDK 8, I'm javac's --release option. Howeve

org.springframework.dao.EmptyResultDataAccessException: Incorrect result size: expected 1, actual 0

i'm this following error when i submit for copying data here is the code.. public String deleteExistingRecordWeekWise(String monthOrWeek) throws ApplicationExc

Merge query in H2 database giving "Unknown data type:" error

when merge native query is used using JPA, it is resulting into following error: {"ts":"2022-05-05T17:03:12.124+0000","level":"ERROR","message":"SQL Error: 500

Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment] for XAMPP and Eclipse IDE

I am using XAMPP server and Eclipse IDE for running a hibernate program. But I am getting the following error: **Apr 21, 2017 12:46:38 PM org.hibernate.Vers

LocalDate: equals vs isEqual

LocalDate in Java has two similar methods equals and isEqual. What's the difference between them? When do they output different results?

Checking .wav files for similarity

I'm trying to compare .wav files for similarity. I used the google musicg library for that but I get bad scores for similar sounds. I compare two car motor soun

How to store H2 database file into project directory

When I used H2 database the database files are stored at C:\Users\MyName\TestDataBase.db directory. The H2 path is jdbc:h2:~/TestDataBase. This is default H2 da

Why is a parallel stream slower than a sequential stream?

I have two functions solving the same problem. The first uses a sequential stream, and the second uses a parallel stream. public static int digitalRoot(int n)

Force client or server to restart SSL handshake (or expire SSL session)

I have a java client which connects to an HTTPS server (the server written in Java also). Here is the HttpClient setting in the client: SSLContext ctx = SSLCon

Calling grpc server from multi-threaded client

I have a client side code, which is multi-threaded, calling updateInfo rpc method to the grpc server to update the information(Eventually will updata data in SQ

Remove trailing substring from String in Java

I am looking to remove parts of a string if it ends in a certain string. An example would be to take this string: "[email protected]" And remove the @2x.p

How to pretty print a complex Java object (e.g. with fields that are collections of objects)? [closed]

I'm looking for a library function (ideally from a commonly used framework e.g. Spring, Guava, Apache Commons etc.) that will nicely print the

How do I resolve Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https://repo1.maven.org/maven2)?

I'm migrating an app to use ehcache 3.10.0 but getting a build error: Could not find artifact javax.xml.bind:jaxb-api:pom:2.3.0-b161121.1438 in central (https:/

Mock redis template

I am facing a issue in mock redis template. Can any one help me to write unit test for below class. @Repository public class CasheRepo { @Autowired pr