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

Spring security returning 401 with requestmatchers permitAll

When i try registering a new user it only works if i pass credentials of an user that is already registered through basic auth. If i try passing a register user request without auth it returns 401. security config: ```java...

Spring security: get user from implementation of UserDetails from Authorization

Im trying to extract the user of a request through the Authorization object. this is my implementation of UserDetails: ```java...

can request be validated before reaching the controller?

hey guys. im talking with a friend of mine and he mentioned that in php language you usually validate the data BEFORE it reaches the controller. i was wondering if this can be done in Java Spring app? as i understand this idea cant be done in Java Spring app. the controller in Spring app is the entry point to the application. and you cant really do much in Dispatcher servlet. what do you guys think? thanks in advance.

Can not open .Jar

So im trying to open a .jar file to make a minecraft server for me and my friends but when i got in to cmd and put in java -jar Server.jar i keep getting Error: Unable to access jarfile Server.jar.

im a begginer in java and im trynna make a mod in mc with intelj

i get this error when i run runClient Build file 'C:\MyModProject\build.gradle' line: 156 Could not determine the dependencies of task ':classes'....

Performance & Readability Improvements

I do have quite big classes, I wanted to break them down into smaller classes but i entered issues while doing that. My goal is better readability, equal performance compared to now when all modules enabled and better performance than now when all modules disabled. Im trying to avoid class loading,initialisation and registration of handlers that arent needed aswell as them registrated multiple times. For example if i have a field that controls whether a module is going to be loaded or not, but the field also needed for a module and changing during runtime, then i have basically one part of the module i the class that refers execution to modules and one part in the module class, which doesnt look good. Also if i have smaller classes i need more total time to load these and they consume more file size and metaspace memory? I also noticed if i load on demand that i will get minor lag spikes. If i though keep them in big classes then i will have the best performance when everything is used and loaded but bad performance when only a fraction is enabled....

Roles & SecurityConfig

Hello so i have 3 roles ```java public enum Role { ADMIN, STAFF,...

Javafx Not importing

i have tried to follow yt but i thing i have done something wrong. the code is from GPT and i need it for my clg project. Is anyone willing to help?
No description

keyloack backchannel communicate in bff architect

how i can update keyloack from 24 to 26 , maybe KC_HOSTNAME_URL not avaiable in version 26 ```keycloak: container_name: lamapuz-bff.auth image: quay.io/keycloak/keycloak:24.0.0 command: - start-dev...

question about Java

I am reading that when Java was first introduced, the developers and designers anticipated that Java GUI programming would be the most predominant form of Java programming, even eclipsing other forms of windows programming (such as C++ and toolkits). What are some reasons for why this did not happen?

VS Code not executing program

I'm trying to run a simple program (no errors with the code itself) but whenever I go to run the program I get this error.
No description

Ayuden, por favor

¿Qué medidas de seguridad se deben implementar para proteger los datos de los usuarios?

Ayuden, por favor

¿Qué medidas de seguridad se deben implementar para proteger los datos de los usuarios?

Websocket Postman

I just wanted to check if someone notice anything wrong in my code. Basically, what I want to do is that when a new user registers, I want the admins to be notified with "New user has been registered", but I want to do it in real-time using WebSocket. I'm testing my WebSocket URL ws://localhost:8080/ws, and I successfully connect to it. I also subscribe to the destination: ```SUBSCRIBE...

instance

```public class CooldownManager { private final Map<UUID, Instant> map = new HashMap<>(); // Set cooldown public void setCooldown(UUID key, Duration duration) {...

JDBC

I already make the conecction to Firebird and add a singleton , i made the graphic interface with CRUD functions but I can execute one function for example list, and the "This connection is closed and cannot be used now." appear , i need help plz i have like 1 day to finish

Can I read a section of yaml without spring ?

I have a yaml file with say 3 properties sections A,B,C . I wanted to know if I can load a section only like B in in variable map of properties() . Parse will do for whole yaml, and not sure on spring . Manual map feels troublesome...

The collection of metamodel types is empty

I'm have a maven project with JPA and EclipseLink. When I run it don't generate the tables in the database. I have this output:
The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element
The collection of metamodel types is empty. Model classes may not have been found during entity search for Java SE and some Java EE container managed persistence units. Please verify that your entity classes are referenced in persistence.xml using either <class> elements or a global <exclude-unlisted-classes>false</exclude-unlisted-classes> element
...

cant install LWJGL

i get the error: Error occurred during initialization of boot layer java.lang.module.FindException: Module LWJGL_3_Tutorial not found i have added the lwjgl to my project but i still cant run my project...