Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

We are a Community full of Java developers. Connect with other devs, get help, help others and do much more!

Join

java-help

❓︱qotw-answers

Best modern resources for new Sprint Boot project

Can anyone share their favorite resources on: 1. adding integration tests and setting up tests/mocks for a new Spring Boot 3 project 2. Understand more and any changes around spring context 3. Any new logging features/recss...

help with opening an Http server with java

I am currently opening an http server in an xml file I'm using version 2.17.2 arch type: maven-archetype-quickstart, and when I'm writing "import com.fasterxml.jackson.databind.ObjectMapper;" it responds by error "Cannot resolve symbol 'fasterxml'" can someone help?...

problem here

this method aint working how its supposed to. It works for most cases, but not all for some reason. also not for -+ and -- max value what ever that shoudl mean. The following test cases are failing (also i cant use if statements, dont ask why :/): Test Case · decryptFloat - RandomPositives failed Some positive values seem to produce wrong number triplets ...

Parabola elements calculator

so, im trying to write a program what would calculate the direction of opening, vertex, y intercept, zeros, and vertex form of the equation. how would I go about doing that?

what would relative path be if im building a maven library that will create a txt file and read/writ

How would i tell the library where the path is? would the depencyy folder change based on if its gradle or not? too many things to think about.

SonarQube not finding junit xml files.

I know this isnt strictly java related but since i am using junit ad java within sonarcube i thought id ask: in my sonar-project.properties file i have set the xml file destination as follows: sonar.junit.reportPaths=./testreports/*.xml...

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...