Category "java"

How is the best way to extract a section from word document with Apache poi?

I´m using Apache poi (XWPF) with Springboot in java 11. I need to extract the section number 2 (title and content) from a word document with the follow nu

When searching for non-primary key in MySQL using DAO it keeps returning a null object

The first method works but the second method keeps returning a null object. I don't see any difference except that flight_no is the primary key. What went wrong

jstl variable is not even removed after setting it to null or using the c:remove

im trying to remove a session variable using the c:remove or c:set to ${null} but it did not work. I'm expecting the variable will be removed once I refresh the

Bindy skipping empty csv files

I built a camel route that unmarshals a csv file using camel bindy and writes the contents to a database. This works perfectly apart from when the file is empty

implementing dijkstra's algorithm using a priority queue

So I'm trying to implement Dijkstra's algorithm. I understand Dijkstra's works, but I struggle to turn the concept into code. I have what I thought would be the

How to create a button which if it's clicked, it expands and shows details?

I have this table, where there are several entries with an orderID. To show more informations about the entry, you can click on the but Is this think doable w

Error: no suitable method found for add(int,int)

ImageSpinner adapter = new ImageSpinner(context, Icons); spinner.setAdapter(adapter); ImageSpinner adapter = new ImageSpinner(context, Icons); spinner.setAdapte

How to programatically determine Android device setup timestamp

I am trying to figure out if there is a way to programmatically determine the timestamp of when an Android device was setup, just like how it can be found in Fi

Porting python PKCS1_v1_5 encryption code to java but java code not work

I have a backend,which receives codes and returns true or false. I send it codes using my python encryption,it returns true(the result varible): from Cryptodome

log4j2 logs are not writing into log file after initialization of application

I have migrated legacy application log4j version from 1.2.X to 2.17.X version. Below steps I followed in local windows WebLogic server and it works fine loading

OSX + Java + OpenSSL + org.apache.commons:commons-crypto = SegFault in OpenSslNative:initIDs

I had a simple Java class using Apache:commons-crypto to do encryption/decryption that was SegFaulting on me. On OSX, I used Homebrew to install the latest Open

JavaFX label.getText() returns nothing in another class

I need that label values (num, cost) to be displayed in Bank.java from Work-window.java num = random int value cost = int value Code Work-window.java package s.

How get a data from cborMap?

I decode byte array with cbor and I want get a data but if I use cborMap.get("String"), not found a value. byte[] bytecompressed = Base45.getDecoder().decod

Analysis the hashmap keys as 3 keys in each one lane

I'm trying to analyze a hashmap keys, so I want to make every 3 keys from the hashmap send as one line, and then after sending 3 keys it will put a "\n" so it w

Explanation of ClassCastException in Java

I read some articles written on "ClassCastException", but I couldn't get a good idea on what it means. What is a ClassCastException?

MariaDB Connector gives datetime with precision 3 instead of 6 after update to version 3.0.3

I have a spring boot application with mariaDB, after updating the connector ("org.mariadb.jdbc:mariadb-java-client") from version 2.7.5 to 3.0.3 the datetimes (

Android studio custom icon state_focused not working

custom_email_icon.xml <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item andr

Why do new lines keep appearing every time I append using "[,\n]" delimiter?

I'm new to java programming, and I currently build a program that updates an information from a user through file handling. For instance, I have this initially

Bypass gRPC interceptor for specific endpoint

Lately I have been struggling with one problem : I can't ignore io.grpc.ServerInterceptor for some endpoints, in my case the health-check one, provided under th

Feed formats other than pbf to Osmosis

I've written code in Java using the Osmosis framework and specifically OsmosisReader for Java, for OSM processing. As far as I understand, OsmosisReader can onl