How To Solve XML Parsing Issue “Content is not allowed in prolog” In Java

If you have come to this post, then you are facing xml parsing issue in Java. Caused by: org.xml.sax.SAXParseException; lineNumber: 1; columnNumber: 1; Content is not allowed in prolog.         at com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:203) One common issue for this is BOM character. So what is a BOM (BYTE ORDER MARK) character? When you have … Read more

How To Fix “unable to find valid certification path to requested target” Error

If you are here, that means probably you have encountered below error: Caused by: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target         at sun.security.validator.PKIXValidator.doBuild(PKIXValidator.java:387)         at sun.security.validator.PKIXValidator.engineValidate(PKIXValidator.java:292)         at sun.security.validator.Validator.validate(Validator.java:260)         at sun.security.ssl.X509TrustManagerImpl.validate(X509TrustManagerImpl.java:324)     … Read more

Difference Between Wait And Park Methods In Java Thread

If you are familiar with thread dump or at least looked at it couple of times, probably you would have noticed WAITING  & WAITING (parking) states. So what’s the difference? In Java, we have Object.wait() and Unsafe.park() methods. Both of them will suspend the running thread & put it in waiting state. But these two methods work on different principles. Object.wait() results in WAITING state whereas Unsafe.park() method … Read more