"only commands for license handling are allowed in current state"
Can you confirm if license is installed. Please check steps below
1705694 - SAP DBTech JDBC: ~only commands for license handling are allowed in current state,,,
2619291 - The System Has No Valid License. Execute Failed (437)
2728984 - System Has No Valid License. Execute failed (437) - Instance is registered with permanent license
If license is installed and you still get error from application, a restart is required - check SAP note 2607801 - Connection Needs to be Restarted After Installing New License for more details.