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

Pushing Java Code

Can someone tell me how can i push my code to my github using Ecplise IDE ? Bcz last time when i did it myself i really got into the big problem .

DTO

Can anyone help me to create DTO for this classes and also explain me why we use DTO more ```package com.ShelfSpace.ShelfSpace.model; import java.util.List; import jakarta.persistence.Column;...

Spring Security

I wanna Config The Spring Config class but due to changemnet in version i am not able to do it . Can anyone Help ```package com.ShelfSpace.ShelfSpace.Config; import org.springframework.context.annotation.Configuration; import org.springframework.security.config.annotation.web.builders.HttpSecurity;...

Use a Class for a generic type?

is there a way to for example do
String clazz = "java.lang.String";
List<Class.forName(clazz)> list = new List<>();
String clazz = "java.lang.String";
List<Class.forName(clazz)> list = new List<>();
In case this is xy problem: I have a class called DataObject for storing some extra data on things, and it has a generic type for what type of data it's storing. There's another class called DataMap that takes its own generic type and extends DataObject with a HashMap<DataObject<T>, DataObject<?>>. I'm then serializing it to json with gson as my method of storing it in a file, but I need a custom deserializer for it, and I'm getting errors for it not being able to convert HashMap<DataObject<?>, DataObject<?>> to HashMap<DataObject<T>, DataObject<T>>. Storing the class name in the json is my current idea for a workaround....

InvocationTargetException using JCI

I try to run a simple main to compile(!) some java code. This is my pom: ```<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelVersion>4.0.0</modelVersion>...

Data Structure And Algorithms

I wanna start Data Structure And Algorithms So can anyone Suggests me a good Data Structure And Algorithms Course ?

Maven semantic versioning

Hi, I would like to implement the following semantic version ING scheme for my company in a maven parent or archetype. M.m.R.P-B M: Major Version...

JSON RESPONSE ERROR

I dont know why whenever i am adding data to my RestApi i am getting double json response of book class here is the response ->

how to make airpod like system

How can I go about making a software that can track the direction of hardware? And how would I program the hardware to send it's location to the software?

Jackson ignores private fields

```java class POJO { private int i;
@JsonIgnore ...

Spring Security Filters

When we need to make our own custom filter chain in spring security and what's actually it's use case ?

Recommendation to store permissions

Hi people i would like advices regarding what's the best way to store permissions without ending with a HUGE table in db and having java to properly handle them. I was thinking on using a maybe numeric value, 1 read, 2 write, 4 delete where a value of 5 means it has delete and read value, a value of 6 read write and deleted and such. But i really don't know if there is any other/recommended way. Regards. :PES3_Wave:...

Spring Security

I want to learn about spring security but I don't know anything about it so can anyone tells me that how much I have to learn it to authenticate my login page and can also add the Google and other outh services in it and can also make my api secure ?

Implementing async file watching

using this doc page: https://docs.oracle.com/javase/tutorial/essential/io/notification.html what would be recommended way of doing it asynchronously? do i just setup some sort of exeuctor or thread?? im not very skilled in parallel stuff...

Hibernate Mapping

I want to map two entities with one to many relationships and want to add the data together. Then how to do it ? Can anyone suggest !

Hibernate is Not Creating Tables

I am trying to create Table Via Hibernate But its not creating anything here is my class https://sourceb.in/TZTKrP7UL4...

Spring JPA Error

I am getting a error like this ->
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shelfBookController': Unsatisfied dependency expressed through field 'repository': Error creating bean with name 'userRepository' defined in com.ShelfSpace.ShelfSpace.repository.UserRepository defined in @EnableJpaRepositories declared on ShelfSpaceApplication: Not a managed type: class com.ShelfSpace.ShelfSpace.model.UserDto
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:787) ~[spring-beans-6.1.10.jar:6.1.10]
org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'shelfBookController': Unsatisfied dependency expressed through field 'repository': Error creating bean with name 'userRepository' defined in com.ShelfSpace.ShelfSpace.repository.UserRepository defined in @EnableJpaRepositories declared on ShelfSpaceApplication: Not a managed type: class com.ShelfSpace.ShelfSpace.model.UserDto
at org.springframework.beans.factory.annotation.AutowiredAnnotationBeanPostProcessor$AutowiredFieldElement.resolveFieldValue(AutowiredAnnotationBeanPostProcessor.java:787) ~[spring-beans-6.1.10.jar:6.1.10]
When i am trying to ``` @GetMapping("/register") public String registerPage(Model model) {...

Jackson Json overwrites json values when reading from it

having this code snippet and that json, the json have 3 values set to null after running the code snippet and i have no idea why
No description

Spring Boot Error

I am not able to access the /endpoints of my app instead i am getting this error -> ```Whitelabel Error Page This application has no explicit mapping for /error, so you are seeing this as a fallback. ...
No description