I’m working on java, i have an excel file named “file.xlsx” that i want to convert to pdf using Spire.XLS , this is the code i wrote for that : The pdf file is generated but with a signature : Evaluation Warning : The document was created with Spire.XLS for Java , i’m wondering about h…
Tag: java
How to return a ManyToOne Bidirectional JPA Entity Object in response of a Spring RestController?
I have 2 entities User and Authority having bidirectional Many-To-One relationship b/w them. But when I send the User object as a response from the RestController, I get nested objects ie. User{Authority{User{Authority{User{Authority{..}}}}}} How can I achieve that the controller must return only? User{Author…
Why is Spring telling me the controller is an unknown entity upon saving a user?
After a few hours of running against the wall with this code, I’ve just about had it. This error is as indescriptive as can be. My User entity: https://pastebin.com/fqRJmMCc TicketController controller with just the function that holds user info: https://pastebin.com/n7jeciAM User service and repository…
Android NowPlaying MediaSession Lock Screen (Samsung)
I’m working on a Audio app based on ExoPlayer, I have implemented the MediaSession controls for a NowPlaying bar in Notification Center and Lock Screen. The NowPlaying bar in the Notification Center is working on every phone, but on some Samsung phones (Android 11) the NowPlaying bar is not visible on t…
Intellij cannot see the path /usr/share/java
I’m trying to set up the mysql-connector to work with intellij on my Pop OS. I know it is located on /usr/share/java but when I go in “Select Library Files” to search for it, the ide cannot find this path. Any suggestions? Answer Snap/flatpack packaging systems are limiting IDE access to cer…
argument mismatch; invalid functional descriptor for lambda expression
I am using the jdbi library like so: This try catch pattern is repeated a few times, with various different queries passed to the jdbi.withHandle method. Another example: The jdbi.withHandle method has this signature: I am trying to find a way to reduce the duplication around the try-catch, so that I can use …
2d double array to image
I’m currently working on a simulation with continuous agents, which leave a pheromone trail on a 2d double array. The pheromone trails need to be on a 2d array because of a diffusion with a mean filter that needs to be performed. Ultimately, I need to visualise the agents and the pheromone trails, by tr…
JavaFX .JAR file won’t run on ubuntu 20.04 from terminal
I’m trying to build my javafx program into a .jar file. The program runs fine when i’m running it from intelliJ but won’t run from .jar file. I’m using intelliJ with java11 and javafx version 11. I followed all the instructions correctly to build the project into a .jar file but when i…
the declared package does not match the expected package
I have imported a maven project from git. As the sources were not seen I add the src directories as sources. Maven compiles correctly. But In Eclipse I have the error. Tthe declared package com.mypackage does not match the expected package src.main.java.com.mypackage I have another error when updating import …
What is the correct SQLException / spring data exception for missing permissions
I just noticed that when you try to execute a query that does not have required permissions (only tested on a mysql 5.7 database using the mysql-connector-java v8 driver) it is translated to a org.springframework.jdbc.BadSqlGrammarException. This is because the mysql driver itself throws a java.sql.SQLSyntaxE…