Java – Graphs and Charts

How to draw graphs and charts

1. If you want to generate bmp, jpg formats better to use

http://www.jfree.org/jfreechart/ Better with Swing or to email images.
http://cewolf.sourceforge.net/new/index.html Better for JSP/Servlet integration.

2. For more detailed research, Excel is best. Create template with graphs and fill the data using Apache POI API.
http://poi.apache.org/

3. For better quick online graphs try following
http://code.google.com/apis/chart/interactive/docs/gallery/linechart.html

http://code.google.com/apis/ajax/playground/?type=visualization#line_chart

http://webdesignledger.com/resources/13-useful-javascript-solutions-for-charts-and-graphs

-o-

Java – Performance Monitoring

Problem: One method is taking 30 seconds. How can we bring it down to the minimal?

First we need to identify all the code (methods) executed.
Get the time took by each method. So that we can troubleshoot one at a time.

How to do this?

1. Simple solution: Using difference of start time and end time.
We can’t use this always. This is not production quality code and we can’t litter the code with all these methods and calculations.

2. Using API level code
JMON API http://jamonapi.sourceforge.net/

3. Using Monitors. This is best way to test distributed installations.
InfraRED http://infrared.sourceforge.net

– – –

java.lang.IllegalArgumentException: SSL

Problem:
INFO: Interceptor has thrown exception, unwinding now
java.lang.IllegalArgumentException: SSL
at com.sun.net.ssl.internal.ssl.ProtocolVersion.valueOf(ProtocolVersion.java:133)
at com.sun.net.ssl.internal.ssl.ProtocolList.(ProtocolList.java:38)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.setEnabledProtocols(SSLSocketImpl.java:2075)

Fix:

Before: parameters.setSecureSocketProtocol(“SSL”);

After: parameters.setSecureSocketProtocol(“SSLv3”);