1 Reply Latest reply: Sep 8, 2014 9:53 AM by 995923 RSS

    custom weblogic instrumentation does not work for me :(

    995923

      Hello.

       

      First of all excuse me about my english.

       

      I have developed a simple class, I have compile it, and I have packaged it into a war file.

       

      The application Works ok when I do a request: http://192.168.1.5:7100/simple/hello

       

      But when I want to instrumentalize it, it cannot works. I have enabled instrumentation, but it I don't see anything in: Request Performance.

       

      Can you help me?.

       

      These are the files:

       

      simple_temp3

      |

      +- hello.html

      |

      +- WEB-INF

           +- web.xml

           |

      +- META-INF

           +- weblogic-diagnostics.xml

                |

           +- classes

               +- edu

                   +- ucla

                       +- hello.class

       

      [weblogic@localhost simple_temp3]$ cat hello.html

      <html>

          <head><title>Hello World</title></head>

          <body><h1>Hello World</h1></body>

      </html>

       

      [weblogic@localhost simple_temp3]$ cat META-INF/weblogic-diagnostics.xml

       

      <wldf-resource xmlns="http://www.bea.com/ns/weblogic/90/diagnostics"

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

          xsi:schemaLocation="http://www.bea.com/ns/weblogic/90/diagnostics.xsd">

          <name>Sample WLDF resource</name>

          <instrumentation>

                <enabled>true</enabled>

                    <wldf-instrumentation-monitor>

                        <name>sample</name>

                        <enabled>true</enabled>

                        <action>TraceElapsedTimeAction</action>

                        <location-type>around</location-type>

                    </wldf-instrumentation-monitor>

          </instrumentation>

      </wldf-resource>

       

      [weblogic@localhost simple_temp3]$ cat WEB-INF/web.xml
      <web-app id="simple" version="2.4">

          <welcome-file-list>
                  <welcome-file>hello.html</welcome-file>
          </welcome-file-list>

      <servlet>
          <servlet-name>Hello</servlet-name>
              <servlet-class>Hello</servlet-class>
      </servlet>
      <servlet-mapping>
           <servlet-name>Hello</servlet-name>
               <url-pattern>/hello</url-pattern>
      </servlet-mapping>

      </web-app>

       

      [weblogic@localhost simple_temp3]$ cat WEB-INF/classes/edu/ucla/Hello.java  (this is the source Class)
      import javax.servlet.Servlet;
      import javax.servlet.ServletException;
      import javax.servlet.http.HttpServlet;
      import javax.servlet.http.HttpServletRequest;
      import javax.servlet.http.HttpServletResponse;

      import java.io.IOException;
      import java.io.PrintWriter;

      public class Hello extends HttpServlet implements Servlet {
            
          public Hello() {}

          protected void doGet(HttpServletRequest request, HttpServletResponse response)
          throws ServletException, IOException
          {
              PrintWriter out = response.getWriter();
              out.println("<HTML>");
              out.println("<HEAD><TITLE>Hello World</TITLE></HEAD>");
              out.println("<BODY>");
              out.println("<H1>Hello World</H1>");
              out.println("Today is: " + (new java.util.Date().toString()) );
              out.println("</BODY></HTML>");
              out.close();
          }
      }