Category "java"

Execute a single task with multiple threads on a schedule

I have a function foo() that I want to be invoked by multiple threads on an interval. example: want to execute foo() every 100ms with x number of threads. I am

Starting a Gradle Daemon, 2 busy and 6 stopped Daemons could not be reused, use --status for details

When i tried to create a new gradle project with 'gradle init' it just created "infinite" gradle daemons until my memory was full and i got following error afte

error: failed to solve: failed to fetch oauth token: Post "https://auth.docker.io/token": dial tcp: i/o timeout

I'm trying to build a docker image for my java file on my M1 max MacBook, my dockerfile: FROM openjdk:8-alpine COPY . /src/java WORKDIR /src/java RUN ["javac","

The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt

I am using M1 Mac OS11.5.2. I've already downloaded zulu.jdk and zulu.jre, in "/Library/Java/JavaVirtualMachines". I also exported the PATH. echo export "JAVA_H

Why Android Studio profiler heap dump showing about 7x overhead for an arraylist?

I was wondering and testing object's memory allocation on Android/Java and found something strange happening on heap, well maybe it's just normal. Here is what

How do packages work in Java, specifically when using VSCode?

I'm trying to create a folder called 'a' within a project that I'm currently in in VSCode. Within this folder, I am trying to create a file called Solution.java

Java shortcut in VSCode to open JavaDocs

In Intellij the shortcut for showing official Javadoc is CTRL+q. Any shortcut to do this in VSCode?

How to achieve flow like this

I'd like to get flow like this one on the picture. Is there any way to intercept all HTTP request within a docker container, modify their headers and then send

Reason: The elements were left unbound

How can I load List of objects from configuration yml file in java springboot application? I already tried several sources: configuration-properties-in-spring

Injection problem in Spring Boot Test: "messageConverters must not be empty"

I have a strange problem with a Spring Boot Test. The test itself is empty, but it does not even manage to start the application. I get an error "Failed to load

I want to enable logging before running

How can I use Spring boot's logging system before running SpringApplication::run? By the way, I'm using logback and lombok. @slf4j @SpringBootApplication public

Exception in thread "main" java.net.SocketTimeoutException: Connect timed out

When I run the script using web API automation rest assured framework, I am not getting the proper api response and below are the error are posted. at java.base

Cannot resolve method 'equals(long)'

I'm working on a spring boot application. However in my service impl class I'm getting a "Cannot resolve method 'equals(long)' when I try to use the equals() me

Does Log4J2 have an equivalent of Log4J's Renderers?

I'm working in a Java solution that is using log4j 2.11 as its logging framework. I'm also using a library that uses a particular POJO extremely frequently. I w

Spring Boot Admin : java.net.UnknownHostException: Failed to resolve 'SAURABH-PC.mshome.net' after 3 queries

I had executed spring boot admin with two micro-service and eureka server last time. that time it executed but this time it is giving this error and showing in

Implementing latest version of JCIFS

Trying to update my app from jcifs-1.3.19 to the latest jcifs-2.1.29 I have changed the appropriate code, adding the "necessary" jars to build.gradle <see a

How to fix SocketException while connecting to Telegram Bot API in Java App

I'm working on my Telegram bot. I know, in my countries Telegram is locked, so I decide to connect to Telegram Bot API through proxy. When I try to run this cod

incompatible types: View cannot be converted to LinearLayout

When I want to make Apk file I get 8 errors, I hope someone helps me to fix it Task :app:compileReleaseJavaWithJavac FAILED C:\Codes\code\app\src\main\ja

How to select date only from database that storing dob as datatype timestamp without timezone in java

I have a table in PostgreSQL that stores dob as datatype timestamp without timezone example value '1997-12-03 07:00:00'. My entity class is as follows @Tab

@RefereshScope in Spring config server

As per the documentation whenever the bean in RefereshScope and the actuator end-point refresh called the bean got refreshed. Questions : Bean refresh means spr