KB Article #188568
cannot access class sun.security.pkcs.PKCS7
Problem
-- If you are trying to apply a Patch to your B2Bi and you are reviving the next error when you are launching the UpdateB2Bi script:
------------------------------------------------------------
Enter update file
[]
/opt/kits/B2Bi_2.6-UP2023-10_Patch1_Server_linux-x86-64_BN3.jar
Reading update file....
An error occurred:
java.lang.IllegalAccessError: class com.axway.b2bi.installer.update.util.JarVerifier (in unnamed module @0x58530b24) cannot access class sun.security.pkcs.PKCS7 (in module java.base) because module java.base does not export sun.security.pkcs to unnamed module @0x58530b24
Error log: /opt/axway/B2Bi2/.update/install4jError177166946887305430.log
java.lang.IllegalAccessError: class com.axway.b2bi.installer.update.util.JarVerifier (in unnamed module @0x58530b24) cannot access class sun.security.pkcs.PKCS7 (in module java.base) because module java.base does not export sun.security.pkcs to unnamed module @0x58530b24
at com.axway.b2bi.installer.update.util.JarVerifier.preprocessMainFiles(JarVerifier.java:356)
at com.axway.b2bi.installer.update.util.JarVerifier.<init>(JarVerifier.java:50)
at com.axway.b2bi.installer.update.util.JarVerifier.verify(JarVerifier.java:54)
at com.axway.b2bi.installer.update.util.JarUtil.verifyJar(JarUtil.java:424)
at com.axway.b2bi.installer.update.util.PackUtil.Extract(PackUtil.java:73)
at com.axway.b2bi.installer.update.data.B2BiMainUpdate.isValid(B2BiMainUpdate.java:343)
at com.axway.b2bi.installer.update.ui.InstallTree_console.addUpdateFile(InstallTree_console.java:169)
at com.axway.b2bi.installer.update.ui.InstallTree_console.handleConsole(InstallTree_console.java:96)
at com.install4j.script.I4jScript_Internal_103.eval(I4jScript_Internal_103.java:25)
at com.install4j.script.I4jScript_Internal_103.evaluate(I4jScript_Internal_103.java:41)
at com.install4j.runtime.installer.helper.Script.evaluate(Script.java:33)
at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:202)
at com.install4j.runtime.installer.ContextImpl.runScript(ContextImpl.java:196)
at com.install4j.runtime.beans.formcomponents.ConsoleHandlerFormComponent.handleConsole(ConsoleHandlerFormComponent.java:36)
at com.install4j.runtime.installer.frontend.FormPanel.handleConsole(FormPanel.java:170)
at com.install4j.runtime.beans.formcomponents.FormEnvironmentImpl.handleConsole(FormEnvironmentImpl.java:245)
at com.install4j.runtime.beans.screens.FormScreen.handleConsole(FormScreen.java:164)
at com.install4j.runtime.installer.frontend.headless.ConsoleScreenExecutor.handleScreen(ConsoleScreenExecutor.java:53)
at com.install4j.runtime.installer.frontend.headless.AbstractHeadlessScreenExecutor.execute(AbstractHeadlessScreenExecutor.java:96)
at com.install4j.runtime.installer.controller.Controller$1.run(Controller.java:155)
at java.desktop/java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:318)
at java.desktop/java.awt.EventQueue.dispatchEventImpl(EventQueue.java:773)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:720)
at java.desktop/java.awt.EventQueue$4.run(EventQueue.java:714)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:399)
at java.base/java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
at java.desktop/java.awt.EventQueue.dispatchEvent(EventQueue.java:742)
at java.desktop/java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:203)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:124)
at java.desktop/java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:113)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:109)
at java.desktop/java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
at java.desktop/java.awt.EventDispatchThread.run(EventDispatchThread.java:90)
Finishing execution ...
------------------------------------------------------------
Resolution
-- Most probably you are using another Java version than the one used by B2Bi. You can check that by using the java -version command.
-- Check on your environment and try to uninstall any others Java versions, B2Bi does not work the default JRE.
-- If you cannot uninstall the other Java version from your environment you can simply use the below steps and after it you will be able it to install the Patch:
- unset JAVA_HOME
- export JAVA_HOME=/opt/Axway/jre/
- export PATH=$JAVA_HOME/bin:$PATH
- run again the UpdateB2Bi.sh