Spring boot build version and time access

Spring boot can create the build version info for you automatically and with a default bean to access these information. I found this link is very helpful on this  and i jus tlist main points at here.


  1. build-info goal create the version info


2. In java code, just use BuildProperties to get the version info. You cna then display on UI and logs.

BuildProperties buildProperties;


3. you can even add more properties in POM to let it saved in build-info, you can refer to the link details for this.


How to let swagger control group display

In Swagger, you normally divide the API into groups and each group will have a Docket.

But many times, you do not want someone or some environment to see all groups . you want to control each group showing or not. This looks like a difficult task after some search. But in fact swagger already has this feature in Docket.

public Docket myDocket() {
return new Docket(DocumentationType.SWAGGER_2).groupName("MYAPI").apiInfo(...).select().paths(....)

So enable(boolean) is part to control enable method for the group. You can use your configuration or role logic to control this flag value to control the group here.


How to let your spring boot pick up external property file

You may already see that ./config/application.properties can override the default spring boot application.properties settings. But when you deploy your app to tomcat and with many other web app together, then you need to have unique properties files foe each app and also make external property file be picked up by web app.

So let us do something like this:

  1. Change in your java main code to let your app use a unique properties file instead of application.properties.
public class MyApplication {

    public static void main(String[] args) {
        System.setProperty("spring.config.name", "myapp");
        SpringApplication.run(MyApplication.class, args);

For war version of tomcat:

public class ServletInitializer extends SpringBootServletInitializer {

    protected SpringApplicationBuilder configure(SpringApplicationBuilder application) {
        return application.sources(MyApplication.class).properties("spring.config.name: myapp");


Then name your properties file like: myapp.properties, instead of the default name.

2. Now let us also enable the external property file to override the default myapp.properties.

in Spring boot, it is just ./config/myapp.properties

For tomcat version, we need to add env variable to do this. Set a spring_config_location environment variable pointing to the folder that contains your myapp.properties file. In the case of Tomcat you can do this by adding the following line to your <TOMCAT_HOME>/bin/setenv.sh file (create the file if missing):

export spring_config_location=<TOMCAT_HOME>/conf/

Place the myapp.properties properties file in that folder <TOMCAT_HOME>/conf/.

So every app will looking into the conf folder to look for their unique properties file to load.


Refer to:




Java native memory tools and usage related












java -XX:+PrintFlagsFinal -version | grep -iE 'HeapSize|PermSize|ThreadStackSize'

Issue: An irrecoverable stack overflow has occurred.


An irrecoverable stack overflow has occurred. Please check if any of your loaded .so files has enabled executable stack (see man page execstack(8))


This issue happens when I call a c++ So lib from java by JNA. This mostly caused by input a big chunk of data into the function interface of the C++ function. There is a limit of the Thread Stack Size defined for java’s thread. Normally is 512K-1024K.


And by change the Xss size you could change the stack size. but you should be careful on this when you have many threads need to open.



Refer http://xmlandmore.blogspot.com/2014/09/jdk-8-thread-stack-size-tuning.html


Free text/code online share tools

You can immediately open a browser and share the code/text link with other people. And you do not even need to register account for using .

These are some very useful site for remote sharing something in a prompt or do a very simple phone interview for startup.

  1. https://codeshare.io/
  2. https://www.codepile.net
  3. https://witeboard.com
  4. https://www.skype.com/en/interviews/
  5. Google doc


  1. Not free – http://collabedit.com/
  2. Not free – https://coderpad.io

Spoken dialogue system open resources

OpenDial – java



DeepPavlov – Python


Jindigo – Java


jVoiceXML – JAVA


CMU RavenClaw – C++/Perl


PED – prolog


OwlSpeak – Java


IrisTK – java


InproTK – java python


Rivr – Java – voiceXML



summary ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++


Cloud Commercial like the FB wit.ai, Microsoft LUIS, Nuance and google api.ai