Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/373.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java XADES4j:不是有效的Win32应用程序(pkcs11)?_Java_Sign_Pkcs#11_Gemalto - Fatal编程技术网

Java XADES4j:不是有效的Win32应用程序(pkcs11)?

Java XADES4j:不是有效的Win32应用程序(pkcs11)?,java,sign,pkcs#11,gemalto,Java,Sign,Pkcs#11,Gemalto,我使用XADES4j项目使用JavaSE-1.8(jre1.8.0_121)32位版本+Windows32位+eclipse(32位Luna)+Gemalto令牌签署电子发票,效果很好。 现在我使用的是Windows64位系统,我没有做任何更改:我安装了JavaSE-1.8(jre1.8.0_121)32位版本、eclipse的同一版本(32位)和令牌Gemalto(gclib.64位dll)。 从eclipse运行签名时,我在pkcs11安全提供程序安装级别遇到了运行时错误: 0 [main]

我使用XADES4j项目使用JavaSE-1.8(jre1.8.0_121)32位版本+Windows32位+eclipse(32位Luna)+Gemalto令牌签署电子发票,效果很好。 现在我使用的是Windows64位系统,我没有做任何更改:我安装了JavaSE-1.8(jre1.8.0_121)32位版本、eclipse的同一版本(32位)和令牌Gemalto(gclib.64位dll)。 从eclipse运行签名时,我在pkcs11安全提供程序安装级别遇到了运行时错误:

0 [main] DEBUG org.apache.xml.security.Init  - Registering default 
algorithms
------------------------------------------------------------
...
profileCore.getInstance
SignerBES.class
profileCore.getInstance
SignerBES.class
Provider 0: SUN
Provider 1: SunRsaSign
Provider 2: SunEC
Provider 3: SunJSSE
Provider 4: SunJCE
Provider 5: SunJGSS
Provider 6: SunSASL
Provider 7: XMLDSig
Provider 8: SunPCSC
Provider 9: SunMSCAPI
INTALL PROVIDER .....

Exception in thread "AWT-EventQueue-0" java.security.ProviderException: 
Initialization failed
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:376)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:103)
at xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider.createPkcs11Provider(PKCS11KeyStoreKeyingDataProvider.java:327)
at xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider.access$1(PKCS11KeyStoreKeyingDataProvider.java:322)
at xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider$1.getBuilder(PKCS11KeyStoreKeyingDataProvider.java:180)
at xades4j.providers.impl.KeyStoreKeyingDataProvider.ensureInitialized(KeyStoreKeyingDataProvider.java:277)
at xades4j.providers.impl.KeyStoreKeyingDataProvider.getSigningCertificateChain(KeyStoreKeyingDataProvider.java:423)
at xades4j.production.SignerBES.sign(SignerBES.java:183)
at xades4j.production.SignerBES.sign(SignerBES.java:145)
at FENETRE.PSD_SIGNATURE1(FENETRE.java:706)
at FENETRE.actionPerformed(FENETRE.java:983)
at javax.swing.AbstractButton.fireActionPerformed(Unknown Source)
at javax.swing.AbstractButton$Handler.actionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.fireActionPerformed(Unknown Source)
at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(Unknown Source)
at java.awt.Component.processMouseEvent(Unknown Source)
at javax.swing.JComponent.processMouseEvent(Unknown Source)
at java.awt.Component.processEvent(Unknown Source)
at java.awt.Container.processEvent(Unknown Source)
at java.awt.Component.dispatchEventImpl(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.LightweightDispatcher.retargetMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.processMouseEvent(Unknown Source)
at java.awt.LightweightDispatcher.dispatchEvent(Unknown Source)
at java.awt.Container.dispatchEventImpl(Unknown Source)
at java.awt.Window.dispatchEventImpl(Unknown Source)
at java.awt.Component.dispatchEvent(Unknown Source)
at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
at java.awt.EventQueue.access$500(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.awt.EventQueue$3.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.awt.EventQueue$4.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
Caused by: java.io.IOException: %1 is not a valid Win32 application.
C:\Program Files\Gemalto\Classic Client\BIN\gclib.dl
at sun.security.pkcs11.wrapper.PKCS11.connect(Native Method)
at sun.security.pkcs11.wrapper.PKCS11.<init>(PKCS11.java:138)
at sun.security.pkcs11.wrapper.PKCS11.getInstance(PKCS11.java:151)
at sun.security.pkcs11.SunPKCS11.<init>(SunPKCS11.java:313)
... 46 more
0[main]DEBUG org.apache.xml.security.Init-注册默认值
算法
------------------------------------------------------------
...
profileCore.getInstance
SignerBES.class
profileCore.getInstance
SignerBES.class
提供程序0:SUN
提供商1:SunRsaSign
供应商2:SunEC
提供商3:SunJSSE
提供者4:SunJCE
供应商5:SunJGSS
供应商6:SunSASL
提供者7:XMLDSig
供应商8:SunPCSC
提供者9:SunMSCAPI
INTALL提供程序。。。。。
线程“AWT-EventQueue-0”java.security.ProviderException中出现异常:
初始化失败
位于sun.security.pkcs11.SunPKCS11。(SunPKCS11.java:376)
位于sun.security.pkcs11.SunPKCS11。(SunPKCS11.java:103)
位于xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider.createPkcs11Provider(PKCS11KeyStoreKeyingDataProvider.java:327)
位于xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider.access$1(PKCS11KeyStoreKeyingDataProvider.java:322)
位于xades4j.providers.impl.PKCS11KeyStoreKeyingDataProvider$1.getBuilder(PKCS11KeyStoreKeyingDataProvider.java:180)
在xades4j.providers.impl.KeyStoreKeyingDataProvider.ensureInitialized(KeyStoreKeyingDataProvider.java:277)
位于xades4j.providers.impl.KeyStoreKeyingDataProvider.getSigningCertificateCain(KeyStoreKeyingDataProvider.java:423)
位于xades4j.production.SignerBES.sign(SignerBES.java:183)
位于xades4j.production.SignerBES.sign(SignerBES.java:145)
在FENETRE.PSD_签名1(FENETRE.java:706)
在FENETRE.actionPerformed(FENETRE.java:983)
在javax.swing.AbstractButton.fireActionPerformed(未知源)
位于javax.swing.AbstractButton$Handler.actionPerformed(未知源)
在javax.swing.DefaultButtonModel.fireActionPerformed(未知源)
位于javax.swing.DefaultButtonModel.setPressed(未知源)
位于javax.swing.plaf.basic.BasicButtonListener.mouseReleased(未知源代码)
位于java.awt.Component.ProcessMouseeEvent(未知源)
位于javax.swing.JComponent.ProcessMouseeEvent(未知源)
位于java.awt.Component.processEvent(未知源)
位于java.awt.Container.processEvent(未知源)
位于java.awt.Component.dispatchEventImpl(未知源)
位于java.awt.Container.dispatchEventImpl(未知源)
位于java.awt.Component.dispatchEvent(未知源)
位于java.awt.LightweightDispatcher.RetargetMouseeEvent(未知源)
位于java.awt.LightweightDispatcher.ProcessMouseeEvent(未知源)
位于java.awt.LightweightDispatcher.dispatchEvent(未知源)
位于java.awt.Container.dispatchEventImpl(未知源)
位于java.awt.Window.dispatchEventImpl(未知源)
位于java.awt.Component.dispatchEvent(未知源)
位于java.awt.EventQueue.dispatchEventImpl(未知源)
位于java.awt.EventQueue.access$500(未知源)
在java.awt.EventQueue$3.run处(未知源)
在java.awt.EventQueue$3.run处(未知源)
位于java.security.AccessController.doPrivileged(本机方法)
位于java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(未知源)
位于java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(未知源)
在java.awt.EventQueue$4.run处(未知源)
在java.awt.EventQueue$4.run处(未知源)
位于java.security.AccessController.doPrivileged(本机方法)
位于java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(未知源)
位于java.awt.EventQueue.dispatchEvent(未知源)
位于java.awt.EventDispatchThread.pumpOneEventForFilters(未知源)
位于java.awt.EventDispatchThread.pumpEventsForFilter(未知源)
位于java.awt.EventDispatchThread.pumpEventsForHierarchy(未知源)
位于java.awt.EventDispatchThread.pumpEvents(未知源)
位于java.awt.EventDispatchThread.pumpEvents(未知源)
位于java.awt.EventDispatchThread.run(未知源)
原因:java.io.IOException:%1不是有效的Win32应用程序。
C:\Program Files\Gemalto\Classic Client\BIN\gclib.dl
位于sun.security.pkcs11.wrapper.pkcs11.connect(本机方法)
位于sun.security.pkcs11.wrapper.pkcs11.(pkcs11.java:138)
位于sun.security.pkcs11.wrapper.pkcs11.getInstance(pkcs11.java:151)
位于sun.security.pkcs11.SunPKCS11。(SunPKCS11.java:313)
... 46多

如何解决此问题?

将Gemalto驱动程序安装到另一个不包含特殊字符的位置

您是否尝试过eclipse和java for x64?同样在这行中
C:\Program Files\Gemalto\Classic Client\BIN\gclib.dl
我只看到了
dl
,扩展可能有一些问题?Windows在使用eclipse和java for x64时倾向于使用扩展。我的java代码中出现了几个错误,我没有时间检查它们。但是对于.dl而不是.dll的显示:我注意到了这一点,但在我的代码中,我传递了名为“gclib.dll”而不是“gclib.dl”的变量!!!!你真的要在C驱动器上传递路径吗?这对我来说似乎很奇怪,看起来这是一条默认路径。可能忽略了您的参数?Java变量“C:\\Program Files\\Gemalto\\Classic Client\\BIN\\gclib.dll”,该文件位于“C:\Program Files(x86)\Gemalto\Classic Client\BIN\gclib.dll”下