I am trying to sign PDF files in my application. And i do. But when the files are few thousands i get the exception every time at around 240 file :
I have tried to create new PKCS11 provider and extract the keys form the SmartCard token but I always got this exception.
Thera is even a bug reported HERE.
Over the net space I could not found a solution. I don't know what to do. SunPKCS11 provider do not provide any managing methods , like for example clear session counter or Open new session or something like that.
I can't even find what the hell CKR_SESSION_COUNT means in that exception! There is no examples , no explanations on the web.
SessionManager class is invisible , so i can not manually manage the sessions to the SmartCard token.
I want to post this problem to Oracle, but don't know where to do that. Please does someone know it?
Or at least what else forum i should write to?
Thank you very much
no i have no application server at all, I am working on completely stand alone Java application.
I took a look at the link you have provided, but the info for the provider is every time the same
SunPKCS11-SmartCard using library C:\Windows\SysWOW64\cvP11.dll
What I have discovered so far is if I do (the code that next is for showing the logic, do not expect it to run if you copy it):
The exception is thrown every time at cycle 50:
if i do:
The exception is every time at different file, but arount 250. Have no idea what java.security.Signature class is doing inside. Looks like it creates sessions or doing something with the sessions.
I dont know maybe the provider is not clearing the resources when i do Security.RemoveProvider().
I don't know what to do else.
And thank you I will try to write to oracle, but I am not sure the problem is from java or from the nativ code of the provider!