Tim Holloway wrote:Judging from the sheer variety of JNDI objects not registered, I'd have to say that you haven't configured Log4j properly.
This looks like a good helper: https://www.baeldung.com/spring-boot-logback-log4j2
There are two noteworthy items in Section 3 (Log4j2). First, to MAKE SURE that Logback is not present by overriding the default Maven bundle.
Secondly, the alternative name for your log4j.properties file for reasons explained therein.
Tim Holloway wrote:Have you analyzed the document structure with a PDF editing tool? Aside from Adobe, there are several open-source tools that will break down a PDF into its elements, including OpenOffice, Okular and PDFEdit. Or you could use the pdf2ps utility, although digging through the raw PostScript would probably be more tedious.
Campbell Ritchie wrote:
It is a long time since I used trim() and I might be mistaken, but I believe it doesn't remove such characters as hard space (\u00a0). Try String#strip() instead.Ron McLeod wrote:. . . remove them before using trim. U+00A0, U+2007, and U+202F are the likely ones. . . .
Ron McLeod wrote:It looks like that file is UTF-8 with a BOM sequence.
I tried this and it did work. It helps show what the problem is, but is a bit of a hack and a better solution should be used.
Ron McLeod wrote:Can you share a file (attachment to post, not text in post) which is problematic?
Ron McLeod wrote:If you can determine which characters are causing you grief, you could remove them before using trim. U+00A0, U+2007, and U+202F are the likely ones.
Paul Clapham wrote:I recently spent quite a while trying to find why two strings from two totally different external sources appeared to be identical but were actually not. The strings were only two words long, how could they be different? It turned out that one of them had a non-breaking space between the two words -- took me a long time to find that.
utf8Lines = Files.readAllLines(
filePath, StandardCharsets.UTF_8)
.stream()
.filter(line -> !line.matches("^\\s*$")) // skip blank lines
.collect(Collectors.toList());