Article - CS251020

Cannot connect to Windchill with "BadPaddingException - Given final block not properly padded"

Modified: 14-Apr-2025   


Applies To

  • Windchill PDMLink 10.1 F000 to 13.0

Description

  • Cannot connect to Windchill with below error: 
    BadPaddingException - Given final block not properly padded
    WTException: javax.crypto.BadPaddingException
      
    Pop up error message:
    wt.util.WTRuntimeException: wt.util.WTException: javax.crypto.BadPaddingException: Given final block not properly padded Nested exception is: javax.crypto.BadPaddingException: Given final block not properly padded; nested exception is wt.util.WTException: javax.crypto.BadPaddingException: Given final block not properly padded Nested exception is javax.crypto.BadPaddingException: Given final block not properly padded
    
    javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.] with root cause
    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:975)
        at com.sun.crypto.provider.CipherCore.fillOutputBuffer(CipherCore.java:1056)
        at com.sun.crypto.provider.CipherCore.doFinal(CipherCore.java:853)
        at com.sun.crypto.provider.AESCipher.engineDoFinal(AESCipher.java:446)
        at javax.crypto.Cipher.doFinal(Cipher.java:2164)
        at wt.intersvrcom.SiteSecurity.decryptPrivateKey(SiteSecurity.java:573)
        at wt.intersvrcom.SiteSecurity.getPrv(SiteSecurity.java:203)
        at wt.intersvrcom.SiteInfoCache.getSecretKey(SiteInfoCache.java:526)
        at wt.intersvrcom.StandardInterSvrComService.getSecretKey(StandardInterSvrComService.java:2122)
        at wt.intersvrcom.MacAuthenticator.getSecretKeyByDisablingAccess(MacAuthenticator.java:184)
        at wt.intersvrcom.MacAuthenticator.sign(MacAuthenticator.java:119)
        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 com.ptc.core.appsec.FoundationHolder.sign(FoundationHolder.java:282)
        at com.ptc.core.appsec.CSRFNonce$1.call(CSRFNonce.java:321)
        at com.ptc.core.appsec.CSRFNonce$1.call(CSRFNonce.java:318)
        at wt.httpgw.WTContextBeanHandler.runOperation(WTContextBeanHandler.java:268)
        at wt.httpgw.WTContextBeanHandler.runOperation(WTContextBeanHandler.java:253)
        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 com.ptc.core.appsec.CSRFNonce.initializeMac(CSRFNonce.java:316)
        at com.ptc.core.appsec.CSRFNonce.initialize(CSRFNonce.java:161)
        at com.ptc.core.appsec.CSRFNonce.newCSRFNonce(CSRFNonce.java:130)
        at com.ptc.core.appsec.CSRFProtector.addNonce(CSRFProtector.java:373)
        at com.ptc.core.appsec.CSRFProtector.getNonce(CSRFProtector.java:198)
        at com.ptc.core.appsec.CSRFProtector.getNonce(CSRFProtector.java:176)
        at com.ptc.core.appsec.CSRFProtector.getNonce(CSRFProtector.java:160)
        at com.ptc.core.appsec.CSRFProtector.getNonce(CSRFProtector.java:138)
        at org.apache.jsp.WEB_002dINF.jsp.shell_jsp._jspService(shell_jsp.java:214)

     

  • Method server logs 

    ERROR [ajp-nio-127.0.0.1-8010-exec-8] org.apache.catalina.core.ContainerBase.[Catalina].[localhost].[/Windchill].[MVCDispatcher]  - Servlet.service() for servlet [MVCDispatcher] in context with path [/Windchill] threw exception [wt.util.WTRuntimeException: wt.util.WTException: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
    Nested exception is: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption. Nested exception is:
    	wt.util.WTException: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
    Nested exception is: javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.] with root cause javax.crypto.BadPaddingException: Given final block not properly padded. Such issues can arise if a bad key is used during decryption.
This is a printer-friendly version of Article 251020 and may be out of date. For the latest version click CS251020