Welcome!

Machine Learning Authors: Yeshim Deniz, Elizabeth White, Zakia Bouachraoui, Pat Romanski, Liz McMillan

Related Topics: Java IoT, Containers Expo Blog, Machine Learning

Java IoT: Blog Post

How to Monitor JVM System Properties

Trace all calls to System.getProperty method

Many libraries use system properties for settings. For example, you usually have to set a property to enable debug traces or to activate certain behaviors. However, sometimes system properties that are used are not well documented or you are not sure that they are having some effect. In such cases it would be useful to have a way to know which system properties are queried.

There are several manners to do this but I have found a simple way that is not so intrusive. By creating a custom Security Manager you can define a method that checks property accesses. This method is able to send to the logger or to the standard output what property has been queried.

public class PropertyAccessPrinterSecurityManager extends SecurityManager {
	@Override
	public void checkPropertyAccess(String key) {
		System.out.println("System.getProperty(\""+key+"\")");
	}
}

 

This article explains how to know which JVM System Properties are actually being queried by libraries. This class should be compiled and available in the classpath.

Now we create in the current directory a file named “java.policy” with the following content:

grant {
	permission java.security.AllPermission;
};

 

We just have everything we need to trace calls to System.getProperty. Next we add these parameters to the java call:

java -Djava.security.manager=PropertyAccessPrinterSecurityManager -Djava.security.policy==java.policy

 

More Stories By Alfredo Diaz

Alfredo Diaz is a Java EE Architect with over 10 years of experience. He is an expert in SOA, real-time processing, scalability and HA. He is an Agile enthusiast.

CloudEXPO Stories
There's no doubt that blockchain technology is a powerful tool for the enterprise, but bringing it mainstream has not been without challenges. As VP of Technology at 8base, Andrei is working to make developing a blockchain application accessible to anyone. With better tools, entrepreneurs and developers can work together to quickly and effectively launch applications that integrate smart contracts and blockchain technology. This will ultimately accelerate blockchain adoption on a global scale.
Cryptomage, Inc. is a dynamic hi-tech ICT company offering products and services in the cybersecurity area. We deliver high quality solutions both technologically and conceptually. We have academic roots and hire scientists, cybersecurity experts, software developers and analysts. Our strategy is focused on maintaining the highest skills of our human resources. The Cryptomage team is capable of more than delivering complex solutions; we can improve the whole concept to deliver real added value to our customers.
In addition to 22 Keynotes and General Sessions, attend all FinTechEXPO Blockchain "education sessions" plus 40 in two tracks: (1) Enterprise Cloud (2) Digital Transformation. PRICE EXPIRES AUGUST 31, 2018. Ticket prices: ($295-Aug 31) ($395-Oct 31) ($495-Nov 12) ($995-Walk-in) Does NOT include lunch.
Early Bird Registration Discount Expires on August 31, 2018 Conference Registration Link ▸ HERE. Pick from all 200 sessions in all 10 tracks, plus 22 Keynotes & General Sessions! Lunch is served two days. EXPIRES AUGUST 31, 2018. Ticket prices: ($1,295-Aug 31) ($1,495-Oct 31) ($1,995-Nov 12) ($2,500-Walk-in)
It cannot be overseen or regulated by any one administrator, like a government or bank. Currently, there is no government regulation on them which also means there is no government safeguards over them. Although many are looking at Bitcoin to put money into, it would be wise to proceed with caution. Regular central banks are watching it and deciding whether or not to make them illegal (Criminalize them) and therefore make them worthless and eliminate them as competition. ICOs (Initial Coin Offerings) are something most have no idea as to what it means and how you utilize it. Where is the "Stamp of Approval" or "Stamp of Legitimacy" on some of these Bitcoin websites (how do you know you are not dealing with a scammer?)