Category "java"

Possible causes of java.io.IOException: CreateProcess error=5

What kind of problem(s) could cause Java's ProcessBuilder.start method to return an IOException with a note saying error=5? Specifically, we've seen a remote c

How to upload files using JDK 11 java.net.http.HttpClient?

I recently encountered some problems with java.net.http.HttpClient that comes with JDK 11. I don't know how to use file upload. Found the ofInputStream() in jav

Extracting exact table data from PDF

I am trying to extract each row of my table from a pdf file I created before. The problem I have, is that empty cells, which I thought would be saved as 'null'

Merging two objects in Java

I have two objects of same type. Class A { String a; List b; int c; } A obj1 = new A(); A obj2 = new A(); obj1 => {a = "hello"; b = null; c = 10} ob

How to fix org.hibernate.LazyInitializationException - could not initialize proxy - no Session

I get the following exception: Exception in thread "main" org.hibernate.LazyInitializationException: could not initialize proxy - no Session at org.hiberna

Java: Encode String in quoted-printable

I am looking for a way to quoted-printable encode a string in Java just like php's native quoted_printable_encode() function. I have tried to use JavaMails's M

iText find position of text in pdf

I am creating a utility that will add a multi-line text field just below the last line of text in an existing PDF document. This will be used for people who wan

ObjectMapper enable method is deprecated

I'm upgrading the version of my project and I am currently using jackson-databind-2.13.0 .But I noticed that ObjectMapper's enable method is deprecated. They sa

How to load MainActivity.java from server?

I'm developing an app in which the code is in MainActivity.java (locally) but I would like know how can I load MainActivity.java externally? Example: Save the

How can I select all the options in a drop down- Selenium Webdriver?

Currently working on Selenium WebDriver and using Java. If I have drop down name called Product.. In that drop down I have so many values (for ex:60). when exe

Spring-boot default profile for integration tests

Spring-boot utilizes Spring profiles which allow for instance to have separate config for different environments. One way I use this feature is to configure tes

HTTP/1.1 401 Authorization Required with HttpClient 4.1.1

Updated Code:- Using SSL, still am getting the same error.. I am trying to open this uri https://some-host/a/getmeta?id=10 (this url is passed to proxi.jsp

Spring-boot default profile for integration tests

Spring-boot utilizes Spring profiles which allow for instance to have separate config for different environments. One way I use this feature is to configure tes

How to fully convert JSP scriptlet into JSTL?

I am new to JSTL, could someone please tell me how to convert below JSP and HTML code to full JSTL with no scriptlet in the page? I'd also be grateful for sugge

Unresolved reference in kotlin with id and activity_main

I'm actually creating a new app in kotlin to display an xml file in boxes with the informations formatted To problem is that when I'm building the app, there i

Generating a pdf report using JasperRunManager

I want to generate a pdf report using ejbql ,but I dont know how to do that. I have tried to do thye following but an error occure: parameterMap.put(JRJpaQuery

Java LocalDate invalid date formatting

I have a script to get previous month for current date (script executed on 1st date monthly) the script return valid result for all other month except on Januar

Java LocalDate invalid date formatting

I have a script to get previous month for current date (script executed on 1st date monthly) the script return valid result for all other month except on Januar

one single ObjectOutputStream for multiple use with sockets

I'm trying to make a very basic example of a network connection where I use an ObjectOutputStream, ObjectInputStream and sockets. The client sends the string "H

Java 8 LocalDateTime.now() only giving precision of milliseconds

Is it possible to get microseconds in Java 8? The Java 8 LocalDateTime class has a .getNano() method which is meant to return nanoseconds, but on both Linux(Ubu