Latest Questions tagged Java

Browse all latest questions tagged Java

92
Votes
Published 19 Sep, 2022
Java - POST InputStream with RestTemplate

I have a client that needs to POST a large number of large json files to a server. I've been able to get it working by reading each of the files into memory and posting the entire file with RestTempla...

131
Votes
Published 19 Sep, 2022
Java - Java 8 Unsafe: xxxFence() instructions

In Java 8 three memory barrier instructions were added to Unsafe class (source): /** * Ensures lack of reordering of loads before the fence * with loads or stores after the fence. */ void loadFence...

57
Votes
Published 27 Oct, 2022
Java - How to access global non static variable from static method

I have main method in my java program, I want to store values in global variable because i want to access that values from different methods of the class, however I am not convinced to use static glob...

58
Votes
Published 29 Oct, 2022
Java - Got java.lang.NoClassDefFoundError: org/apache/batik/dom/svg/SAXSVGDocumentFactory when using Interleaved2Of5 Barcode format

I am trying to print a list of barcodes, data for which which will be sent to the JasperReports jrxml in a List of Strings. I am successful in printing the barcodes using barbeque format, but now I h...

100
Votes
Published 30 Oct, 2022
Java - How to extract timed ID3 metadata from HLS stream in ExoPlayer?

I have an M3U8 file located here: https://vcloud.blueframetech.com/file/hls/13836.m3u8 This video contains timed metadata every single second. My goal is to read this metadata from ExoPlayer. I curre...

34
Votes
Published 30 Oct, 2022
Java - Generate a excel using java and create a macro in the excel

I have a java code that takes data from MongoDB and later creates an excel(.xls) containing this data using Apache POI but in a formatted manner. My final requirement is to mail the last worksheet i...

76
Votes
Published 30 Oct, 2022
Java - Java - Parse delimited file and find column datatypes

Is it possible to parse a delimited file and find column datatypes? e.g Delimited file: Email,FirstName,DOB,Age,CreateDate [email protected],Test User1,20/01/2001,24,23/02/2015 14:06:45 [email protected],...

71
Votes
Published 30 Oct, 2022
Java - Wildfly datasource does not connect to MySql database

I am completely new to Wildfly/JBoss so i am clueless what to do, i am sitting on this problem since yesterday noon. I am trying to use the mysql-connector-java-8.0.20.jar as the connector and my Wil...

35
Votes
Published 28 Oct, 2022
Java - RabbitMQ Connection reset Exception

I have the same issue from this question: RabbitMQ Connection reset. My code is in kotlin and from https://www.rabbitmq.com/ssl.html#java-client-connecting. val connectionFactory = Connection...

40
Votes
Published 26 Oct, 2022
Java - How to merge two execute two reactor fluxes in parallel that return lists and merge the results

I have a LegacyAccountDto that I need to build a list of from two separate sources. One is a local JPA repository and the other is a web service call. The web service version has the accountStatus a...

60
Votes
Published 29 Oct, 2022
Java - Which data structure to use to store millions of objects in multithreading environment ( Scalability and performace )?

My requirement is like : I want to perform frequent operation on millions of objects in multi-threaded environment with concurrency and scalability keeping in mind, I need best data structure suitable...

102
Votes
Published 29 Oct, 2022
Java - Java stream groupingBy key as max salary employee and value as all employee of department

I have a list of Employee public class Employee { private String name; private Integer age; private Double salary; private Department department; } List<Employee> employeeList = Arrays...

122
Votes
Published 19 Sep, 2022
Java - Error:No such property: GradleVersion for class: JetGradlePlugin

I am getting below error in intellij for a gradle project. I am importing existing gradle project and trying refresh it in gradle window. Error:No such property: GradleVersion for class: JetGradlePlu...

101
Votes
Published 07 Sep, 2022
Java - How to filter a PostgreSQL array column with the JPA Criteria API?

I am using: Hibernate 4.3.5 Spring JPA 1.6.0 Javax Persistence API 2.1 The "refcodemailing" column is defined as an array of int: int[] My entity object: @Entity @Table public class CalendarEven...

56
Votes
Published 26 Oct, 2022
Java - Logs are not loading according to Log4j2.properties

I am upgrading to Log4j to Log4j2 in my project. I have put log4j2.properties in the classpath, and its loading. Despite that logs are not coming according to properties defined in log4j2.properties....