Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!

java

  1. K

    Two different Java objects are always equal regardless of fields value

    I have classes defined like below: @Data @NoArgsConstructor @AllArgsConstructor @SuperBuilder public abstract class A { private Enum myEnum; } @Getter @Setter @NoArgsConstructor @AllArgsConstructor @SuperBuilder public class KA extends A { private MyPackage pck; private String...
  2. Y

    Prevent redirect on form submissions in thymleaf email template

    I have a spring boot application with REST APIs which are working fine. In the same project I have one API to send the email notifications to customers which uses the thymleaf for creating the HTML email template and I need to provide the option of Yes and No button and the customer will click...
  3. A

    How to loop again while there is no input?

    I was hoping you could help me with my java code. Here is the code: public static void main(String[] args) { Scanner in = new Scanner(System.in); ArrayList<String> name = new ArrayList<String>(); ArrayList<String> team = new ArrayList<String>(); ArrayList<String> pos = new...
  4. F

    My unit tests suddenly failed with "ClassNotFound" error

    My code unit tests suddenly failed to run with errors "ClassNotFound". When I ran them in IntelliJ, I got the errors below: java.lang.ExceptionInInitializerError at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at...
  5. R

    How to handle configuration When Spring Boot config server itself is down?

    I'm new to the spring cloud config server. Consider a scenario where we have 10 spring boot microservice fetching configurations from the Spring Boot Cloud Config. I was wondering How the 10 spring boot microservices will work when the Spring Boot Cloud Config itself is down? Can someone answer...
  6. T

    Multiple "And/Or" Condition Expressions spring data jpa

    I want to have a filter query using spring data JPA. condition is something like this: (A or B or C) and D when I want to use Spring Data JPA I should change it to be like below (The precedence order is And then Or, just like Java.): (A and D) or (B and D) or (C and D) the code in the Spring...
  7. M

    Pagination on Native sql query gives : unexpected token: ON

    While writing a pagination query in repository as below code segment, I'm getting following error. @Repository public interface Aaaa extends PagingAndSortingRepository<TxnDealerInventoryItem, Long> { @Query(value = "SELECT EM.PART_NO, EM.PART_NAME FROM TXN_DEALER_INVENTORY_ITEM E INNER...
  8. S

    I built it in Java, but I don't know why there is an error when running the .jar file

    I am implementing mail using pop3, smtp, and imap three protocols, but when I try to build to check and distribute normal operation locally, when I try to jar, when I run jar files, ERROR: A JNI error has occurred. Please check the installation and try again Thread "main" java.An exception...
  9. L

    how to add mysql jdbc connector correctly

    pom.xml DAO I added the connector, which is located in the MySQL folder, to external libraries. I tried to change the connector version, but the result is the same every time. I tried to add mysql-connector-java instead of mysql-connector-j. The test connection to the database is successful.
  10. M

    can we select two elements in dropdown in form of check boxes?

    can we select two elements in dropdown in form of check boxes by using List or any other way. Elements in the dropdown are in the form of check boxes. Thanks in advance. Tried but didn't find the solution.
  11. A

    OptaPlanner Collectors Composition: Need Implementation Guidance

    Consulting OptaPlanner Docs on Constraint Streams, I have been trying to implement a ConstraintCollector to use in a groupBy() call for a constraint stream. I am unable to understand what inputs the collector should take and its outputs. My model is assigning Employees to Shifts. Employees...
  12. G

    How to know if the process has terminated while processing the inputstream and when should I call process.waitFor() or process.exitValue()?

    I am trying to execute commands using Java. So when I try to convert the process Inputstream to string using BufferedReader, the code works if I call process.waitFor() after processing the inputstream to string. But when I try to convert the process input stream using ByteArrayOutputStream to...
  13. S

    JSON parse error: Cannot deserialize value of type `byte[]` from String

    I am developing an Android App with a Java Backend using Spring Data JPA. One of my classes represents a profile image and contains the following field: @Lob @Column(name = "image") private byte[] image; When i invoke the Rest API that saves the above class the JSON request looks like...
Top