Category "java"

how to prevent jdbc from trying to connect to a mysql database during unit testing

I'm making an application for a school project, but I'm running into the issue that when I try to run the unit tests that it tries to connect to the database wh

SSLHandshakeException: Received fatal alert: record_overflow

I am receiving the following error. Not sure what is causing this and how to fix this. This is happening on the server side which is using Netscalar for Load

Getting started with GoogleCloudPlatform / Java - basic app fails

I'm getting started with GoogleCloudPlatform - I want to use it from Java on my Mac. I have followed the various installation instructions and have (presumably)

How to call repository method in entity listener

I'm trying to make call to repository inside my Entity Listener, when I call repository.findById() method inside my @prePersist method the same method is callin

Ballerina Maven Build Fails - toml parser

I checked out Ballerina and built using mvn clean install. I get the following error. [ERROR] Failed to execute goal com.github.spotbugs:spotbugs-maven->plu

Rewrite a C++ vector to java vector

My task is to migrate a code from C++ to Java. In the C++ there is a vector called vector1 with the following code: vector1[0].insert(vector1[0].begin(), to_str

Can you use an infinite loop to run a program continuously using Java?

I have a question that I have researched that I did not find any compelling answers to. If you want to run a program in a loop every 2 hours o

Could not resolve version conflict among [io.cucumber:cucumber-core:jar:7.3.4 -> io.cucumber:messages:jar:18.0.0

I have included all the jars in the POM file as follows: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xml

solr exception Expected mime type application/octet-stream but got text/html

Hi I am trying to index an entity in solr using spring boot data solr. But i am getting exception Caused by: org.apache.solr.client.solrj.impl.HttpSolrCli

java.util.logger undefined for the type System.Logger

I am new to java and trying to use the logger in java.util. I declare the logger like this snippet: Logger logger = Logger.getLogger(MyClass.class.getName());

Mock ResultSet with Mockito

How to mock the resultset? In the test class trying to mock the resultset as below but, when trying to test getting error as UnnecessaryStubbingException at s

Read Patient Information from HL7 Standard Message

For HL7(Health Level 7) I'm using Hapi Write Operation :- ADT_A01 adt = new ADT_A01(); adt.initQuickstart("ADT", "A01", "P"); // Populate th

Issue with Java StringEscapeUtils.escapeHtml4()

I am trying to escape a string object in my Java application using StringEscapeUtils.escapeHtml4. I am using commons-lang3-3.5.jar library. Below is the forma

Non-accessible configuration design

Due to design constrains the project I am currently working on won't allow us to write certain set of configuration parameters in plain text file such as proper

How to wait for login cookie in C# Selenium WebDriver?

Im only been working with Java before but need to set up some tests in C#. In a login test I like to have a wait method waiting for the login cookie to be set.

Use SortedSetDocValuesField to sort multiple fields - Error: unexpected docvalues type SORTED_SET for field

I am just implementing a search with Lucene 5.5.0 for a JSF web application. In the application, several user can edit documents and very simple (only date and

Spring Boot build image failure for native image

Using spring boot 2.6.2, with java17, trying to create native image but it fails with below error. I am building it on windows 11 machine with docker desktop i

JavaFX Modular Application, java.lang.module.FindException: Module javafx.controls not found (Java 11, Intellij)

I have a problem with my modular JavaFX application. I created a JavaFX project and added the JavaFX lib and JavaFX modules get recognized. However, I keep gett

Can javafx run with DRM in ubuntu without desktop environment?

I am tring to run a javafx program on ubuntu with this DOC,i am using sdk:monocle-linux-x64_bin-sdk,and copy the library to lib path(include the libgluon_drm-1.

Create Random Pixel Images in Swift

I want to create a random pixel generator in swift. How would I be able to create something like the below codes in swift? Java program to demonstrate creatio