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

Spring Boot Cache - Cannot Get the value

Here is my application yaml file ``` exchange-api: cache-name: exchanges cache-ttl: 10000 # 10 seconds...

Anyone can help with ktor?

I'm trying to implement kompendium for openapi autogeneration (https://github.com/bkbnio/kompendium) I have done same thing as in docs ```kt fun Routing.userRouting() {...
No description

convert n-tree to dictionary based on depth

```java public Map<Integer, List<Integer>> toDict() {
Map<Integer, List<Integer>> dict = new HashMap<>(); Queue<Node> queue = new LinkedList<>();...

JavaParser help

Does anyone know how to return the index of character starting a token?

isometric tile setup

i have a 2D array of tiles, and each tile is 32x32 pixels. ```java public void toIso(){ int newX = x+y; int newY = (int) (0.5*(y-x));...
No description

how to validate three similar objects that come into my controller?

hey guys. i have an api with 3 endpoints. each endpoint reveices the same DTO object. but the values vary. 1st endpoint receives object with these fields: transactionId, clientId, amount, signature 2nd endpoint receives object with these fields: transactionId, amount, signature 3rd endpoint: transactionId, signature ...

formulate JPA method to update column

hey guys. i have a question about java spring. i have a DB table and a repository in my code. in my service i want to find a DB row/record by transactionId, and change record's status column/field value. i was thinking about boolean updateSalesOrderByTransactionId(@Param("transactionId")); but i dont know how to say that i want to update status column? can smb help me out? thanks

Converting library to maven package

Hi, I need to write Software for a piece of Hardware that has an sdk that's not available as a maven package. I would like to supply that library internally as a maven package, so it can be used without messing with library path and other things. But I don't know enough to do that. I will write a wrapper for the sdk, that makes it more convenient and comfortable to use overall. So a would be developer should not be interacting with the sdk directly. And I will implement our internal coding guidelines on that wraooer....

Thymeleaf / Loading image from DTO

Hello guys, I'm trying to make a profile manager for any user that is successfully identified, I can render every user datas in my template except for my image, in my inspector it says the image can't load The image comes from my DTO and it's persisted in my database and I have implemented my getters and setters properly but I still don't know why it doesn't work. In my browser it obviously shows Image de profil ...

how to fix my WSDL file for SOAP service?

hey guys. can smb help me out with WSDL file? im working on a SOAP webservice, and as i understand, there are some issues with my WSDL file. this is my file: https://pastecode.io/s/c78xizki and i have these questions 1. why theres wsdl: before message, part or any other tag? 2. why there are so many xmlnss? i.e. xmlns:soap, xmlns:s, xmlns:wsdl, etc? i feel that theres too much duplication 3. what does documentation tag even mean? how does it even work? google says The documentation element is used to enter text comments in a schema. but i dont have any schema tags??? 4. what to us for soapAction attribute? what value should it have? ...

i keep getting error "Attribute value must be constant". can smb help me out?

hey guys. i have this: ```java @Endpoint public class MyEndpoint { ...

JWT Authentication with SpringBoot

So it gives me a successful token, but when I use it for authorized pages, I get a 403, Access denied on the backend

Weird class cast behavior

So I have this code: ```java class SearcherAllocator extends SearcherBase.Pointer_Alloc{ @Override public Pointer call(){...

Funny thing happening in JavaFX

i have this code... its ok, but for some reason, everytime i loop through the copy of array, one element from par is removed, any idea why?...
No description

Publishing to Maven Central Repository

Anybody here already released an open source project in Maven Central repository? I've trying to release my open source project (https://github.com/psycotrompus/sql-stringbuilder-dsl) to help generate SQL statements using a custom DSL. I think I've already configured the project's pom.xml file according to their recommendations, but I'm still getting 401 response when uploading the artifacts....

Repositioning objects to stay in the same position relative to each other when rotated.

I have a grid of cubes, and currently when the rotation of a cube is requested it adds it with the rotation of it's grid. While this does keep the rotation of all objects in the grid synced, it does not reposition them to upkeep the illusion of them being one solid object. I'd imagine the solution would be as simple as also modifying the position of each cube based on the grid rotation, but I need some help figuring out what mathematical calculation would be needed....
No description

how do I read source code, and is it possible to learn java from reading source code?

I have some ideas for porting mods, and I don't exactly have a firm grasp on java (yet) and wanted to ask for some basic guidelines on how to read source code

how to create SOAP webservice?

hey guys. i need to code soap webservice. i was wondering if you could help me out with a couple of questions? 1. i have these dependencies in my gradle file. do ineed smth more? ``` dependencies { xsd2java "com.sun.xml.bind:jaxb-xjc:2.2.6"...

java 17 obfuscator

please advise java 17 obfuscator