Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

With more than 20,000 members, join one of the biggest and most active Java Communities on Discord! ☕

Join

java-help

❓︱qotw-answers

Setting up a new spring boot application and running into an issue only in deployed env

So, I recently started a new spring boot application and I setup the security config and added one endpoint. I tested that I'm able to hit the endpoint I added and the actuator endpoint locally. However, when deployed on Kubernetes, my app pod is constantly restarting with connection refused for /actuator/info. When I try to hit the endpoint directly (deployed one), I get this strange error: `{...

Hi im so close to finishing my code and i just need help tweaking the last bits - beginner level

Basically im using if and else statements... etc.. and when i run my code it works how i want it to... it says what flavour of ice do you want then you input vanilla, chocolate or strawberry.... now heres where my code is slightly off on what i want it to do.... when i put a different flavour it should finish with we dont have that flavour but instead it goes onto the next line of code which is how many scoops do you want and when i put the no. of scoops then it says we dont have that flavour bu...
No description

synchronization or semaphores to be specific

hi there, i'm trying to understand the concept of threads and synchronization by this put together code but it's weirdly printing chefs preparing meals before customers even ordering? can i have help on the code or be given resources how to fix it atleast? this is the output for reference ```[Arrival] Customer 4 arrives. [Arrival] Customer 2 arrives. [Seating] Customer 4 is seated. [Arrival] Customer 1 arrives. [Seating] Customer 1 is seated....

My file reader and Writer not working.

I not sure what i am doing wrong and why it is not work but i have implemented both writer and reader classes
No description

Gradle failed at start of project

I'm very new to mod development and I had this error when I start a new mod in intellij... the gradle build fails at the first few seconds saying it could not resolve a dependency in the gradle
No description

I'm at the class making GradeComputation in Netbeans

and I am so confused about this code right now import java.util.Scanner; public class GradeComputation {...

Game Collaboration/Redirects Issue

Anyone interested in collaborating on a browser game? The structure of it has been completed and the base backend and frontend is already coded. I'm having some issues with my routing/redirects. There is a GitHub and everything. I just could really use a hand and I'm willing to give a share of 50/50...

JFrame action listener

Hi everyone, I haven't got sample code or anything but I'm just wondering how I could get a button to read a file when clicked. Thanks...

MYSQL Connector Driver Issue

Hi, I'm trying to implement an sql database, but I'm only getting the "No suitable driver found", anyone knows why it could be? implementation group: 'com.mysql', name: 'mysql-connector-j', version: '9.1.0' Caused by: java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/name?user=user&password=password...

printing area's of an array on different lines depending on section

so, I've been trying to figure out how to write different parts of an array out to different lines of a txt file for a project that i've been working on. I have tried multiple methods but it usually writes all of the info to one line. I am hoping to print out the different parts of the array without going in and writing out every single variable of the array that I want to have on each line. I can provide the code if needbe to make things easier.

how do I generate POJOs from XSD without XML annotations?

I need to generate a JSON schema within Java application and I've come across few maven plugins which create JSON schema strings from Java classes. Our code has generated .java classes but they're all generated from XSD using jaxb but with annotations like @XmlElement and using these classes might not yield proper JSON schema. Removing them programmatically using regex and all seems error prone. I want to generate plain and simple POJOs from XSD without any annotations so that they can be used for generating JSON schema. ...

how to properly config my application logging?

hey guys. i have java spring app. and on the server its running as a service. heres my application123.service: ``` [Unit] Description=application123 After=syslog.target...

Setting up maven build cache extension

Hey, I just discovered the maven build cache extension, so I wanted to give it a whirl. I made a somewhat simple project and it worked great, until I added the maven dependency plugin in my pom to copy over the built artifact into a different folder, if I remove the maven dependency plugin the build cache works properly. Any ideas? version info: Java: Jetbrains Runtime JDK 21.0.5 Maven: 3.9.9...

Hi, could someone help me respect this error? It's haunting me

Cannot run program "C:\Users\Feijoada.jdks\corretto-1.8.0_432\bin\java.exe" (in directory "C:\Program Files\JetBrains\IntelliJ IDEA 2024.2.3\bin"): CreateProcess error=2, The system cannot find the file specified

Selection Sort

Can anyone help me make this test pass? ```@Test public void testMaxPositionMiddle() { int[] x = {1, 5, 3, 7, 8, 9};...

Starting a RSPS for me and my friends

Hey i have a source and client downloaded i just need help starting up the RSPS anyone have any experience in the scene that can help me and my friends mess around on it

Gradle, Ebean: Service loader didn't find a SpiContainerFactory?

Hey, I'm having a problem with Ebean at the moment and hope someone here is able to help. It's the first time I'm using Gradle and the first time I'm using Ebean in private, so sorry if there's any obvious mistakes. This is the config I had using the "Getting Started" documentation: ```...

How to 'persist' lists of object inside an object?

This is how I do it but it doesn't seem to work. It keeps on printing 0. If you have any ideas pls help :)
No description