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

exception handling in SOAP webservices

hey guys. i have a question about SOAP webservice. i have this piece of code in my service layer: ```java Optional<Customer> customer=customerRepository.findById(Long.valueOf(perlasIdCheckRequestDTO.getUserId())); if (customer.isEmpty()) {...

SOAP service returns 404

hi guys. im developing SOAP web service. but when i call it with SOAP UI, i get ``` HTTP/1.1 404 X-Content-Type-Options: nosniff X-XSS-Protection: 1; mode=block...

Any ideas how to render images in console?

Im writing cli application and was kinda inspired of super file It can preview images in fs (example is bellow) So, i decided to implement smth similar Any libs for that?...
No description

trying to get an array of every pixel of an image, why is it not working???

```java File img = new File("daisy.png"); BufferedImage buffImg = new BufferedImage(570, 760, BufferedImage.TYPE_INT_ARGB); try { ...

io.ktor.http.BadContentTypeFormatException: Bad Content-Type format: content-type: application/json

For some reason calling response.contentType() causes this exception ```kotlin class ErrorUI (private val response: HttpResponse) { init {...

Huge WSDL produce a jdk.internal.org.objectweb.asm.MethodTooLargeException

There is a wsdl that is huge. https://raw.githubusercontent.com/attester/virtualbox-soap/master/sdk-files/vboxweb.wsdl The wsdl has a portType (vboxPortType) having about 10.000 lines of code. The wsdl generate a java-interface (org.virtualbox.service.VboxPortType) having 35k lines / 1800 methods. This is the stacktrace: ```Exception in thread "Thread-6" jdk.internal.org.objectweb.asm.MethodTooLargeException: Method too large: jdk/proxy3/$Proxy555.<clinit> ()V at java.base/jdk.internal.org.objectweb.asm.MethodWriter.computeMethodInfoSize(MethodWriter.java:2120)...

Getting 500 error instead of 400 and 409

I am tryna handle the erros in the Api and Return the Exception according to the need as u can see in the code but i am not getting proper errors as i return them ! ``` @Override public Optional<BooksDetails> addBooks(BooksDetailsDto booksDetailsDto, Long roll_no) {...

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 { ...