Skip to content

Category: Java

implementation of Gateway Global filter in Kotlin to Java implementation

I have a scenario that I have some microservices, cloud gateway and eureka server. All microservices and cloud gateway registered on the eureka server. Cloud gateway will securing all the downstream services. When any user want to access the service first it will fill out the username and password for authentication on the cloud gateway. If the user will be

DownCasting in generics in java

I am stuck in generics downcasting. Because I learn type erasure. When code compiles all parameterized types are converted to the upper bound if the bound is not defined then it changes to object. Gen Class GenDemo Class String str = strob.getob(); is converted to String implictly. how JVM converted strob.getob() to String. From where JVM found the strob.getob() is

Swagger is not working in Spring boot framework [closed]

Closed. This question needs debugging details. It is not currently accepting answers. Want to improve this question? Update the question so it’s on-topic for Stack Overflow. Closed 12 hours ago. Improve this question It shows failed to load API definition for one service only REST services are working fine network of the swagger is shown in the image Answer Do

Cannot read the array length because “” is null

I have an exercise in java whose text is: The Matrix class represents an array of integers. Its skeleton is as follows: public class Matrix { private int [] [] mat; / * creates a Matrix object whose content is represented by the matrix matrix. * / public Matrix (int [] [] mat) {…} / * returns the sum of

Program to find from where the program is called

The requirement is very simple, I want to write a simple hello world program or anything so the program knows about its execution parent. For eg. Since I am from a Java background I will give a Java example. I want to write a jar that runs and outputs the following: Running from command line: but when running from myscript.sh:

Mongo DB updating parts of object

I have the collection that stores documents per some execution Flow. Every Process includes “processes” and each process includes steps. So I end up with a ‘flows’ collection that has documents that look like this: A couple of notes here: Each flow contains many processes Each each process contains at least one step, its possible that in different processes the

Share an array between threads in java

I’m currently working on my own little boardgame and came across a problem with multithreading. I have one thread that renders the board and one that supplies the data to render. The supply thread writes his data to one array and then the renderer takes this data and renders it on the screen (The render thread never writes something to