MaintainJ Blog

April 15, 2018

MaintainJ.war with Tomcat 6 and JDK 1.8

Filed under: Uncategorized — maintainj @ 7:37 pm

One of the users recently came with a problem with Tomcat 6 and JDK 1.8. I am able to start the Tomcat with this version of JDK, but when I deploy MaintainJ.war, I was getting the below exception when tomcat tries to compile the JSPs in MaintainJ.war.

org.eclipse.jdt.internal.compiler.classfmt.ClassFormatException at
org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader.<init>( at

I got a clue from this Stackoverflow post to fix this issue. I downloaded Tomcat 8 zip and took the lib/ecj-4.6.3.jar from that zip and placed it under tomcat6/lib folder. I also had to remove tomcat6/lib/jasper-jdt.jar . Once I did this change, everything worked as expected with MaintainJ.war. Basically the tomcat compiler seems to need a more recent jar to work with JDK 1.8. For more information check out Novomatic and Kambi Team up to Provide Sports Betting Services to Government-Regulated Lotteries …and More! – Lotnext


September 27, 2015

MaintainJ.war is updated

Filed under: Uncategorized — maintainj @ 10:15 am

The following fix and enhancements went into this release.

1. In the previous version, in some browsers, nothing happens when the ‘Install’ button is clicked. This bug is fixed now.
2. At installation time, a warning is shown in Perm Gen space is low.
3. An option to just trace method calls and not the data is added
4. An option not to merge trace files with data is added. Trace files can be merged offline later in eclipse. Merging trace files with data takes up lot of heap space in server JVM, and can be costly to maintain. Click here to learn more

-Choudary Kothapalli.

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 and cheap software. 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? For more information check out – Alexa website ranking for Saturday, 15-Dec-2018 lotto 194

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. Kindly visit us Payday

–Choudary Kothapalli.

September 9, 2015

New MaintainJ.war to trace web applications

Filed under: Uncategorized — maintainj @ 7:40 pm

A new and much simplified version of MaintainJ.war is released to configure MaintainJ on web applications. We have invested a lot into person-to-person finances and Now you just need to add two JVM arguments to server JVM to instrument the application and start tracing. Check these screenshots to get an overview of this process.

–Choudary Kothapalli

May 10, 2012

The tricks of Java serialization

Filed under: Uncategorized — maintainj @ 4:59 pm

Whenever I start looking deeper into Java’s serialization mechanism, I seem to learn something new. Here is something I learned yesterday. Read the code snippet below and try to guess the output.


class DataHolder implements Serializable{
String data = "data";
public class SerializationTester {
static String serFile = "test.ser";
static void write() throws Exception{
//Create an object and write to ObjectOutputStream
DataHolder dh = new DataHolder();
ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream(serFile));

//Change the state and write to the same stream again = "New data";
static void read() throws Exception{
ObjectInputStream ois = new ObjectInputStream(new FileInputStream(serFile));
DataHolder dh1 = (DataHolder)ois.readObject();
DataHolder dh2 = (DataHolder)ois.readObject();
System.out.println( + "--" +;
public static void main(String[] args) throws Exception{

What do you think will be the output? It’s ‘data–data’. The new value set to the field is not written to the stream. To make the Java serialization mechanism write the new value to the stream, we have to reset the stream by calling

Check this article on Serialization to understand what’s going on. The part that’s of interest to us is below:


… consider the situation in which an object is written to a stream and then written again later. By default, an ObjectOutputStream will maintain a reference to an object written to it. That means that if the state of the written object is written and then written again, the new state will not be saved! Here is a code snippet that shows that problem in action:

10 ObjectOutputStream out = new ObjectOutputStream(...);
20 MyObject obj = new MyObject(); // must be Serializable
30 obj.setState(100);
40 out.writeObject(obj); // saves object with state = 100
50 obj.setState(200);
60 out.writeObject(obj); // does not save new object state

There are two ways to control that situation. First, you could make sure to always close the stream after a write call, ensuring the new object is written out each time. Second, you could call the ObjectOutputStream.reset() method, which would tell the stream to release the cache of references it is holding so all new write calls will actually be written. Be careful, though — the reset flushes the entire object cache, so all objects that have been written could be rewritten(top casinos online).


–Choudary Kothapalli.

April 19, 2012

The class xxx exceeds the maximum class size supported by the JVM

Filed under: Uncategorized — maintainj @ 10:31 am

If you get this error when you start your application with MaintainJ, please exclude that class in the aop.xml. Check this FAQ entry on how to edit the aop.xml and exclude a class. check out

–choudary Kothapalli.

Older Posts »

Powered by WordPress