1,918,272 questions
1
vote
1
answer
66
views
java-cup sends "Syntax error @ Symbol: PARSER" and NullPointerException when compiling a .cup
I’m working on a DSL parser using Java CUP, and I’m getting this error when trying to compile my .cup grammar:
Error: Syntax error @ Symbol: PARSER (unknown:19/-5(-1) - unknown:19/1(-1))
Error : ...
Advice
0
votes
0
replies
29
views
Jacoco Configuration in java Project- Parent pom.xml configuration to include aggregated code coverage of all the modules
root pom.xml file
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.11</version>
<...
Best practices
0
votes
5
replies
84
views
Pushing down filters in RDBMS with Java Spark
I have been working as a Data Engineer and got this issue.
I came across a use case where I have a view(lets name it as inputView) which is created by reading data from some source.
Now somewhere ...
0
votes
0
answers
80
views
Maven Dependency Plugin 3.4.0 fails with "Text file busy" when unpacking Linux ZIP dependencies
I recently upgraded the Maven Dependency Plugin from 3.3.0 to 3.4.0, and now my build fails during the unpack phase with the following error:
Failed to execute goal org.apache.maven.plugins:maven-...
1
vote
2
answers
144
views
Storing biometric data in a PDF without breaking the digital signature
I'm developing a tool that stores a signer's biometric data inside a PDF together with the digital signature, but I'm unsure where this information should be embedded.
The biometric data is captured ...
4
votes
0
answers
81
views
Calling SearchableComboBox.getItems().remove() from the OnAction Event results in an IndexOutOfBoundsException
I am trying to create a JavaFX project featuring multiple instances of the SearchableComboBox control from the ControlsFX library, each having the same list of options. When an option is selected in a ...
Advice
0
votes
9
replies
127
views
Why the inherited method output parent's data?
Explain please why the output is "Base" ? Isn't getClassName method inherited?
class Base {
public String className = "Base";
public String getClassName() {
...
0
votes
0
answers
27
views
JPro classes in Heroku
After creating a Profile with run command
java -jar target/fractals-1.0-SNAPSHOT.jar -Dserver.port=9090 -Xmx512m
system gives:
Error: Could not find or load main class com.fractals.sierpinski....
0
votes
0
answers
43
views
Every time I switch between frames on my bottom navigation view their is lag, How do i get rid of it?
I have an (android studio) garden app that uses multiple image/video views that sometimes change depending on the data. For example if the pressure is low the sky changes to a rainy day(if high it is ...
Advice
0
votes
0
replies
52
views
Oauth2 client in spring
Im posting here because cant get a working example of oauth2 client implementation in spring boot 3.5.7
This is my first time ever implementing this type of authentication and cant manage to make it ...
0
votes
0
answers
51
views
Spring Boot plugin builds Docker image using Buildpacks
I am trying to build an app using Spring plugin without Dockerfile using docker compose running in Ubuntu. Here is my docker-compose.yml:
services:
app:
image: 'docker.io/my_appName/api:latest'
...
0
votes
3
answers
102
views
Building a WAR package, that can be deployed under Tomcat and can be executed in the CLI as well
I would like to create a WAR package with maven, that can be deployed under Tomcat (9 or above) and also can be executed on the command line (= CLI). I already realised to make a package, that could ...
0
votes
0
answers
54
views
Mockito MockStatic behavior leaking to other junit tests
I am using Mockito 5.20.0 to mock a static method, but the mock is not correctly closing / the mocked behavior is leaking outside of the tests it is intended to apply to. This is only a problem if ...
Best practices
0
votes
3
replies
54
views
How to setup additional CA certificates *on top of* defaults in Java. I can't change the system wide CA list
In a rather big application there is the need to connect to various https://... hosts (web services, rest services, html scraping etc).
Quite a few of the hosts suffers from various ssl problems (self ...
-2
votes
1
answer
82
views
Converting from Java model to JPA
I have implemented a class User that represents a User (so far either a Student or a Teacher). What they have in common is that they both have IDs, and some information about the user (this is stored ...
0
votes
0
answers
50
views
Spring boot GCP PostgresSQL
I've been trying to connect my spring boot service to Google cloud Postgres instance but facing an issue. I'm migrating a service from golang, that's using a connector to communicate with the database,...
Advice
0
votes
2
replies
59
views
Collection with fragmented index
I want to map a DB-table into a Java collection object. Important for me is a numerical index IDX and some other data, e.g. a STR.
IDX STR
1 Max
2 Sam
4 Tom
7 ...
0
votes
0
answers
65
views
Spring Boot app using AWS Parameter Store does not reflect updated values even after container restart (requires redeployment)
I have a Spring Boot application running in a container.
I configured AWS Parameter Store integration using:
/application/env/version/1.0/SPRING_CONFIG_IMPORT = aws:parameterstore:/application/env/...
0
votes
1
answer
42
views
How to run a JPro application in Heroku
I have a JPro-Maven application that i run with "clean install jpro:run".
I want to run-deploy same app on Heroku without too many configs or to do things perfect. I use now heroku-maven-...
4
votes
1
answer
102
views
Java ExecutorService detect asap thread fail
I have to run x asynchronous threads , which can last several minutes each.
They ALL have to terminate properly without exceptions.
If one fails I have to stop them all immediately and not wait ...
-4
votes
0
answers
47
views
Triggers usage on updating two tables
I'm having two loans table. one is for internal other one is for external. Both having similar columns.
I don't want to disturb one for other so i have created 2.
Problem is both has to be sync. ...
1
vote
1
answer
78
views
Form field displays gibberish characters when using subsetted TrueType font
I'm using Apache PDFBox to create a PDF with form fields and embed a custom TrueType font (FreeSans.ttf) with subsetting enabled. However, when I set a value in the text field, it displays gibberish ...
0
votes
0
answers
76
views
Remove duplicates from JSON-like structure using Java [closed]
Input
{
"email" : "[email protected]"
},{
"email" : "[email protected]"
},{
"email" : "[email protected]"
},{
"email" : "kot@ma....
0
votes
0
answers
38
views
How does Java Agent DEvelopment framework manage block() inside a behaviour and restart()
I'm new into JADE and I got a question about the usage of block and restart
My testing code looks something like this
try {
destination = new ContainerID("Main-Container", null);
...
0
votes
0
answers
77
views
When scrolling to bottom of recycle view the linear layout blinks
I have a setup where there is a linear layout that acts like a header and below the linear layout there is a recycle view. And what happens is that when the you scroll up and down the linear layout ...
0
votes
1
answer
104
views
Spring Boot 3.3 migration. Cannot resolve reference to bean jpaSharedEM_entityManagerFactory
I'm migrating from Spring Boot 2.7 to Spring Boot 3.3.13. This means that I'm migrating even from Hibernate 5 to Hibernate 6.
I'm having an annoying problem when I start my Spring Application about ...
1
vote
1
answer
104
views
What exactly is the difference between AverageTime and SingleShotTime in Java Microbenchmark Harness?
I think I understand the difference between AverageTime and Throughput.
Let's say we have a method with the following annotations:
@Benchmark
@Fork(value = 1, warmups = 0)
@Measurement(iterations = 1, ...
0
votes
1
answer
46
views
How to convert recyclerview items along with other layout data to bitmap
when capturing the layout to a Bitmap, the non-RecyclerView parts of my layout appear correctly, but the RecyclerView content is missing,
How can I correctly convert a layout containing a RecyclerView ...
1
vote
1
answer
75
views
Why is Spring attempting to use a read-only transaction when I explicitly requested a new write transaction?
I have a service method that performs the following operations in sequence:
Calls a read method annotated with a custom read-only transaction annotation (equivalent to @Transactional(readOnly = true))...
-3
votes
1
answer
145
views
Flink Job Manager Direct Buffer Memory gets exhausted when checkpointing enabled
Issue:
Flink application throws Thread 'jobmanager-io-thread-25' produced an uncaught exception. java.lang.OutOfMemoryError: Direct buffer memory and terminates after running for 2-3 days.
No matter ...
0
votes
1
answer
77
views
Returning memory from glibc malloc non-main arenas to the operating system
I simulated a scenario in Java that leads to severe glibc memory fragmentation.
Step one: simulate a multithreaded environment with 600 threads.
Step two: every second, start two new threads that ...
1
vote
1
answer
74
views
Azure Storage blob upload filename collision with UUID
During performance test we got some error from Azure Storage saying that
com.azure.storage.blob.models.BlobStorageException: Status code 409, "BlobAlreadyExistsThe specified blob already exists. ...
1
vote
1
answer
80
views
How do I get bucket name when I have S3Object instance?
In AWS SDK v1, we could use the getBucketName() method from S3ObjectSummary to retrieve the bucket name. However, in AWS SDK v2, the S3Object class doesn’t seem to provide a similar method.
How can I ...
3
votes
0
answers
55
views
Hibernate OptimisticLockException in Java 21 – works fine in Java 17
Title:
Hibernate OptimisticLockException in Java 21 – works fine in Java 17
Body:
I recently upgraded my project from Java 17 → Java 21, and one of my Hibernate test cases started failing with this ...
0
votes
1
answer
43
views
No query executer factory registered for the 'plsql' language
I have a simple report that displays fields from database. I can preview the report successfully from Jasper, but when it is called from Java , i'm getting exception. I'm using jasper 7.0.3.
Failed ...
-1
votes
0
answers
107
views
Need help compiling a JavaFx project [duplicate]
Created a JavaFX app using Java 21 and copied this tutorial to build my project
https://www.youtube.com/watch?v=udigo_qSp_k
I then created my project, and everything ran fine in an IDE. When trying to ...
0
votes
0
answers
63
views
WebClient sending an empty multipart request to Flask service
I have a problem with sending multipart/form-data requests from my Java service (using WebClient but same history with RestTemplate) to Flask service. It seems like a sent body is just empty as I get ...
Best practices
0
votes
4
replies
77
views
using variable of type Class<?> in switch construct
i'm in need of a data container for several data types and fail to write some omnipotent :-) converter func.
Maybe my idea is crab, in this case please give me a hint what concept to use.
My current ...
5
votes
0
answers
76
views
Why does directSupertypes() not return a raw type as required by JLS 4.10?
The contract for Types#directSupertypes(TypeMirror) says that it will return "the direct supertypes of a type". It also references section 4.10 of the Java Language Specification.
The set of ...
Advice
0
votes
2
replies
46
views
Helidon MP: how to cancel an expensive computation in a REST service on client disconnect?
We have some expensive REST services implemented in Helidon MP 4 that often take one minute until they are finished and the response is returned. It happens quite often that the client disconnects ...
Advice
0
votes
3
replies
100
views
Java : getting sorted order of Objects
I have an List of Objects that implements the Comparable Interface that I want to sort. I do not want the original List returned sorted, nor do I want an new List returned in sorted order. What I ...
Best practices
1
vote
2
replies
80
views
Guideline for method ordering
What's the best practice, preferably backed by a publicly available guideline issued by a tech company or a standards organization, when it comes to the order of method declarations in a Java source ...
Advice
5
votes
2
replies
164
views
Why does Python get a red carpet to vSphere while Java gets a CAPTCHA and a shrug?
VMware’s pyVmomi is the velvet-rope VIP pass to vSphere: whisper pip install pyvmomi, and the data center parts like the Red Sea. It’s a universal remote with actual buttons, not stickers.
Java, ...
Best practices
1
vote
5
replies
119
views
Predictable random number based on an input string (java)
Given an input string, I want to generate a "random" number between 0 and 1.
However given the same input string, the returned value should stay the same.
I tried something like:
Random ...
0
votes
2
answers
109
views
Write logs to database in quarkus application
How can I write my log messages to database in my quarkus application?
I tried to create a ExtHandler like this:
package org.myorg;
import io.agroal.api.AgroalDataSource;
import jakarta.enterprise....
Advice
0
votes
5
replies
103
views
Jakarta CDI - Two "Singletons" of the same class
I'm new to injection frameworks. And my question is a contradiction in itself, but - hypothetically - is it possible to have CDI inject exactly 2 different instances of the same class throughout my ...
2
votes
0
answers
55
views
Logging the streaming responses from Spring AI does not capture the actual content
I'm trying to log Spring AI conversations in JSON format, similar to how SimpleLoggerAdvisor does it. However, when I set a breakpoint in this method using IntelliJ IDEA, I noticed that the frontend ...
Best practices
0
votes
4
replies
94
views
Iterating over several nested iterators
I have to implement an Iterator<E> that needs to internally iterate through multiple private iterators at different levels. For example, an Iterator<A>, an Iterator<B>, and an ...
0
votes
0
answers
41
views
JSF composite component field not working from ui:include inside another composite component
Java 21 and Wildfly 37.0.0:
Seeing this weird thing where I'm creating a new composite component, but the field passed into it is null when residing inside a <ui:include> within another ...
5
votes
1
answer
85
views
Why can't java find the module that I created and compiled?
My directory looks like this. I am just outside of the blah folder.
$ tree.com //F
Folder PATH listing for volume Acer
Volume serial number is 127C-AD6A
C:.
└───blah
└───src
└───main
...