Category "java"

How to generate and preview a presigned url of a file in jsf?

I am trying to preview any type of file such as image,pdf,doc,odt,xlsx,csv,text etc in my web app using jsf. My flow of code: Generating a presigned url using a

PDFBox render image misses content

When using PDFBox, we encounter an issue where if we call render on a PDDocument, it sometimes loses content, such as fonts or certain shapes. Having dug into

Why does my for loop to disable buttons not work, but the same loop works for setting colors in JFrame?

I am programming a TicTacToe game and I want to use a for loop with my JButton components inside them like this: private void clearField(){ for (int i = 0;

How to run Docker with python and Java?

I need both java and python in my docker container to run some code. This is my dockerfile: It works perpectly if I don't add the FROM openjdk:slim #get pyth

How to format java.time.LocalDateTime and java.time.LocalDate with pattern?

In the following snipped the property $F is of class java.time.LocalDateTime or java.time.LocalDate. <textField pattern="EE. dd.MM.yyyy"> <reportE

In app update in android always give UpdateAvailability.UPDATE_NOT_AVAILABLE

I am using in-app update but it is not working in production. I tried various ways but could not resolve the issue. The code is in java for android studio proje

Are abstract classes faster than Interfaces in Java?

According to this article here, on abstract class vs interface, abstract classes a SLIGHTLY faster than interfaces, why is that and can you explain the mechanic

Unable to create a template

I am trying to create a dataflow template using the below mvn command And i have a json config file in the bucket where i need to read different config file for

How do I make my Android app prefix each displayed line of text with ">"?

My app displays a long line of text like this: I want to add a ">" character to each line, so I tried the following code: private String addPrefixChars(Stri

Determine a bounding rectangle around a diagonal line

A user will define a line on screen which will have, when drawn, a given thickness (or width). I now need to be able to determine the coordinates of a bounding

How to resolve: javax.imageio.IIOException: Bogus input colorspace

I have a function generateImageOutput below to write BufferedImage to jpeg file. public boolean generateImageOutput(BufferedImage image, String filename){

What should I use instead deprecated FlinkKafkaConsumer? Scala Flink

I try to get data from Kafka to Flink, I use FlinkKafkaConsumer but Intellij shows me that it is depricated and also ssh console in Google Cloud shows me this e

Android App doesn't have internet connection - No Permissions required

Well, I have built an app to store values on a remote database. It works!! I didn't use an emulator for testing instead I used my own phone. Now the problem is

Attempted to finish an input event but the input event receiver has already been disposed error

I am not sure what I have done but for a moment my code was working smoothly and after I added a new activity the error Attempted to finish an input event but t

Java client using SAAJ error: SEVERE: SAAJ0008: Bad Response; Unauthorized

I have written a Java client code using SAAJ for Primevera P6 webservices. I am getting the below authentication error. I am providing the http username + passw

Writing JUnit tests for Kafka Consumer

I have a kafka consumer which is subscribing on a topic. Implementation is working fine. But when trying to implement unit tests for that, there's a problem bec

Springboot 2.6.0 / Spring fox 3 - Failed to start bean 'documentationPluginsBootstrapper'

I'm trying to initiate a Springboot project using Open Jdk 15, Springboot 2.6.0, Springfox 3. We are working on a project that replaced Netty as the webserver a

Replacing Cassandra Cluster EC2 Instances with AWS Keyspace using Java legacy driver

We are attempting to replace our existing Cassandra EC2 Cluster with AWS Keyspace and we are attempting to keep our old code base. The idea is to simply get out

I can not select list item in selenium

What is the script for selenium in li tag. I used Xpath in selenium. driver.findElement(By.xpath(" //*[@id='select2-product_cat-container']")).click() ; But

How to use unit testing if there are multiple outputs in java?

How can I test a class that returns the Fibonacci series? I used an iterator for this code. The FibonacciIteratorTest class is below. public class FibonacciIter