Category "java"

Used Json Layout template but getting parameters missing in logs [log4j2]

I used Json layout template in my project but I am getting the logs with few parameters missing. I have tried to mention those missing parameters in pattern its

replacement for sun.reflect.ReflectionFactory newConstructorForSerialization

there is a project that uses newConstructorForSerialization(Class<?> incomingArgument, Object.class.getDeclaredConstructor()) to get a constructor that is

jsoniter how to prevent print null to json

I use Jsoniter to deserialize jsons and serialize objects to json. I have an object with many properties and add them as json member by @JsonProperty("xxx"). wh

Getting out of a loop, but it needs to remain running?

I've made a circle move around (in a circle), but now my application won't move on to the other tasks as I got myself caught in a loop. How do I get out of this

Getting out of a loop, but it needs to remain running?

I've made a circle move around (in a circle), but now my application won't move on to the other tasks as I got myself caught in a loop. How do I get out of this

non-static method openConnection() cannot be referenced from a static context [duplicate]

The problem appears in openConnection(). I've tried all solutions and they didn't work. Can someone save me and write the solution in details

Object Mapper to implement not null

How to implement below :- fail if name/id/sal isnull or missing/or has null value then string->pojo should fail.How can i implement ? Actual json is nested .

How do I compare strings in Java?

I've been using the == operator in my program to compare all my strings so far. However, I ran into a bug, changed one of them into .equals()

Can any on help me to fin find my javac and jni.h in java 11?

Im working on the new release of a software who moves from java 8 to java 11. I have installed both javas. In my .bashrc file i have the following lines for whe

What is the purpose of additional diamond parameters in a method signature (that look like an additional return type(s))? [duplicate]

I have the following class which builds: public class Test<T> { public T DoSomething(T value) { return value; } } I can

How to copy a file from SFTP to S3bucket

I am new to coding.I wants to copy a file from SFTP server to S3bucket.I don't want to copy it in to my local..I am trying to do this in Java springboot.Is ther

How to improve message processing faster in spring boot and MQ app?

Got a small spring-boot messaging app that receives a message from the queue and inserts/updates a row in DB2 table. Noticed this week it received lot of messag

Is there any way to return the color of a JTextField?

For example if you set the color of a textfield as Color.RED, is there a method to actually return that color? I found a method in the Oracle logs called getCar

Compare HashMap Values structured as List [closed]

I have a HashMap structured like {a=[test], b=[test, test2]} I want to compare entry values (test, test2) with each other and if any entry ha

log4j2 logger config level does not override root logger level

According to log4j documentation, if I define a logger config for package com.a.b.c with level ERROR with root logger level set to DEBUG, only ERROR logs should

Parsing empty json array as null object with GSON

I am working with some not really well designed APIs and when the object is null it returns empty array, like this: No-null response: "SourceType": { "ID": "2

Connection with SQL Server: java.sql.SQLException: No suitable driver found for jdbc:sqlserver

I am trying to connect a little Java App to a SQL Server database using Visual Studio Code. This is my code: import java.sql.*; public class App { public st

Implement autofill service in android app

I'm trying to build a password manager application. During the process I've come across a problem: implementing the autofill functionality that other password m

Which design pattern is useful to evaluate conditions and return Boolean value

I would like to know best coding practice or design pattern which I can follow to achieve following task in Java: I need to enable check box in UI based on cert

Is it possible to replace a value in a json string that occurs multiple times only at the top level of the structure via regex?

Hiho, I have a json string with the following structure: { "version": "1.0.0", "dependencies": { "version": "1.0.0" } } It can also look like th