Category "java"

DetachCriteria paginated query returns duplicate values

I've got a paginated detached criteria execution which return rows of an entity. The entity class is as following. @Entity @Table(name="POS_T_HTL_ITEM_GROUP")

java URL working on browser but not in client program

Client JAVA Program part : try { String downloadUrl1="https://www......&downloaded=1";

Detecting out of memory errors

I would like to provide my system with a way of detecting whether out of memory exception has occurred or not. The aim for this exercise is to expose this flag

What file extensions can be created/written with Java's Writer write() method?

I have a question about Java streams but I can't seem to find the answer in the documentation: What file formats or extensions can be written with java.io FileW

JetBrains IntelliJ Error launching Intellij Platform - Error invoking main method

I have IntelliJ IDEA and other JetBrains products installed and they worked great (PyCharm, Android Studio, Clion, WebStorm) till today, now I just get opening

Display errors in JUnit failure trace

I use Selenium Web Driver in Eclipse with JUnit. I need create simple checking if some text exists on the page - if it is, than I need generate error. I want th

Spring cloud function in azure throws null pointer exception

I have spring cloud function deployed to azure function app.The API works perfectly fine in the local developer machine. Whereas when deployed to azure, upon ca

JNativeHook Post a native key event

I tried to post a new native key pressing to the system using the java library https://github.com/kwhat/jnativehook. The method GlobalScreen.postNativeEvent()

Getting the list of softwares installed using Java on a computer

How can one get a list of installed software and its version in Java?

ArrayList equality in junit not working although expected and actual are similar

I am using below test method to check whether the Arraylist is sorted as expected. @Test void compareFields() { Assignment14 assignment14 = new Assi

Spring MVC request and response flow explanation

I can't find correct client request flow in below syntax.Could someone please clarify what is happening here? Client(1) --> Dispatcher Servlet(2) --> Han

How can I answer to callback in Java telegram bot?

I'm writing a Java bot with https://github.com/rubenlagus/TelegramBots, and I have a problem, when I click inline keyboard button, this little clock: appears an

Why cant I make an enum's inner class public?

Testing some things out I tried o make an enum in which every one element in a enum have a different class inside. Take for example: public enum MyEnum { f

How to separate range of integers into two equal parts

I have an array of integers like this one int [] num = {5, 8, 1, 1, 2, 3, 2} and I want to divide it into 2 parts, so that the total of 2 sets will be as equ

How to compare the elements of an ArrayList with every element of another ArrayList using Stream API of Java 8?

I have two Sorted ArrayList of same size, namely team_A & team_B, in which comparing every element of team_A with team_B to find the powerDiff > 0. After

Open a JPanel after pressing a button in a JFrame [duplicate]

I know this question has been asked, but I failed to find a solution. I created a JFrame for Login and I want after the button "Cont Nou" is

How to use Jacoco plugin along with JVM test suites plugin in Gradle?

We have a java project which is using gradle build tool. We are using jacoco plugin to generate test coverage report. Later we have added test suites using JVM

no mssql-jdbc_auth-8.2.1.x64 in java.library.path

I'm trying to connect to SQL DB in my Maven project, but keep getting following exception: "com.microsoft.sqlserver.jdbc.SQLServerException: This driver is no

Finding child element while having parent element

There is an element having various children. How can I count the number of its children using parents' xpath? So far, I have been using this: List<Webeleme

What is meant by k-anonymity and l-diversity, and what is difference between them? [closed]

What is meant by k-anonymity and l-diversity, and what is difference between them? This concept is used in the following IEEE paper.