MaintainJ Blog

December 13, 2007

MaintainJ with Glassfish

Filed under: Uncategorized — maintainj @ 7:12 pm

Follow these instructions to use MaintainJ on Glassfish. In the steps below, it is assumed that your domain name is domain1. Change if necessary. Replace GlassfishRoot with the folder where Glassfish is installed.

1. Download MaintainJ.war and drop it into your autodeploy folder.
2. Go to http://localhost:8080/MaintainJ . Click ‘Install’ link.
3. You will go to ‘Install MaintainJ’ screen. Click ‘Install’ button. This copies two jar files to GlassfishRoot/domains/domain1/maintainj folder.
4. Click ‘Step 2: Configure Instrumentation Scope’. Enter a package name in your application and choose other options as necessary.
5. Next you need to update the server classpath and JVM arguments. Open the admin console at http://localhost:4848/
6. Go to Application Server–>JVM Settings–>Path Settings–>Classpath Prefix . Add

GlassfishRoot/domains/domain1/maintainj;GlassfishRoot/domains/domain1/maintainj/MaintainJAspect.jar

Replace GlassfishRoot. Notice that this classpath contains a folder and a jar file. The folder is needed because the aspect in META-INF/aop.xml needs to be in server classpath.
7. Go to Application Server–>JVM Settings–>JVM Options–>Add JVM option. In the text box opened, add

-javaagent:GlassfishRoot/domains/domain1/maintainj/aspectjweaver.jar

Replace GlassfishRoot
8. Restart Glassfish Server.
9. Verify installation at http://localhost:8080/MaintainJ/verify.jsp .
10. Start Tracing at http://localhost:8080/MaintainJ/aspect.jsp . Click ‘Start Tracing’ button.
11. Run a use case in your application.
12. Click ‘Stop Tracing’ button.

That’s it! Your trace files are ready.

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

You must be logged in to post a comment.

Powered by WordPress