I’ve encountered a weird issue where the Groovy application I’m working on grows to consume more memory (far beyond the limits of the xmx-argument, so it can’t be the heap) until the computer runs out of RAM, at which point the JVM behaves in one of two different ways – it either sudde…
Tag: java
Is it possible to retrieve value from application.properties without autowiring the class under test?
I have a test class that is annotated with @Spy and @InjectMocks and tested using Mockito. The class under test has a value (url) that is retrieved from the application.properties file. I’d like to test whether this url is being set correctly within the method that uses it. I can do this if I remove the…
How to listen for clicks on dynamically generated buttons in TableCell?
I have a class Task that takes field values from the database and is displayed as a row in the table. There is a controller that fills the rows of the table with objects of the Task class. I need to listen for clicks on buttons in cells. But those buttons are not present as fields in the controller. How
Cannot enable grayed-out (.setEnabled(false)) JtextField or JTextArea
Unfortunately, I cannot turn on .setEnable() for a JTextField, or a JTextField (tried both). It keeps remaining gray, so users cannot type. Please help me out. Details: taTwo can be either a JTextField or JTextArea but any I try cannot be enabled. It should be disabled for A but should be enabled for B, so if…
JFrame ending in some time
Whenever I run my code it ends in a few seconds. Why? This is the Main file: This is the GameWin file: When I try to run this code it shows running and then the code ends with exit code 1 which is good, but it just ends without showing the window. Is there something wrong with my JRE or
Convert pdf to Postscript using Java
I recently posted a question how to convert a PDF byte[] to Postscript. According to comment, it’s not possible. I was anyway looking into this other question on how to transform a pdf to Postscript. But still cannot get it working. I got my PDF saved already, how would I get an already existing PDF con…
Java Streams – group-by and return a Nested Map
my data is like this, my goal is put every unitId and value into a map like this, I already figure out two ways to achieve that, here is my code, and, First one more like write the processing manually, second one uses temporary lists which may not be necessary. Is there any direct or simple way to do this,
Is Spring Integration a good framework to implement the Transactional Outbox pattern? [closed]
Closed. This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 9 months ago. Improve this question I’m implementing Transactional Outbox pattern using Java. The …
How to prevent saving empty data in SQLite database
I dont want to save empty data in my Note App. I have tried Everything but when I leave Edittexts empty it still saves data into my data base. what should I do? this is my insertNote method and this is the method that saves my notes in my AddNoteActivity i have also tried this but this is but this
How work with soap in Spring boot like an object? [closed]
Closed. This question needs details or clarity. It is not currently accepting answers. Want to improve this question? Add details and clarify the problem by editing this post. Closed 9 months ago. Improve this question I got soap project, thats works with xsd file. But I no idea how to work with soap. How i c…