search cancel

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.


Article ID: 224133


Updated On:


Automic Automation Intelligence


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(
 at com.sun.crypto.provider.CipherCore.fillOutputBuffer(
 at com.sun.crypto.provider.CipherCore.doFinal(
 at com.sun.crypto.provider.DESedeCipher.engineDoFinal(
 at javax.crypto.Cipher.doFinal(
 at com.termalabs.common.KeyBasedCipher.decrypt(
 at com.termalabs.configui.settings.OtherSettings.init(
 at com.termalabs.configui.settings.OtherSettings.setPanel(
 at com.termalabs.configui.ui.OtherPanel.<init>(
 at com.termalabs.configui.ui.ConfigFrame.initSettings(
 at com.termalabs.configui.ui.ConfigFrame.<init>(
 at com.termalabs.configui.Main$1.stateChanged(
 at com.termalabs.util.swing.event.ChangeEventSource.fireStateChanged(
 at com.termalabs.common.ui.frames.SelectDirFrame.doSelect(
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at sun.reflect.NativeMethodAccessorImpl.invoke(
 at sun.reflect.DelegatingMethodAccessorImpl.invoke(
 at java.lang.reflect.Method.invoke(
 at net.sourceforge.tahini.Tahini$ControllerLinker$1.actionPerformed(Unknown Source)
 at javax.swing.AbstractButton.fireActionPerformed(
 at javax.swing.AbstractButton$Handler.actionPerformed(
 at javax.swing.DefaultButtonModel.fireActionPerformed(
 at javax.swing.DefaultButtonModel.setPressed(
 at javax.swing.plaf.basic.BasicButtonListener.mouseReleased(
 at java.awt.Component.processMouseEvent(
 at javax.swing.JComponent.processMouseEvent(
 at java.awt.Component.processEvent(
 at java.awt.Container.processEvent(
 at java.awt.Component.dispatchEventImpl(
 at java.awt.Container.dispatchEventImpl(
 at java.awt.Component.dispatchEvent(
 at java.awt.LightweightDispatcher.retargetMouseEvent(
 at java.awt.LightweightDispatcher.processMouseEvent(
 at java.awt.LightweightDispatcher.dispatchEvent(
 at java.awt.Container.dispatchEventImpl(
 at java.awt.Window.dispatchEventImpl(
 at java.awt.Component.dispatchEvent(
 at java.awt.EventQueue.dispatchEventImpl(
 at java.awt.EventQueue.access$500(
 at java.awt.EventQueue$
 at java.awt.EventQueue$
 at java.awt.EventQueue$
 at java.awt.EventQueue$
 at java.awt.EventQueue.dispatchEvent(
 at java.awt.EventDispatchThread.pumpOneEventForFilters(
 at java.awt.EventDispatchThread.pumpEventsForFilter(
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(
 at java.awt.EventDispatchThread.pumpEvents(
 at java.awt.EventDispatchThread.pumpEvents(
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


Release : 6.3.0



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.


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.