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

java 17 obfuscator

please advise java 17 obfuscator

how to call my application that is running on a server?

hey guys. i have a server dev.burokelis.lt, and i have java spring app deployed on it. its running fine, but i dont understand how to call its endpoints. when i was developing on my computer, in postman i used localhost:8080/createPaymentInformation, now whem im trying to call my app thats on a server, i do dev.burokelis.lt:22/createPaymentInformation, but nothing happens in postman. can smb help me out?

chrome driver

im trying to set up a chrome driver all i have to do is put ( chrome-headless-shell-win64 ) into my systems path which i did but when i checked in my cmd prompt to see if it works this came up ( chrome-headless-shell' is not recognized as an internal or external command, operable program or batch file. )

How to make spring boot @Value fields inject the values from properties?

```java @ExtendWith(MockitoExtension.class) @TestPropertySource("classpath:application-test.properties") class AuthServiceTests { ...
No description

Drawing SVG paths in javafx css

any idea why is it still filled? it shouldnt be according to the rendered svg
No description

Exception Handling in Spring

Hey i am getting 500 response code instead of 404 even after handling the exception ```package com.ShelfSpace.ShelfSpace.exception; public class ResourceNotFoundException extends RuntimeException {...

RequestParam / User Not Found

Hello again guys, I'd like to render my data user on a template with the GET method. I made sure my page was created and my datas are persisted in my db. I tried to render my data through the email user as it's shown below and I want my URL to be like this : http://localhost:8080/[email protected] ( which works perfectly if I write this in my browser bar ) but when I want to access to my profile it return me a USer nto found, because Spring boot sees it as null...

Suggest kotlin/java backend framework

I tried ktor, but its documentation is... too difficult I didnt found how to set up cookies, auto documentation and stuff Or im just too dumb for it 😦...

Why/how is displayMap null

I have a class here and it seems like nothing in the constructor is running except the super() call. None of the prints run and when repaint is called it throws an error for displayMap being null. What is wrong?

Issue with multimodule project

I'm trying to publish my project to maven central, but I get this error. ``` Execution failed for task ':api:publishMavenPublicationToMavenCentralRepository'.
Failed to publish publication 'maven' to repository 'mavenCentral' Invalid publication 'maven': multiple artifacts with the identical extension and classifier ('jar', 'javadoc')....

Render dynamic dayas / Status 400

Hello guys, I'm trying to render dynamically my datas from my entity ( the datas are well persisted, there's no problem in the database side ) with thymeleaf an user page once he's authenticated but I have the famous
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jul 24 16:43:43 CEST 2024
There was an unexpected error (type=Bad Request, status=400).
Whitelabel Error Page

This application has no explicit mapping for /error, so you are seeing this as a fallback.
Wed Jul 24 16:43:43 CEST 2024
There was an unexpected error (type=Bad Request, status=400).
...

best way to insert JSON object into DB table?

hey guys. i want to construct a json in my java code and insert it into a DB table. can i just use json in a string and replace needed values?

how to check if record exists in DB table?

hey guys. can smb help me out? in my repo class i have this:
@Query(value = "select count(1) from my_tablewhere transaction_id= :transactionId",nativeQuery = true)
boolean existsByTransactionId(@Param("transactionId") String transactionId);
@Query(value = "select count(1) from my_tablewhere transaction_id= :transactionId",nativeQuery = true)
boolean existsByTransactionId(@Param("transactionId") String transactionId);
...

service deletes DB records, but i still get `No results were returned by the query`

hey guys. can smb help me out? i have this service: ```java public void createPaymentpaymentReversal(PaymentDTO paymentReversalRequest) throws NoEarlierPaymentException { Optional<Payment> earlierPayment=paymentRepository.findByTransactionId(paymentReversalRequest.getTransactionId()); ...

apache Mina sshd

If anyone had expierence with Apache Mina and setting up a ssh server please tell me. I got an issue where my client session are mixxed up if there’s more than 1 of them… (the 2nd user becomes the first) Tell me guys I am tired of posting the code...

How do I use UserDetailsService properly? Where do I define it exactly?

I was going through spring security's docs and found this ```java @Configuration @EnableWebSecurity...

Spring app doesn't read environmental variables from .env

I have .env file in my project root folder along with pom.xml. Contents: ``` APP_PASSWORD=my-app-password DATABASE_PASSWORD=Tomasm21-xi DATABASE_USERNAME=Tomasm21...

RestApi Access Problem

When i try to access the Rest Api from postman then i got the html of login i even permit the enpoint of api ```@RestController @RequestMapping("/api/Student") @CrossOrigin(origins = "http://localhost:3000") public class RestApplication { ...

Spring Boot Security / Request = 500

Hello guys, I'm a beginner here who's trying Spring Boot security. I'm trying to sign in with the httpSecurity but when I do my sign-in request, SPring boot redirects me to the famous ```Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback....

why use Optional<MyClass> if you cant call any methods that MyClass has?

hey guys. can smb explain to me what wrong? im trying to retrieve an object from DB: Optional<Payment> earlierPayment=paymentRepository.findByTransactionIdAndAmount(paymentConfirmationRequest.getTransactionId(), paymentConfirmationRequest.getAmount());. and for some reason i cant call any getters that my Payment entity has. does it mean that id need to change the return type of findByTransactionIdAndAmount from Optional<Payment> to just Payment? and then id loose the advantage Optional gives me. that doesnt make any sense 😦 any help? thanks...