Monday, April 20, 2020

Could not bind properties to 'JacksonProperties'

Spring boot 2 run time error:


Error creating bean with name 'spring.jackson-org.springframework.boot.autoconfigure.jackson.JacksonProperties': Could not bind properties to 'JacksonProperties' : prefix=spring.jackson, ignoreInvalidFields=false, ignoreUnknownFields=true; nested exception is org.springframework.boot.context.properties.bind.BindException: Failed to bind properties under 'spring.jackson.deserialization' to java.util.Map<com.fasterxml.jackson.databind.DeserializationFeature, java.lang.Boolean>


Solution:

 At application property set
 spring.jackson.deserialization.fail-on-unknown-properties: true

Friday, February 7, 2020

run script at startup of ubuntu

Run script at startup (when you login). Following example add a small memory check script at the startup


  1.  cd  /usr/share/applications
  2. sudo gedit  memcheck.desktop
  3. [Desktop Entry]
    Name=memcheck
    Comment=memcheck  Tool
    Exec=/home/***/projects/mem_alert/memcheck.sh
    Terminal=true
    Type=Application
    Icon=someicon copied from existing .desktop files in same folder
  4. Open tweaks
  5. install genome tweak tool
  6. Click "startup applications"
  7. Click add, then select "memcheck" application from the list. If it do not appear then you have done some thing wrong.
  8. Now logout and login. The mem check script should run after user login


My memcheck.sh looks like:


#!/bin/bash
#Minimum available memory limit, MB
THRESHOLD=2000
#Check time interval, sec
INTERVAL=30
while :
do
    free=$(free -m|awk '/^Mem:/{print $4}')
    buffers=$(free -m|awk '/^Mem:/{print $6}')
    cached=$(free -m|awk '/^Mem:/{print $6}')
    available=$(free -m|awk '/^Mem:/{print $7}')
    message="Free $free""MB"", buffers $buffers""MB"", cached $cached""MB"", available $available""MB"""
    if [ $available -lt $THRESHOLD ]
        then
        notify-send "Memory is running out!" "$message"
    fi
    echo $message
    sleep $INTERVAL
done