I’ve created a simple drawing program which just basically prints pictures on a canvas by choosing from 3 pictures and then the user can save the image that he created and open a previous image , the program works perfectly good , but I’m facing a problem : when I save the image , the image is not…
Tag: java
Should we set -Xmx (max java heap size) in a kubernetes container
TLDR; Why bother settings -Xmx and -Xms in a kubernetes app? We’ve inherited a kubernetes app that is having out of memory errors. It looks like the initial devs set kubernetes resource limits (.95 CPU core and 4Gb memory) as shown below. However, they also set the max heap size in JAVA_OPTS -Xmx to 800…
Moving Jib configuration of one module into a new module, to refactor multi-module gradle project
I have a multi-module gradle project and one of the modules is a webapp. I added Jib configuration within the webapp build.gradle file to generate the container images. Similarly I have a few modules for command-line applications and I use Jib jar config to create container images. I want to move the Jib spec…
Java Skipping switch statement using getter as expression
Hey Sorry for the what for you guys must seem like a stupid question but I’ve been stuck on this for a while now, im using a getter from a different class as the switch expression in another class, my program keeps skipping the entire switch alltogether. Thank you for your time! First class Second class…
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name ‘messageSender’
Error while trying to publish a message from spring boot to Google cloud platform pub/sub. I was trying to publish a message to the Google Cloud Platform pub/sub messaging queue. I was getting the following errors while trying to run the application.Please help. I was using only a single Java Class file. Thea…
> Could not find com.google.android.exoplayer:exoplayer-core:r2.4.2
I am facing this exoplayer not found error in video android studio application after I updated my project dependencies. I don’t know how to update old Exoplayer link to https://mvnrepository.com/artifact/com.google.android.exoplayer/exoplayer Can anyone tell how to remove this error and update to latest…
Updating field using reflection from parent class
I have a Parent class that has a method that uses reflection to retrieve and update fields. This method will be called by the child class When the child class (in this case, an anonymous class) calls the method, which is inherited form the parent, the value of this is the child class. Because of that, I thoug…
What is the purpose of apply maven plugin in build.gradle?
I keep seeing apply plugin: ‘maven’ in build.gradle files for Java projects. What is the purpose of adding a Maven plugin? I can’t seem to find the plugin when querying for it on plugins.gradle.org. Answer Why don’t you just google it? http://sorcersoft.org/project/site/gradle/userguid…
Java Swing Drawing A Rectangle [closed]
Closed. This question needs debugging details. It is not currently accepting answers. Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question. Closed last year. Improve this question I’…
@Retryable with @Scheduled don’t fire
I’ve written a Spring Boot Application where I’ve enabled Spring Batch Scheduling and Retriable as follow: I’ve defined a controller as follow: After 2 minutes, as the cron expression specified starts the job, so in the first step of it I’ll send it in exception so in the job execution…