MaintainJ Blog

September 22, 2015

JBoss EAP 6+ is JBoss AS 7 and its problems with MaintainJ

Filed under: Uncategorized — maintainj @ 8:50 pm

As this link shows, JBoss EAP 6+ based on JBoss AS 7.

JBoss AS 7 uses OSGI class loading model, which is very different from the regular hierarchical class loading model we are familiar with in application servers. Even if you add a jar file to the server classpath, the web applications (the war files) cannot see it. The workaround is to specify the packages in those jar files using a special JBoss system property jboss.modules.system.pkgs.

MaintainJ.war, which helps to configure MaintainJ on application servers, sets this property in the run_with_mnj.bat file as below. Users are supposed to use this script to restart JBoss so that they can trace the applications using MaintainJ. Below is a sample content of run_with_mnj.bat.

————

SETLOCAL set JAVA_OPTS=”-javaagent:C:\JBossEAP610\maintainj\MaintainJAgent.jar” -Dorg.aspectj.weaver.loadtime.configuration=file:C:\JBossEAP610\maintainj\maintainj.xml -Djboss.modules.system.pkgs=com.maintainj.aspect,com.maintainj.inst,org.aspectj -Dorg.aspectj.tracing.enabled=false -Dorg.aspectj.tracing.factory=default %JAVA_OPTS%

call “standalone.bat” %* ENDLOCAL

————-

As highlighted in bold, MaintainJ sets its packages as the value of System property jboss.modules.system.pkgs. But, for some users, the MaintainJ configuration still fails even with this setting being there. Why?

The reason is, this property is overridden by user’s server settings in¬†standalone.conf.bat like in the line below.

set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman

If this is the case, the solution is to add MaintainJ’s system packages to this line like below.

set JAVA_OPTS=%JAVA_OPTS% -Djboss.modules.system.pkgs=org.jboss.byteman,com.maintainj.aspect,com.maintainj.inst,org.aspectj

This should resolve the issue.

–Choudary Kothapalli.

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by WordPress