Category "java"

How to add Repository maven in new Android Studio Project setup(2022)?

I want to use the maven library in the android studio project. in the library documentation, they mention adding like this, repositories { maven { url 'http

How to add HTTP headers in Microprofile REST client dynamically?

I am developing application, which uses microprofile rest client. And that rest client should send REST request with various http header. Some headers names cha

Execution Flow for Executor Service

I am using Executor Service for multithreading. I have the below code: ExecutorService executor = Executors.newFixedThreadPool(100); final Multimap<String,

NIFI: NoClassDefFoundError - AbstractListProcessor

I'm extending a standard processor to create a custom nifi processor. The project builds fine. But, when I restart my nifi after adding the newly generated nar

Gradle - Error Could not find method implementation() for arguments [com.android.support:appcompat-v7:26.0.0]

I am trying to open existing android project in android studio and it gradle cannot build the app without the error Error android studio keeps on throwing Err

Where to close a member variable (e.g.:socket) in a java class?

In my case, the member variable is socket. But this question can be general for any member variable which needs some operations before the object is deleted. I

ScrollView too long therefore produce white borders

I'm still working on my android application and I still struggle with XML ans scroll views. I want to display an AlertDialog which contains: A JPEG image a the

JERSEY : Error Trace : java.lang.IllegalStateException: Entity input stream has already been closed

I am working with Jersey 2.x. Following is my controller @GET @Path("{id}") @Produces("application/json") public Response getUser(@PathParam("id") int userId,

how to check if ElasticSearch's Restore is finished?

Can I monitor Elasticsearch's Restore process? I am looking for a GET request in Elasticsearch's API that checks if restore has finished. I'm restoring indice

How to use Kotlin with a Bukkit/Spigot plugin and Gradle

I am trying to use Kotlin for a Spigot plugin (for version 1.8.8), as I find Kotlin a lot more efficient to use. But, whenever I try and run the plugin, I get t

What should be @JsonFormat(pattern="") in Spring-boot for given example

Using Spring-boot RESTful service,in that receiving JSON file which contain DateTime in following format "2017-08-16T16:08:25.000Z" and JsonFormat tries are e.g

Jasypt not decrypting properties during junit testing, but works fine when spring boot app runs

I have a Spring Boot application with a few properties encrypted with Jasypt, and I provide the secret key with the following VM option: -Djasypt.encryptor.pass

java.io.IOException: Invalid keystore format / Unrecognized keystore format. Please load it with a specified type, when using an old android keystore

I tried to sign an old Android application with Android Studio 4.0.1 (which I successfully signed say, 1 year ago) and it seems the keystore cannot be open anym

Exclude transitive dependency of Gradle plugin

Excluding a transitive dependency in Gradle is pretty straightforward: compile('com.example.m:m:1.0') { exclude group: 'org.unwanted', module: 'x' } H

Why do we need to typecast the WebDriver instance to JavascriptExecutor before calling the executeScript method?

JavascriptExecutor is an interface which provides some default code for executeScript method. RemoteWebDriver implements this interface and overrides the method

Getting memory leaks with okhttp

When I make a get request to an API, over and over again I see that every request the memory goes up and up until 1gb of ram usage. closing the response and au

Java HttpsURLConnectionImpl.getOutputStream() error : java.net.SocketException: recv() failed, errno = 104 Connection reset by peer

We have a Java 8 solution (as a Java application on Oracle Database) that communicates with a external webservice using HttpsURLConnection. The solution had bee

Unable to parse template "Class"

I am trying to create class in android but i got this error Unable to parse template "Class" Error message: This template did not produce a Java class or

idea: too many module declarations found

I want to create hello world java 9 application and start it in intellij idea. Now I have following structure: content of inner module-info.java: module my.m

How do I use the same variable between buttons?

I've created a rock paper scissors game in java, but I don't know how I could use the same variable to work between 3 different buttons (rock, paper scissors).