ALERT: Some images may not load properly within the Knowledge Base Article. If you see a broken image, please right-click and select 'Open image in a new tab'. We apologize for this inconvenience.

WARN  [termalabs.common.KeyBasedCipher] Error during decryption javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.

book

Article ID: 224133

calendar_today

Updated On:

Products

Automic Automation Intelligence

Issue/Introduction

16:41:12.594 WARN  [termalabs.common.KeyBasedCipher] Error during decryption
javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
 at com.sun.crypto.provider.CipherCore.unpad(CipherCore.java:1042)
 at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1123)
 at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:920)
 at com.sun.crypto.provider.DESedeCipher.engineDoFinal(DESedeCipher.java:294)
 at javax.crypto.Cipher.doFinal(Cipher.java:2168)
 at com.termalabs.common.KeyBasedCipher.decrypt(KeyBasedCipher.java:157)
 at com.termalabs.configui.settings.OtherSettings.init(OtherSettings.java:399)
 at com.termalabs.configui.settings.OtherSettings.setPanel(OtherSettings.java:181)
 at com.termalabs.configui.ui.OtherPanel.<init>(OtherPanel.java:99)
 at com.termalabs.configui.ui.ConfigFrame.initSettings(ConfigFrame.java:156)
 at com.termalabs.configui.ui.ConfigFrame.<init>(ConfigFrame.java:85)
 at com.termalabs.configui.Main$1.stateChanged(Main.java:81)
 at com.termalabs.util.swing.event.ChangeEventSource.fireStateChanged(ChangeEventSource.java:136)
 at com.termalabs.common.ui.frames.SelectDirFrame.doSelect(SelectDirFrame.java:138)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 at java.lang.reflect.Method.invoke(Method.java:498)
 at net.sourceforge.tahini.Tahini$ControllerLinker$1.actionPerformed(Unknown Source)
 at javax.swing.AbstractButton.fireActionPerformed(AbstractButton.java:2022)
 at javax.swing.AbstractButton$Handler.actionPerformed(AbstractButton.java:2348)
 at javax.swing.DefaultButtonModel.fireActionPerformed(DefaultButtonModel.java:402)
 at javax.swing.DefaultButtonModel.setPressed(DefaultButtonModel.java:259)
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(BasicButtonListener.java:252)
 at java.awt.Component.processMouseEvent(Component.java:6539)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
 at java.awt.Component.processEvent(Component.java:6304)
 at java.awt.Container.processEvent(Container.java:2239)
 at java.awt.Component.dispatchEventImpl(Component.java:4889)
 at java.awt.Container.dispatchEventImpl(Container.java:2297)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4904)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4535)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4476)
 at java.awt.Container.dispatchEventImpl(Container.java:2283)
 at java.awt.Window.dispatchEventImpl(Window.java:2746)
 at java.awt.Component.dispatchEvent(Component.java:4711)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:760)
 at java.awt.EventQueue.access$500(EventQueue.java:97)
 at java.awt.EventQueue$3.run(EventQueue.java:709)
 at java.awt.EventQueue$3.run(EventQueue.java:703)
 at java.security.AccessController.doPrivileged(AccessController.java:704)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:84)
 at java.awt.EventQueue$4.run(EventQueue.java:733)
 at java.awt.EventQueue$4.run(EventQueue.java:731)
 at java.security.AccessController.doPrivileged(AccessController.java:704)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:74)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:730)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:205)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)
16:41:12.594 ERROR [configui.settings.OtherSettings] Cannot connect to the database 
Database type: Oracle
Database server: serverName
Database port: 1521
Database name: dbname
Database user: AAI
Database password: **********
16:41:12.610 INFO  [configui.ui.ConfigFrame] Config Tool Version: Version: 6.3.0     Build: 6.3.0-202106041328

Environment

Release : 6.3.0

Component : AUTOMIC AUTOMATION INTELLIGENCE ENGINE

Resolution

The Error indicates that the .jawskey file in the \<Install Dir>\jboss\standalone\configuration directory may not have a matching encrypted key with the Oracle database connection.

 

If you are trying to connect to an existing AAI/JAWS database, you will need to copy over the exiting .jawskey file from the \<Install Dir>\jboss\standalone\configuration of the original server.

 

In this case it appears the error occurred because AAI was reinstalled several times after the initial database connection was established.

 

Advised to Uninstall AAI, Drop the Oracle Database and reinstall.

 

Full steps below:

1. Drop the database you created originally.

 

2. Uninstall AAI again and delete the leftover directory.

 

3. Get JAVA JDK 1.8 installed under C:\Program Files\ or somewhere other then the Desktop.

 

4. Set JAVA_HOME to the base java directory.

 

5. Add %JAVA_HOME%\bin to the PATH Variable and move it to the top of the list of path variables.

 

6. Send me the output of the two commands below:

set > set.txt

path > path.txt

 

7. Once that looks ok, run the installer again.

 

8. The Oracle createDevices.sql sql script should be run as a DB user with admin rights.

 

9. The createDevices.sql script should be run as the user that was created in the createDevices.sql script.

 

10. Make sure the Oracle ojdbc8.jar is in the \jboss\standalone\deployments directory.  

https://docs.automic.com/documentation/webhelp/english/ALL/components/TERMA/latest/AAI%20Guides/Content/AAI_Topics/Release_Notes_6_0_0/Support-for-Non-Redistributable-Database-Drivers.htm

 

11. Start the config tool and verify the db can connect and that the configtool.log is clean.

 

12. Try to start the Automic Automation Intelligence service is able to start.