Skip to content

Tag: java

Java Proxy.newProxyInstance IllegalArgumentException

I define an interface follow then I define a abstract class implement the interface then I has a class extends the abstract class now I want to generate a proxy for the instance field of the BaseCore class,I do this but I receive the exception who can help me explain the excetion and how I can solve the probl…

Find certain numbers in a String and add them in separate ints

I need a way to take specific “random” numbers from a string and put them each in separate int variables. For example this string cannot/shouldnt be changed: String date = “59598 22-01-19 22:46:32 00 0 0 66.2 UTC(NIST) * “; I need these three numbers in separet ints “22-01-19&#82…

how to remove log4j form recursive dependency?

I was trying to remove the log4j dependency from my project which is a huge repository. After having a close look in gradle files I found one of the module refers to the log4j dependency, which I excluded in gradle as shown in below code – exclude group: ‘log4j’, module: ‘log4j’ …

ElasticsearchClient 7.16 mapping source from JSON file

I’m migrating our app to new ElastisearchClient for Java. We have few mapping/setting/properties configurations created in JSON files like here Elastic mapping source 7.15. Is it still possible to map sources as in these examples? Or is it fully migrated to: builders and functional patterns Currently, w…

reusing stream inside a stream java

Hi I just wanted to know what is wrong with my code and how can I improve it as it throws an error “stream has already been operated upon or closed” thank you here is my code: I wanted to loop inside the file and check per line if the characters there exceeded 12 characters or not Answer You canno…

Spring Boot, Swagger and Authorisation

I have a Spring Boot API that uses Springdoc (Swagger). The API has security with “apiKey” and “code” fields being passed in the header. I am having difficulty configuring Swagger correctly to enable the Authentication function in the Swagger UI. This is the configuration: I know this …