Recent Posts

Pages: 1 2 [3] 4 5 ... 10
21
Good to know that the issue is resolved.

Thanks,
Choudary Kothapalli.
22
Support / Resolved
« Last post by Marcipicus on March 25, 2011, 05:23:06 PM »
After looking at the man page for the OpenJDK implementation of the java program the classpath separates entries
using ':' instead of ';' which are used in windows. Something to be aware of if anyone else runs into the same problem.

From the java man page for openJDK implementation
Code: [Select]
          -classpath classpath

          -cp classpath
             Specify a list of directories, JAR archives, and ZIP archives to search for class files. Class path  entries  are
             separated  by  colons  (:). Specifying -classpath or -cp overrides any setting of the CLASSPATH environment vari-
             able.

Fixed generic bash executable
Code: [Select]
#!/bin/bash

echo "***Starting with MaintainJ***"

#Set your application classpath
APPLICATION_CLASSPATH="<<Your_Application_Jar(s)_OR_Folder(s)>>"

#Do not change the two lines below
MJ_LIB=@INSTALL_HOME@
MJ_CLASSPATH="$MJ_LIB/aspect:$MJ_LIB/MaintainJAspect.jar:$MJ_LIB/aspectjweaver.jar;"

#This line adds MaintainJ related JVM argument. If your application needs
#more arguments, you may add them here
JAVA_OPTS="-javaagent:$MJ_LIB/aspectjweaver.jar"

java $JAVA_OPTS -classpath $MJ_CLASSPATH:$APPLICATION_CLASSPATH @MAIN_CLASS@
23
Support / Environment JVM information
« Last post by Marcipicus on March 25, 2011, 04:55:31 PM »
Here's the version info for the jdk that I'm using.

Code: [Select]
bash-4.1$ java -version
java version "1.6.0_18"
OpenJDK Runtime Environment (IcedTea6 1.8.1) (fedora-42.b18.fc13-i386)
OpenJDK Server VM (build 14.0-b16, mixed mode)
24
Support / Debug output from bash -x with and without MJ_CLASSPATH
« Last post by Marcipicus on March 25, 2011, 01:30:15 PM »
Here's the output when MJ_CLASSPATH is not added to the java call

Code: [Select]
bash-4.1$ bash -x start_with_maintainj.sh > NoMJ_CLASSPATH.txt
+ echo '***Starting with MaintainJ***'
+ VIDEOCLIENT_DIR=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient
+ APPLICATION_CLASSPATH=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/dist/VisualClient-1.0.jar
+ MJ_LIB=/home/LABS/msammon/MDrive-msammon/MaintainJTrace
+ MJ_CLASSPATH='/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspect;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/MaintainJAspect.jar;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar;'
+ JAVA_OPTS=-javaagent:/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar
+ PROGRAM_OPTS=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/visualClientConf.txt
+ java -javaagent:/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar -classpath /home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/dist/VisualClient-1.0.jar gui.VideoClient /home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/visualClientConf.txt

Here's the output when MJ_CLASSPATH is added to the java call

Code: [Select]
bash-4.1$ bash -x start_with_maintainj.sh > NoMJ_CLASSPATH.txt
+ echo '***Starting with MaintainJ***'
+ VIDEOCLIENT_DIR=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient
+ APPLICATION_CLASSPATH=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/dist/VisualClient-1.0.jar
+ MJ_LIB=/home/LABS/msammon/MDrive-msammon/MaintainJTrace
+ MJ_CLASSPATH='/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspect;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/MaintainJAspect.jar;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar;'
+ JAVA_OPTS=-javaagent:/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar
+ PROGRAM_OPTS=/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/visualClientConf.txt
+ java -javaagent:/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar -classpath '/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspect;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/MaintainJAspect.jar;/home/LABS/msammon/MDrive-msammon/MaintainJTrace/aspectjweaver.jar;;/home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/dist/VisualClient-1.0.jar' gui.VideoClient /home/LABS/msammon/MDrive-msammon/repo-rt/trunk/AirplaneVisualClient/visualClientConf.txt
Exception in thread "main" java.lang.NoClassDefFoundError: gui/VideoClient
Caused by: java.lang.ClassNotFoundException: gui.VideoClient
at java.net.URLClassLoader$1.run(URLClassLoader.java:217)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:205)
at java.lang.ClassLoader.loadClass(ClassLoader.java:321)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:294)
at java.lang.ClassLoader.loadClass(ClassLoader.java:266)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:334)
Could not find the main class: gui.VideoClient. Program will exit.
25
Hi I'm trying to generate trace files using the MaintainJSwingWizard utility on linux. I created a bash script which is pasted at the bottom

if I run the java command using just the APPLICATION_CLASSPATH variable then it will run but as soon as I add the MJ_CLASSPATH then
I receive a ClassNotFoundException from Java. Order of the CLASSPATH variables doesn't change anything.

Is there something I'm overlooking in the script?

If anyone can let me know what's causing this it would be greatly appreciated.

Here's start_with_maintainj.sh

Code: [Select]
#!/bin/bash

echo "***Starting with MaintainJ***"

VIDEOCLIENT_DIR="~/repo-rt/trunk/AirplaneVisualClient"
#Set your application classpath
APPLICATION_CLASSPATH="$VIDEOCLIENT_DIR/dist/VisualClient-1.0.jar"

#Do not change the two lines below
MJ_LIB=~/MaintainJTrace
MJ_CLASSPATH="$MJ_LIB/aspect;$MJ_LIB/MaintainJAspect.jar;$MJ_LIB/aspectjweaver.jar;"

#This line adds MaintainJ related JVM argument. If your application needs
#more arguments, you may add them here
JAVA_OPTS="-javaagent:$MJ_LIB/aspectjweaver.jar"

PROGRAM_OPTS="$VIDEOCLIENT_DIR/visualClientConf.txt"

#the commented line will generate a class not found exception
#java $JAVA_OPTS -classpath "$MJ_CLASSPATH;$APPLICATION_CLASSPATH" gui.VideoClient $PROGRAM_OPTS

#running without the MJ_CLASSPATH will not generate the exception
java $JAVA_OPTS -classpath "$APPLICATION_CLASSPATH" gui.VideoClient $PROGRAM_OPTS
26
Support / Re: Viewing sequence diagrams of multiple threads using junit
« Last post by Choudary Kothapalli on February 12, 2010, 06:20:07 PM »
MaintainJ does support multiple threads in JUnit. In fact it supports multiple threads in any Java application and does not treat JUnit any differently. Here is a sample application to illustrate a multi-threaded JUnit test.

TestThread.java
----------------------
package test;
public class TestThread extends Thread {   
   void m1(int i){
   }   
   public void run(){
      m1(1);
   }
}
 
Main.java
-----------------
package test;
public class Main{   
   public void runThread(){
      TestThread t1 = new TestThread();      
      t1.start();
   }   
}

SampleTest.java
----------------------
package test;
import junit.framework.TestCase;
public class SampleTest extends TestCase {
    public void testTestThread() {
       Main timer = new Main();
       timer.runThread();
    }
}

The sequence diagrams generated are as below.
testTestThread_AllThreads.ser
testTestThread_main.ser
testTestThread_Thread-0.ser

May be if you give me more details of your application, I can point out the problem.

Thanks,
Choudary Kothapalli.
27
Support / Viewing sequence diagrams of multiple threads using junit
« Last post by dlananona on February 12, 2010, 11:22:40 AM »
I have been looking over maintainJ and it seems like it could be useful.  My first experiment with it involved running a junit test which invokes several threads.  The output that was produced only showed the sequence for the main thread for the calls in my package of interest.  Is output for multiple threads supported within junit?
28
Support / Re: Compile-time weaver instead of Runtime weaver
« Last post by Choudary Kothapalli on February 09, 2010, 07:38:50 AM »
We moved to runtime weaving because compile time weaving was time taking and was resulting in OutOfMemoryError often. With runtime weaving only the classes loaded into the memory are instrumented and is generally faster.

If your intention is to instrument a single jar instead of the entire application so that the memory issues can be avoided, that is something we can try. But if you want to instrument the entire application, compile time weaving wouldn't give much benefit, I suspect.

First give me an idea of your application size. What is the number of classes in the application and what is the type of the application?

Thanks,
Choudary Kothapalli.
29
Support / Re: Compile-time weaver instead of Runtime weaver
« Last post by krash on February 08, 2010, 09:50:39 PM »
Yes, I'm looking for something like that as Runtime-weaving is very slow in my case...(the app would just not come up)

I can select the jars I want to instrument and specify the filter, and the tool will do the rest...
30
Support / Re: Compile-time weaver instead of Runtime weaver
« Last post by Choudary Kothapalli on February 08, 2010, 07:05:20 PM »
Hi Krishna,

There is no GUI tool to perform what you are asking, but I can help you to do that. First let me confirm if I understand your requirement.

1. You have an application that consists of multiple jar files.
2. You want to instrument the jar files at the compile time. Then you will include the instrumente jar files in your application. If your application is packaged as ear file, the ear file will have instrumented jar files.
3. You will put the AspectJ and MaintainJ related libraries in your application classpath so that the instrumented jars will work at runtime.

First let me know if this is waht you have in your mind.

Thanks,
Choudary.
Pages: 1 2 [3] 4 5 ... 10