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

got 403 forbidden, can't pass the SecurityFilterChain

So, I am try to hardcoded information on UserDetails to get know how it will pass the authentication by validating if it has "USER" role. but when I try to make request to it I got 403 forbidden.
No description

Spring Boot with Kubernetes Issue

Here is the link : https://github.com/Rapter1990/todowithcouchbase/pull/28 todowithcouchbase -> container "todowithcouchbase" in pod "todowithcouchbase-6c49dcd7f7-jjf2x" is waiting to start: trying and failing to pull image (Here is the image location : https://hub.docker.com/repository/docker/noyandocker/todowithcouchbase/general) Can you help me for my Kubernetes issue ?...
No description

Making an object that can be various types?

I have a byte[] and a short[] used for the same thing. I want to switch from using the byte[] and short[] based on the maximum value needed, which changes occasionally. My idea is to have an Object that is swapped between referencing the byte[] or the short[] as needed. The part I can't figure out is casting the Object to the array type its referencing. I tried this to alter the contents of the array the object is referencing: ```java...

Does anyone know how to solve it?

C:\Users\loots.jdks\corretto-1.8.0_432\bin\java.exe -Dmaven.multiModuleProjectDirectory=C:\Users\loots\Desktop\saprrmrm -Djansi.passthrough=true "-Dmaven.home=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3" "-Dclassworlds.conf=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\bin\m2.conf" "-Dmaven.ext.class.path=C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven-event-listener.jar" "-javaagent:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\lib\idea_rt.jar=65213:C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\bin" -Dfile.encoding=UTF-8 -classpath "C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\boot\plexus-classworlds-2.8.0.jar;C:\Program Files\JetBrains\IntelliJ IDEA 2024.3.1\plugins\maven\lib\maven3\boot\plexus-classworlds.license" org.codehaus.classworlds.Launcher -Didea.version=2024.3.1 install [INFO] Scanning for projects... Downloading from viaversion-repo: https://repo.viaversion.com/org/github/battlecraft/battlecraft-parent/1.0.0-SNAPSHOT/maven-metadata.xml Downloading from viaversion-repo: https://repo.viaversion.com/org/github/battlecraft/battlecraft-parent/1.0.0-SNAPSHOT/battlecraft-parent-1.0.0-SNAPSHOT.pom [ERROR] [ERROR] Some problems were encountered while processing the POMs:...

Transforming the Springboot Postgres to MySQL having some serious issues.

Thing is I use PostGIS spatial data, here I have to figure it out. The error is confusing, the tables have been created...

java basics help

For this example: ``` public class Animal { public void makeSound (){...

Minecraft plugin that displays text above a player's head

I have the queue, display, and deletion working, the only issue is that there can be multiple ArmorStands/Messages at once, regardless of the fact that I have a Map associating a single armor stand with a player. When the display function is called, it checks if there is an associated armor stand, and deletes it (before i get queue working, i want there to be one message displayed at a time) ``` public final Map<Player, ArmorStand> playerArmorStand = new HashMap<>(); ...

Spring Boot Web page is not loading correctly

In first image, you can see the web page of login once you start the app. In the second image, you can see the correct web page. The HTML, CSS, etc, is made in Bootstrap Studio...
No description

why does a space " " seem to break a if(scanner.next().equals(answers[i])){

how do i make it not break with a two word answer i tested putting in numbers single words and even connecting words using a "-" instead of a space and they all work but as soon as a space goes into the answers[0] = " " it wont continue...

Am I using the wrong loop or the loop wrong

I'm using java 17 and here's my loop the 'for' is there to print out the 'i' question then i want the 'while' loop to let you type out guesses until you get the correct answer...

java: cannot find symbol symbol: method builder()

before you ask, I've already enabled annotation processing in my spring boot project. I don't really know what else I can do

Best Design Approach

So im making an API for a marketplace and i have different kinds of listings (footwear, clothes and accessories) where the enum attributes "subcategory" and "size" would change based on what kind of listing it is, what would be the best design approach for creating these listings? inheritance? factory? Thanks

N+1 Hibernate.

I've got problem with fetching data. Here is my code: @NoArgsConstructor @AllArgsConstructor @Getter @Setter...

i have a problem understanding nested for loops

```for (int i = 1; i <= 5; i++) { for (int j = 1; j <= i; j++) { System.out.print("*"); } System.out.println();...

Increasing max stack size

Trying to increase the max stack size, but when I do it said it "Could not find or load main class org.conspiracraft.game.Main"
No description

How to switch a JavaFXML project from JDK 22 to Java SE 8?

I have imported a project on NetBeans to analyze but all the classes come out as errors and such. The best Java version I can use is Java SE 8 which has JavaFX 8, but I don't know how to switch the platform for the project. I already installed OpenJDK 8u432 but the IDE can't recognize it to have JavaFX 8. Any help on that?
No description

unable to import Gson java dependency to my Maven JavaFXML Project

I have imported a code for a Maven JavaFXML Project and can't add a Gson jar file to my project. it is a required dependency and right clicking the Java Dependency folder doesn't have any options to offer. I have installed the Gson jar file for use and I just need to add it to the project. Ignore the Gson in the 'Dependencies' folder as it was a solution that didn't help.
No description

Type Handler Issue in MyBatis of Spring Boot

I have a problem about Type Handler Issue in MyBatis of Spring Boot. How can I fix it?

Unable to build a JavaFX code on NetBeans 17

I have installed and used JavaFX 21 on NetBeans 17 and wrote simple coding to build an interface. I ran the program but gave me an error saying that the program failed to build. My initial thought was that the versions are included in JavaFX 21 but I have my doubts. Someone recommended that I work with JavaFX 8 but I couldn't find a source to download it from. Either helping me to solve the error or to install JavaFX 8 would be appreciated.
No description