Tim Moores wrote:It seems you're back to a point where this isn't even working for a desktop app? So the problem is not with making it work in a web app, but in getting the fundamentals right?
If you have a problem, then please describe the problem. Whatever steps you tried to follow is irrelevant (and just clutters up this thread) if you don't tell us what, specifically, the problem is, and what, specifically, you did when you encountered it. "it is giving input not an X.509 certificate" is, I'm afraid, useless as a problem description.
Tim Moores wrote:This part of the question still stands:
Or do you really have a root directory called "resources" on your disk?
It's the FileOutputStream handling where the exception occurs, after all.
Tim Moores wrote:You're continuously ignoring my suggestions. Here it is, once more:
Tim Moores wrote:This part of the question still stands:
Or do you really have a root directory called "resources" on your disk?
It's the FileOutputStream handling where the exception occurs, after all.
You did note that the exception happens not when the code is trying to access any certificate, but when it tries to deal with the PDF file, right? And you understand the difference between a directory sitting at the root of a web app and a directory sitting at the root of the file system, yes? And that consequently there are differences between how files are handled by the file access classes in java.io and the way getRealPath works in a servlet environment? I'm asking because it seems that you're still confused about these differences. Nothing I see about the exception suggest to me that the current problem has anything to do with certificates.
Tim Moores wrote:In other words, the answer to my question "Or do you really have a root directory called "resources" on your disk?" is no, you do not. And my suspicion that you do not understand the difference between a web app root and a file system root is actually correct.
In short: the path you're passing to FileOutputStream does not exist, just like the error message tells you. You need to use getRealPath to construct the proper path.
Tim Moores wrote:Not where the exception is thrown. You haven't even tried to figure out in which instruction the exception happens, have you?
By the way, you should drop the habit of quoting back entire posts - it really serves no purpose but to make the thread harder to follow. Quoting is for extracting specific pieces of a previous post that you're responding to.
Live a little! The night is young! And we have umbrellas in our drinks! This umbrella has a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|