How to update Java Heap Size Alfresco Windows Service

How to update Java Heap Size Alfresco Windows Service


Options:
1. Update the setenv.bat/setenv.sh file
2. Update the alfrescoTomcatw.exe(service) file

Option 1: Update the setenv.bat/setenv.sh file


Step 1: Go to the <alfresco-home>tomcat\bin folder
Step 2: Edit the file setenv.bat to update the value starting with SET JAVA_OPTS.. to have the value - --JvmMx 4095 replaced with the desired maximum value, say --JvmMx 8129

Option 2: Update the alfrescoTomcatw.exe(service) file


Step1. Go to the <alfresco-home>tomcat\bin folder
Step 2: Find and right-click on the alfrescoTomcatw.exe file, click on Open

Step 3: Click on the Java tab



Step 4: Update the Maximum memory pool to the desired RAM.
Step 5: Restart the server.


Alfresco Illegal key size Issue - Solved


Alfresco Illegal key size Issue 


Ever had to add a crypto key in alfresco configurations and ran into below issue? You can try the fix mentioned below to come out of it.

Caused by: java.security.InvalidKeyException: Illegal key size or default parameters
                at javax.crypto.Cipher.checkCryptoPerm(Cipher.java:1026)
                at javax.crypto.Cipher.implInit(Cipher.java:801)
                at javax.crypto.Cipher.chooseProvider(Cipher.java:864)
                at javax.crypto.Cipher.init(Cipher.java:1249)
                at javax.crypto.Cipher.init(Cipher.java:1186)
                at org.alfresco.consulting.module.distobj.impl.DefaultConfigurationService.validateCrypto(DefaultConfigurationService.java:371)



Solution

                Step 1: Download the JCE Unlimited jars from oracle downloads 
                Step 2: Add to your JDK or JRE lib under \lib\security\
                Step 3: Set below property in the <jdk or jre home>\lib\security\java.security
crypto.policy=unlimited

                Step 4: Restart the server

Admin console settings overwrite the alfresco global configurations

Admin console settings overwrite the alfresco global configurations



Do you often deal with lot of Alfresco configurations including those simple looking ones at alfresco-global.properties? Dealt with Below points might be of your interest

alfresco-global.properties


Alfresco has summoned many of its product configuration to this file alfresco-global.properties from files such as repository.properties, database configurations etc to one single file. This helps easy management of various configurations. When installed using installer the file is found in below location:
 <alfresco-installation-directory>\tomcat\shared\classes

Administration -Points to remember

1. Alfresco Admin Console : values overwrite the values from properties files including alfresco-global.properties

2.JMX Console: Values saved through admin console needs to be managed using JMX Console

3. Server restart: In most cases a Server/service restart are required for the changes to get reflected. However certain configurations such as log4j, License etc doesnt require a server restart

4. Server/Client Cache - Always remember to clear the caches such as browser cache (private browing/going incognito) , Tomcat temp, work folder clearance saves a lot of time in successful validation of configurations
Alfresco Invalid keystore format

Alfresco Invalid keystore format

Alfresco Invalid keystore format

Ever got into the issue below while installing the cert?

I:\Alfresco51\alf_data\keystore>F:\Alfresco51\java\bin\keytool -list -v -keystore ssl.keystore
keytool error: java.io.IOException: Invalid keystore format
java.io.IOException: Invalid keystore format
        at sun.security.provider.JavaKeyStore.engineLoad(Unknown Source)
        at sun.security.provider.JavaKeyStore$JKS.engineLoad(Unknown Source)
        at sun.security.provider.KeyStoreDelegator.engineLoad(Unknown Source)
        at sun.security.provider.JavaKeyStore$DualFormatJKS.engineLoad(Unknown S
ource)
        at java.security.KeyStore.load(Unknown Source)
        at sun.security.tools.keytool.Main.doCommands(Unknown Source)
        at sun.security.tools.keytool.Main.run(Unknown Source)
        at sun.security.tools.keytool.Main.main(Unknown Source)


Try below Solution

Check if you are appending the keytool parameter -storeType with values like JCEKS/JKS/PKCS12