Advertisment

Analyzing the performance of Java EE apps using Netbeans Profiler

author-image
CIOL Bureau
Updated On
New Update

To profile a Java

EE application the way it has been explained here, there is no need

to have the source code of the application. The only requirement is that the

Java EE application that is intended to be profiled should have been compiled

with -g option.



Setting up the

environment:







  1. style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>Install JDK1.5 available @ href="http://java.sun.com/j2se/1.5.0/download.jsp">http://java.sun.com/j2se/1.5.0/download.jsp





  • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>Install Netbeans Platform 5.0 (either nightly or

    latest RC or Java EE version of it) available @ href="http://www.netbeans.org/downloads/index.html">http://www.netbeans.org/downloads/index.html.

    I used Netbeans 5.0 RC2 for my experiment.




  • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>Install the latest and greatest Netbeans Profiler

    available @ href="http://profiler.netbeans.org/download/index.html">http://profiler.netbeans.org/download/index.html.

    I used RC2.




  • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>Install latest GlassFish server available @ href="http://glassfish.dev.java.net/">http://glassfish.dev.java.net



  • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>Deploy your Java EE application on GlassFish server.

    Make sure your application was compiled with -g option so that all the debug

    information are generated. Profiler makes use of these debug informations.




  • Brief

    description of the application we are profiling:



    size=2>The sample application is a stateless session bean which comes bundled as

    part of SJSAS samples. The application has the following main

    components:







    • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana>GreeterView.jsp



    • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana> size=2>samples.ejb.stateless.simple.servlet.GreeterServlet



    • style="BACKGROUND: none transparent scroll repeat 0% 0%; MARGIN-BOTTOM: 0in"> face=Verdana> size=2>samples.ejb.stateless.simple.ejb.GreeterEJB


    size=2>This is how the application works : When the application is accessed,

    GreeterView.jsp brings up a form wherein one can enter the name and click

    “Process” button. On clicking the “Process” button the form posts the name to

    GreeterServlet. GreeterServlet invokes GreeterEJB's getGreeting() method and a

    personalized greeting returned from the EJB is presented to the

    user.

    Steps for

    profiling the application

    tech-news