Java Community | Help. Code. Learn.

JCH

Java Community | Help. Code. Learn.

We are a Community full of Java developers. You can come here to connect other devs, get help, help others and do many more things!

Join

java-help

❓︱qotw-answers

Oauth2 client

Is this behavior normal? after login success and token exchange , client removed session and i have to login again...
No description

SPRING SECURITY

hi guys, ive just started learning about spring securit and i have some question about it. i just add 2 type of authentication regular auth (email + password) and oauth that return a JWT, my problem is those authentication cant be use at the same time, i have to add @Order(1) for specify which auth will be used, even after i changed the api route to be different each others. are there any suggestions for my case? or even is it possible to implement this approach? because i've implemented that...

Thymleaf Templates.

I have been trying to use a base template for most of my pages for more consistent styling and to allow for multiple design changes to be possible globally without having to add 1 new thing to each page. essentially my goal is to have a page and let the content page extend it. meaning it only changes barely anything instead of pulling each thing in separately. html will be attached in following messages....
No description

two sum solution in java

plz help just a beginner
No description

Spring XML Configuration Error:The processing instruction target matching '[xX][mM][lL]' not allowed

I'm working on a Spring application and encountering an error when trying to load my application context from an XML configuration file. The error message is as follows: Exception in thread "main" org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException: Line 3 in XML document from class path resource [in/sp/resources/applicationContext.xml] is invalid Caused by: org.xml.sax.SAXParseException; lineNumber: 3; columnNumber: 6; The processing instruction target matching "[xX][mM][lL]" is not allowed. Here is the relevant part of my applicationContext.xml file:...
No description

Help for education

I hope this message finds you well. I am reaching out to you with a sincere heart, hoping for your support in my journey towards education and a better future.
Life in Lebanon has become increasingly difficult, and despite my efforts, I have faced many obstacles in continuing my studies. Unfortunately, I have already lost a year trying to find a way to fund my education, but the financial burden remains overwhelming. My dream is to complete my university education and, if possible, find an opportunity to travel where I can build a better future for myself and my family.
Any support, whether through a donation, a loan, or guidance on how to find financial aid, would mean the world to me. Even the smallest contribution would bring me one step closer to achieving my dreams. ...

How to use an auto-generating id and composite key for same entity using @IdClass?

I created a composite key using @IdClass that I want to specify that those fields make the unique key fo the record. However, I also want to add an auto-generating id (sequence generator). Is it possible to have the auto-incrementing id separate from the composite key? I used @Id for both in my entity and it's complaing id (sequence auto-gen) is not part of the composite key. Is it okay to define in composite key then but not use it for finding and matching records that is inclusive of that id?

JavaFX runtime error

Ive tried to fix it using google but the seps i tried didnt work
No description

spring security with OAuth

hi guys, ive just started learning about spring securit and i have some question about it. i just add 2 type of authentication regular auth (email + password) and oauth that return a JWT, my problem is those authentication cant be use at the same time, i have to add @Order(1) for specify which auth will be used, even after i changed the api route to be different each others. are there any suggestions for my case? or even is it possible to implement this approach? because i've implemented that...

Best entity relationship approach

Im storing transactions in my application that consist of a sender and a receiver, this is my entity class for it: ```java @Id @GeneratedValue(strategy = GenerationType.AUTO)...

My game crash when i run my mincraft mod

public class ArnorMod implements ModInitializer { public static final String MODID = "armorermod"; @Override public void onInitialize() {...

(ASM) Stack Map Frames

Any good resource recomendations on getting a better grasp on manually computing stack Map frames? Asm docs don't seem to be informatively clear, rather assume you already understand them, and the jvm docs didn't help much either. I understand their purpose, for verification of type safety so the jvm doesn't have to simulate execution any more like it did prior to Java 7. I understand it's used to track locals through control flow....

Error related to arguments in a method

so i'm getting this error java compiler: method readMessages in class Main cannot be applied to given types; required: no arguments found: java.lang.String,Message[] reason: actual and formal argument lists differ in length but i my readMessages method doesn't require any arguments...

1.8.9 Forge modding help with mixins

I am trying to add mixins to my build.gradle but it says it cannot find org.spongepowered:mixin:0.7.11. If anyone can help me with this issue that would be great

Intellij Idea bug

Hello, currently I am working on a big project, I was on vscode but I just switched to Intellij Idea Ultimate however I found several errors: I'm on WSL and Docker in a project with DevContainer, I often have problems with "Host is unresponsive", Dump Threads, and others which create lag. Then I notice that I cannot build my pom.xml from the IDE, no problem, I do it in cmd but I notice that all the packages are found except Lombok. I tried to clean install but nothing changes....

github repo deleted. Now cloning local to a new remote repo

My current git repo has all the commits and branches and whatever that was done in the repo. Although the remote repo somehow got deleted long back. I now want to push the current repo to a new remote as it is. I created this repo to learn git so I made sure that all the commits and branches are also present in the remote back then. Now I wanna do it again. I am trying to understand reflogs of the repo so that I can compare what will go and what will not. Here are the reflogs below. I am stuck at the point that in the 3rd line, there's a branch name mentioned for the commit but only for the remote and not local branch. Can anyone clarify why is that? ```...

I keep getting this error when i try run JDK installer

I tried to uninstall java dk if that has anything to do with it and my visual code wont run my code either
No description

Code Review Request

Hello! Does anyone have a moment to review my code? I have made a very simple project similar to Google Dropbox / the explorer with Spring Boot and Spring Security. Please look over the file structure, as I am trying to follow the Service-Controller-Repo structure. Otherwise please give me suggestions on how I can improve my overall code! Thanks! GITHUB PROJECT LINK: https://github.com/De1ora/FolderAPI...

How can i add discord login

I wanted to add login with discord to my website and im using react in the frontend and spring in the backend, what should be the best way to implement this?

DispatcherServlet Class Not Found Exception Again and Again

I have created a Spring MVC project where I used: jakarta 6.0 and spring-webmvc 6.2 in pom.xml Dynamic Web Module 5 JDK 23 ...