23,204 questions
0
votes
0
answers
28
views
Wildfly jtds upgrade java gives connection reset using SSL
We have been using wildfly 20 with the old jtds driver for jdbc connection pooling. Any many of our customers have been as well.We just upgraded from jdk 8-265 to jdk 8-462. After the upgrade, nothing ...
0
votes
0
answers
62
views
Why won't my Netbeans 12.4 open on my Macbook M1 Air?
As the title states, my Netbeans refuses to open; it has the opening loading prompt but it closes as soon as the text says "Done loading modules".
I currently have the newest versions of ...
1
vote
1
answer
152
views
java error when trying to compile and execute java programs using intelliJ idea
I am experiencing build failure when trying to compile and execute Java programs using JDK 8 (1.8.0_432). I keep getting the following error from IntelliJ idea:
java: invalid flag: --add-modules
Not ...
0
votes
0
answers
50
views
Springboot 2.2.5 Java8 not exposing GraphQL
My application runs on Java 8 and Springboot 2.2.5.RELEASE and I am using below dependencies to expose a GraphQL service.
<dependency>
<groupId>com.graphql-java-kickstart</...
0
votes
1
answer
78
views
DYLD_LIBRARY_PATH is null [closed]
I'm trying to run a .jnlp file on my Mac, but I keep getting the error:
DYLD_LIBRARY_PATH is null
java.lang.UnsatisfiedLinkError: Can't load /Users/setupuser/Library/Application Support/Oracle/Java/...
0
votes
1
answer
55
views
Doc4j corrupts docx file after inserting paragraph
I am trying to add a simple text paragraph with text ""Hello from Java test!" in an existing simple docx file (contains only one dummy line of text already) using docx4j.
But when I am ...
2
votes
0
answers
101
views
Java web-socket ssl certificate error while cert is valid
Hello I've been facing a weird problem the past few days.
I send out a demo of my app to a few people. however for around 75% of the people the demo didn't work, while for the other 25% it works great....
0
votes
1
answer
50
views
InvalidDataAccessResourceUsageException: could not execute statement [ERROR: column "" is of type jsonb but expression is of type character varying
I am using SpringBoot 3.5, PostgreSQL and Hibernate/JPA as ORM.
While using JSONB column from DB I am having this error.
org.springframework.dao.InvalidDataAccessResourceUsageException: could not ...
2
votes
1
answer
156
views
CharsetDecoder used within InputStream in release Java 8 onwards doesn't seem to honor CodingErrorAction.Replace
Issue can be found in version Java8 onwards. A CharsetDecoder is explicitly configured with CodingErrorAction.REPLACE ; I would expect the replacement character \uFFFD to be applied when decoding ...
1
vote
1
answer
110
views
Why failed when using mockito3 + powermock2 to mock new object
I am trying to mock a constructor method. But failed with messages said unnecessary stubbings.
What modify should I make to succesfully run this unit test? Plus, Better not to modify the version of ...
-2
votes
1
answer
365
views
Can i use spring version 6 and above with Java version 8?
I wanted to upgrade my spring version from 5.3.39 to the 6 series. But when I tried to do that, it didn't compile and threw an error.
This is the error that I'm getting:
Failed to execute goal org....
-4
votes
1
answer
123
views
Is it mandatory to specify the data type of a base class which is declared generic while inheriting?
I'm trying to understand Java generics better. Suppose I have a generic base class like this:
class Base<T> {
T data;
}
Now, if I create a subclass, do I need to mention the parameter type ...
0
votes
0
answers
49
views
java.security.AccessControlException: access denied ("java.net.SocketPermission" "localhost:1099" "listen,resolve")
Facing issue with RMI Registry.
Inititally my code was developed using java 6 or lower version but recently we have upgrade our java to java 8 and came to understand that it has some tighter Security ...
0
votes
0
answers
63
views
JavaMail running on Oracle 19c database and TLS1.2
Running Oracle 19c with Java 1.8.0_451 and JavaMail 1.6.7. I'm attempting to send emails via SendGrid from a stored procedure on the database referring the the following Java class:
CREATE OR REPLACE ...
0
votes
0
answers
30
views
OpenEJB (for Unit-Tests) not working after Upgrade from 7 to 8
we use OpenEJB 7.0.9 for Unit-Testing with Java 8.
Now we switch our Application to Java 11 and tried to Upgrade OpenEJB to 8.0.16.
But since Version 7.1.4 and 8.0.0 (org.apache.tomee -> openejb-...
1
vote
0
answers
4k
views
Running JavaFX Application on JRE 8u451 After JavaFX Removal
I'm facing an issue with a JavaFX application written for JDK 8. My company recently updated to JRE 8u451, and the application no longer runs because JavaFX has been removed from this release. I have ...
2
votes
1
answer
122
views
Java how does searching for a key in a HashMap bucket work?
EDIT: As one of the people commenting mentioned, this question only concerns this specific implementation: https://github.com/openjdk/jdk/blob/master/src/java.base/share/classes/java/util/HashMap.java#...
0
votes
0
answers
143
views
GC pause by Metadata GC Threshold for weeks then turned to Full GC
I have a java application running heavily groovy scripts. After running for weeks, the system encountered Full GC in every day, every time it cost about one second which is not acceptable.
How can I ...
0
votes
1
answer
63
views
Jersey: Disable standard ExceptionMapper
I developed a RESTfull API with Jersey (2.25.1) and my goal is to always return the same JSON even in case of errors.
I then configured a series of exception mappers including one for handling the com....
0
votes
0
answers
116
views
Do Swing dialogs gain focus on opening?
Do Swing modal dialogs gain focus on opening?
They should. However, no log message is ever printed if you execute the demo below. Why?
import javax.swing.JButton;
import javax.swing.JDialog;
import ...
1
vote
2
answers
97
views
Iterating a list once instead of twice
I have a json for students with marks . I need to get the total marks for maths and english per standard . I could do it for each subject like below , but here the list is iterated twice. Is there a ...
1
vote
0
answers
881
views
How to run JavaFX application using the latest JRE 8u451?
As announced, Oracle removed JavaFX from the latest JRE (8u451 released on 4/15). As a result our customers are not able to start it. Is there any possible workaround for this problem?
We have ...
0
votes
1
answer
47
views
Grouping By Child Class into Map
I had made a list of Parent Class (as Employee) having a parameter of child class (as Department)
class Employee {
Integer empId;
String empName;
Long salary;
String email;
...
4
votes
1
answer
116
views
Error using ternary operator and method overloading of wrapper class in Java 8 only
I am using Java 8 and facing some weird error.
The compiler gives the following error:
error: reference to [method] is ambiguous
Here's my code
StringBuilder sb = new StringBuilder();
Stack<...
0
votes
0
answers
44
views
JsonInclude.Include.NON_EMPTY Doesn't Work after I implemented custom serializer on an attribute
I have a class which has Include.NON_EMPTY configuration on class level.
@JsonInclude(value = JsonInclude.Include.NON_EMPTY)
public class Item extends ExtraInfo {
String id;
List<String> ...
0
votes
0
answers
57
views
Converting a jsonString to HashMap
I have a jsonString which is a list of key value pairs.
[
{"id": "123", "url": "ghi"} : 2,
{"id": "456", "url": "def"} ...
0
votes
0
answers
22
views
CGLIB ASM dependency when deploying to JDK8
I'm trying to deploy to Java8 and I keep getting below exception.
I'm trying cglib 3.2.5 and ASM 5.2 jars but has not worked.
I have checked ASM classwriter does not have a Boolean constructor ...
0
votes
2
answers
141
views
How to prevent Java21 to forcibly add 'ns2' to namespace?
I have a Java application doing SOAP requests to a WebService (which I have no control of). It is currently running on Java8 and I need to make it compatible for both, Java8 and Java21 (not only ...
-1
votes
1
answer
78
views
How to solve JDK Gradle Config error in Flutter
I tried running few flutter projects but it gives me this same error -
ashvinstech@Ashvins-MacBook-Air untitled1 % flutter run
Launching lib/main.dart on Redmi Note 7 in debug mode...
FAILURE: Build ...
1
vote
0
answers
59
views
Large file download using Servlet with Streaming without browser buffering
I am developing a Java 8 servlet to download a zipped resource. The file size can vary significantly, sometimes reaching up to 700MB. For testing, I am using a 350MB ZIP file.
The expected behavior is ...
0
votes
1
answer
71
views
Java Lambda Expression: How to count elements in List
List<String> l1 = Arrays.asList("ab", "cd", "ef");
long count = l1.stream().count();
System.out.println(count);
I want to use lambda expression instead ...
0
votes
0
answers
26
views
Incorrect operation of radius check for local messages (Plugin MC, Spigot 1.15.2, Java 8, Gradle)
I was writing my plugin and during one of the changes, my radius stopped working, that is, all messages are sent both local and global, but if player_1 writes messages in the local chat, then player_2 ...
0
votes
0
answers
127
views
Error Pooled object has not been returned properly occurs sometimes when I ask a connection from the DBCP pool
I have to correct an existing Java Backend application implemented in Java 8 with no Framework, and deployed on Tomcat server under Linux Virtual Machine.
This application is connected to an Oracle ...
0
votes
1
answer
128
views
Mockito mock a method that returns void with ArgumentMatcher.any() as parameter
I am trying to mock a method and want to execute the internal logic as is when called.
The method returns void so When I am using when(MockedObject.methodReturingVoid(any())).callRealMethod(); It ...
-7
votes
1
answer
73
views
Need to group by list of list in pojo in java and sort by year and month
We are getting list of AssetValue from database,
After getting the list I need to group by id and sort by year and month.
Based on the grouping I need to print on reports.
Public Class AssestValue{
...
0
votes
1
answer
71
views
Modify JAVA Optional Object and compare with its original data
I'm trying to create an API where I'm updating a set of data into database. While updating, there is data that comes the same as what's already present in the DB. I want to check this and avoid ...
0
votes
0
answers
84
views
Flutter run: JAVA_HOME is set to an invalid directory
i have downloaded jdk8 and the environment variables is set correctly
java -version java version "1.8.0_431" Java(TM) SE Runtime Environment (build 1.8.0_431-b10) Java HotSpot(TM) 64-Bit ...
0
votes
0
answers
76
views
PKCS#11 digital signature application: error with token on JRE 1.8.0_441
I am writing an application for digital signature using PKCS#11. The Certum token works on JRE 1.8.0_333 (32-bit) and JRE 1.8.0_441 (32-bit). The CenCertum token works on JRE 1.8.0_333 (32-bit), but ...
0
votes
0
answers
41
views
Gradle build error with groovy.lang.MissingMethodException
Intellij 2024.2.1
Gradle 8.2
JDK 1.8
Got a gradle build error
groovy.lang.MissingMethodException: no signature found.
org.gradle.api.internal.artifacts.ivyservice.dependencysubstitution....
0
votes
1
answer
105
views
Multiple print statements without null checks using Optional [duplicate]
I am trying to convert the below null check of legacy java 7 code to modern java using Streams and Optional.
if (person != null) {
System.out.println(person.getName());
System.out.println(person....
1
vote
1
answer
164
views
Intellij Idea freezes while build an app on an specific computer
I'm working on several projects with java and Intellij Idea 2024.3.1.1, because of the academic licence. I regularly work on a computer with a 10th generation i3 processor with 18 GB of RAM, and ...
2
votes
1
answer
104
views
Resolving relative URIs in Java 8 while dealing with JDK bug
I'm in the scenario where I am stuck on Java 8. I have a program that creates and resolves URIs using java.net.URI. These are generally always going to be http scheme, but we will potentially get ...
0
votes
0
answers
63
views
SSL handsake issue in TLS1.2 in java 8
I have same java 1.8_171 application with same server type redhat 7 running in 2 servers in one server when it hits the external api it works fine but from another server when hitting the same api it ...
0
votes
2
answers
80
views
Java 8 - javax.sound.sampled.UnsupportedAudioFileException Error on JBoss Server
In an application I developed with Java 8, I am trying to convert a .wav audio file received in Base64 format to PCM_SIGNED format. The code works fine in the local environment, but I get the ...
1
vote
0
answers
153
views
Unable to setup PIRANHA BY UBER to remove stale code in my demo application
I am trying to setup PIRANHA BY UBER on my local for a demo java (Java 8) application. I am not able to perform a remove the stale code by building it.
Demo Application:
@Controller
public class ...
0
votes
0
answers
46
views
shutdownOutput() is not supported in SSLSocket while using CloseableHttpClien close method
Oracle Java Version: 1.8.0_192
HttpClient JAR: 5.4
Upon using ClosableHttpClient with try with resource
try(ClosableHttpClient clinet = ......){
//...
}
I am getting this error:
The method ...
0
votes
0
answers
33
views
Resolving Nested Tags Issue in HTML Output When Upgrading HTMLCleaner from Version 2.4 to 2.29
I have a Java method that uses HTMLCleaner version 2.4. Due to high CVE vulnerabilities, I need to update HTMLCleaner to version 2.29. However, the generated HTML output from version 2.29 contains ...
0
votes
0
answers
32
views
Intermittent JAXBException Error in WebLogic - "isContentLengthReqd is not a valid property" During Restart
I'm encountering an issue while restarting my WebLogic server, and I need some guidance. Specifically, I'm getting the following error:
weblogic.application.ModuleException: javax.xml.bind....
5
votes
1
answer
135
views
Strange Java regex matching behavior regarding negation via ^
In Java 8, the following script prints true
import java.util.regex.Matcher;
import java.util.regex.Pattern;
public class Main {
public static void main(String[] args) {
String regex = &...
0
votes
0
answers
53
views
JBoss EAP - Upgrade from 7.4.2 to 7.4.3
We are looking to upgrade JBoss EAP(JBoss Enterprise Application Platform) 7.4.2 to 7.4.3.
Currently, Application is running in
java-11-openjdk-11.0.10-1
jboss-eap-7.4.2.
java version "1.8.0_301
...