Category "java"

java.io.IOException: mark/reset not supported

try { //String location = dir1.getCanonicalPath()+"\\app_yamb_test1\\mySound.au"; //displayMessage(location); AudioInputStream audio2 = AudioSystem.

JVM Stack Variables

I understand JVM creates a Stack for each thread and that Stack contains calls to other methods as thread invokes them. I don't understand when it says Stack wi

What is the best way to avoid NoSuchElementException in Selenium?

I have written few test cases in Selenium WebDriver using Java and execute them on grid (hub and multiple nodes). I have noticed that a few test cases fail due

exception sending context initialized event to listener instance of class

I have this class: public class DatabaseHelper { @Autowired static UtilService utilService; public static void fillEmptyTables(){ if(!isSk

Android: how to hide ActionBar on certain activities

I've developed a simple demo application with a splash screen a map and some regular screens. I have an action bar at the top that contains a logo. It all look

exception sending context initialized event to listener instance of class

I have this class: public class DatabaseHelper { @Autowired static UtilService utilService; public static void fillEmptyTables(){ if(!isSk

QR Code in Base64 encoding for KSA E-Invoicing In Java [closed]

How to Create HEXA and BASE 64 QR code for E-Invoicing Saudia Arabia. There is problem converting hexa to base64 but that is not readable in E

ByteArrayOutputStream.toString() generating extra characters

I have the following code: ByteArrayOutputStream baos = new ByteArrayOutputStream(); int size = 4096; byte[] bytes = new byte[size]; while (is.read(bytes, 0,

why I see this when compiling my project in bootstrap? "Found 0 JPA repository interfaces."

I have created a Bootstrap project in which I have 3 repositories. When I compile the project I do not receive any errors but unfortunately I can not see my con

Flyway Found more than one migration with version

I've two sql files , one for oracle and one for mySql database. Path is as follows db/migration/mysql/V1_1_migration.sql db/migration/oracle/V1_1_migration

How to quickly detect and remove log4j classes from our code base and the base image? "mvn dependency:tree" does not check base image

We are building an app based on Red Hat JBoss AMQ 6. We wrap some Java code around the base image to provide extra functionalities which are lacking in AMQ 6. N

How can I add only the new items of the JSON API without duplicating the existed items?

I want to make an auto refreshing system for my android application. I use a JSON API in order to get the posts. Here is what I did: handler.postDelayed( runnab

How to convert from Json to Protobuf?

I'm new to using protobuf, and was wondering if there is a simple way to convert a json stream/string to a protobuf stream/string in Java? For example, protoS

Why does List.of() in Java not return a typed immutable list?

The list returned by the method List.of(E... elements) in java does return an immutable list, but this is not visible at all by looking at the created list. The

Split string into array of character strings

I need to split a String into an array of single character Strings. Eg, splitting "cat" would give the array "c", "a", "t"

Spring JUnit: How to Mock autowired component in autowired component

I've got a Spring component I'd like to test and this component has an autowired attribute which I need to change for the purpose of unit testing. The problem i

An SPI class of type org.apache.lucene.codecs.Codec with name 'Lucene54' does not exist

With lucene-core-5.5.2 i am facing problem a in weblogic server. standalone search application works but when i deploy as WEB APP it is failing with below error

Java says FileNotFoundException but file exists

I have an assignment for my CS class where it says to read a file with several test scores and asks me to sum and average them. While summing and averaging is e

How to use different menu in fragment than in activity?

I want to have a menu for my main activity and a menu for a fragment which is contained in the main activity. The main activity menu should be removed and the f

what is the default page for spring-mvc application

IF i have this line in web.xml then i know which is landing page <welcome-file-list> <welcome-file>redirect.jsp</welcome-file> </welcome