Bulk JMX reconversion to 2.4 format

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Bulk JMX reconversion to 2.4 format

Sonam Chauhan-2
Due to new functionality I required, I upgraded my testsuite from JMeter
2.3.1 to 2.4.

However, I see that JMeter 2.4 cannot open my old JMX test scripts (more
than 200  scripts).*
My old test scripts are 2.3.1 and earlier.
*

From http://jakarta.apache.org/jmeter/changes.html

**

*The Avalon file format for JMX and JTL files is no longer supported. Any
such files will need to be converted by reading them in JMeter 2.3.4 and
resaving them.**

*

*
Is there any way to  bulk-convert them?
*
*

*
*
**
I can programmatically
**
open the scripts
**
in
**
non-GUI mode.
**
Is there a flag I can supply to the
**
JMeter 2.3.4
**
non-GUI invoke to make JMeter 'force-save' the JMX?
*


Regards

Sonam
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

shettyd
If I remember correctly there was a file called SaveService which had the
load and save methods that you could call from a custom program ?

regards
deepak

On Thu, Apr 28, 2011 at 7:33 PM, Sonam Chauhan <[hidden email]> wrote:

> Due to new functionality I required, I upgraded my testsuite from JMeter
> 2.3.1 to 2.4.
>
> However, I see that JMeter 2.4 cannot open my old JMX test scripts (more
> than 200  scripts).*
> My old test scripts are 2.3.1 and earlier.
> *
>
> From http://jakarta.apache.org/jmeter/changes.html
>
> **
>
> *The Avalon file format for JMX and JTL files is no longer supported. Any
> such files will need to be converted by reading them in JMeter 2.3.4 and
> resaving them.**
>
> *
>
> *
> Is there any way to  bulk-convert them?
> *
> *
>
> *
> *
> **
> I can programmatically
> **
> open the scripts
> **
> in
> **
> non-GUI mode.
> **
> Is there a flag I can supply to the
> **
> JMeter 2.3.4
> **
> non-GUI invoke to make JMeter 'force-save' the JMX?
> *
>
>
> Regards
>
> Sonam
>
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

Sonam Chauhan-2
There is an API class named 'SaveService' and a 'saveservice.properties'
configuration file.

The SaveService class has two interesting-looking methods:

static HashTree<http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html>
*loadTree<http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#loadTree(java.io.InputStream)>
*(InputStream<http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStream.html?is-external=true>
 reader)
          Load a Test tree (JMX file)

static void*saveTree<http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#saveTree(org.apache.jorphan.collections.HashTree,
java.io.OutputStream)>*(HashTree<http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html>
 tree, OutputStream<http://java.sun.com/j2se/1.5.0/docs/api/java/io/OutputStream.html?is-external=true>
 out)


Should I write a custom Java Program that reads in each of the 200 JMX files
in a loop, and calls the SaveService,loadTree and SaveService.saveTree
methods on each JMX?

Regards
Sonam



On Fri, Apr 29, 2011 at 12:46 PM, Deepak Shetty <[hidden email]> wrote:

> If I remember correctly there was a file called SaveService which had the
> load and save methods that you could call from a custom program ?
>
> regards
> deepak
>
> On Thu, Apr 28, 2011 at 7:33 PM, Sonam Chauhan <[hidden email]> wrote:
>
> > Due to new functionality I required, I upgraded my testsuite from JMeter
> > 2.3.1 to 2.4.
> >
> > However, I see that JMeter 2.4 cannot open my old JMX test scripts (more
> > than 200  scripts).*
> > My old test scripts are 2.3.1 and earlier.
> > *
> >
> > From http://jakarta.apache.org/jmeter/changes.html
> >
> > **
> >
> > *The Avalon file format for JMX and JTL files is no longer supported. Any
> > such files will need to be converted by reading them in JMeter 2.3.4 and
> > resaving them.**
> >
> > *
> >
> > *
> > Is there any way to  bulk-convert them?
> > *
> > *
> >
> > *
> > *
> > **
> > I can programmatically
> > **
> > open the scripts
> > **
> > in
> > **
> > non-GUI mode.
> > **
> > Is there a flag I can supply to the
> > **
> > JMeter 2.3.4
> > **
> > non-GUI invoke to make JMeter 'force-save' the JMX?
> > *
> >
> >
> > Regards
> >
> > Sonam
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

Sonam Chauhan-2
*Should I write a custom Java Program that reads in each of the 200 JMX
files in a loop, and calls the SaveService,loadTree and SaveService.saveTree
methods on each JMX?*

i.e. Something like the Java program below?  (unfortunately, it isn't
working yet)

Regards
Sonam

*ConvertJMX.java*
import java.io.*;
import org.apache.jmeter.save.SaveService;
import org.apache.jorphan.collections.HashTree;

public class ConvertJMX {

public static void main (String args []) {
String filename = "a.jmx";
FileInputStream reader = null;
 //Read file
try {
reader = new FileInputStream(filename);
System.out.println("Found file "+filename);
System.out.println("Attempting to load tree for "+filename);
HashTree tree = SaveService.loadTree(reader);
System.out.println("Loaded tree for "+filename);
//SaveService.saveTree(tree);

} catch (Exception e){
System.out.println("Problem in conversion of "+filename + ", error was: " +
e.toString());
System.exit (1);
}
}
}


On Fri, Apr 29, 2011 at 4:40 PM, Sonam Chauhan <[hidden email]> wrote:

> There is an API class named 'SaveService' and a 'saveservice.properties'
> configuration file.
>
> The SaveService class has two interesting-looking methods:
>
>  static HashTree<http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html>
> *loadTree<http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#loadTree(java.io.InputStream)>
> *(InputStream<http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStream.html?is-external=true>
>  reader)
>           Load a Test tree (JMX file)
>
>  static void*saveTree<http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#saveTree(org.apache.jorphan.collections.HashTree,+java.io.OutputStream)>
> *(HashTree<http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html>
>  tree, OutputStream<http://java.sun.com/j2se/1.5.0/docs/api/java/io/OutputStream.html?is-external=true>
>  out)
>
>
> Should I write a custom Java Program that reads in each of the 200 JMX
> files in a loop, and calls the SaveService,loadTree and SaveService.saveTree
> methods on each JMX?
>
> Regards
> Sonam
>
>
>
> On Fri, Apr 29, 2011 at 12:46 PM, Deepak Shetty <[hidden email]> wrote:
>
>> If I remember correctly there was a file called SaveService which had the
>> load and save methods that you could call from a custom program ?
>>
>> regards
>> deepak
>>
>> On Thu, Apr 28, 2011 at 7:33 PM, Sonam Chauhan <[hidden email]> wrote:
>>
>> > Due to new functionality I required, I upgraded my testsuite from JMeter
>> > 2.3.1 to 2.4.
>> >
>> > However, I see that JMeter 2.4 cannot open my old JMX test scripts (more
>> > than 200  scripts).*
>> > My old test scripts are 2.3.1 and earlier.
>> > *
>> >
>> > From http://jakarta.apache.org/jmeter/changes.html
>> >
>> > **
>> >
>> > *The Avalon file format for JMX and JTL files is no longer supported.
>> Any
>> > such files will need to be converted by reading them in JMeter 2.3.4 and
>> > resaving them.**
>> >
>> > *
>> >
>> > *
>> > Is there any way to  bulk-convert them?
>> > *
>> > *
>> >
>> > *
>> > *
>> > **
>> > I can programmatically
>> > **
>> > open the scripts
>> > **
>> > in
>> > **
>> > non-GUI mode.
>> > **
>> > Is there a flag I can supply to the
>> > **
>> > JMeter 2.3.4
>> > **
>> > non-GUI invoke to make JMeter 'force-save' the JMX?
>> > *
>> >
>> >
>> > Regards
>> >
>> > Sonam
>> >
>>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

shettyd
What error are you getting. You had to define jmeter_home or something like
that . Unfortunately I have no access to check. You might need to check with
jmeter dev.
On Apr 29, 2011 1:31 AM, "Sonam Chauhan" <[hidden email]> wrote:
> *Should I write a custom Java Program that reads in each of the 200 JMX
> files in a loop, and calls the SaveService,loadTree and
SaveService.saveTree

> methods on each JMX?*
>
> i.e. Something like the Java program below? (unfortunately, it isn't
> working yet)
>
> Regards
> Sonam
>
> *ConvertJMX.java*
> import java.io.*;
> import org.apache.jmeter.save.SaveService;
> import org.apache.jorphan.collections.HashTree;
>
> public class ConvertJMX {
>
> public static void main (String args []) {
> String filename = "a.jmx";
> FileInputStream reader = null;
> //Read file
> try {
> reader = new FileInputStream(filename);
> System.out.println("Found file "+filename);
> System.out.println("Attempting to load tree for "+filename);
> HashTree tree = SaveService.loadTree(reader);
> System.out.println("Loaded tree for "+filename);
> //SaveService.saveTree(tree);
>
> } catch (Exception e){
> System.out.println("Problem in conversion of "+filename + ", error was: "
+

> e.toString());
> System.exit (1);
> }
> }
> }
>
>
> On Fri, Apr 29, 2011 at 4:40 PM, Sonam Chauhan <[hidden email]> wrote:
>
>> There is an API class named 'SaveService' and a 'saveservice.properties'
>> configuration file.
>>
>> The SaveService class has two interesting-looking methods:
>>
>> static HashTree<
http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html
>
>> *loadTree<
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#loadTree(java.io.InputStream)
>
>> *(InputStream<
http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStream.html?is-external=true
>
>> reader)
>> Load a Test tree (JMX file)
>>
>> static void*saveTree<
http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#saveTree(org.apache.jorphan.collections.HashTree,+java.io.OutputStream)
>
>> *(HashTree<
http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html
>
>> tree, OutputStream<
http://java.sun.com/j2se/1.5.0/docs/api/java/io/OutputStream.html?is-external=true
>
>> out)
>>
>>
>> Should I write a custom Java Program that reads in each of the 200 JMX
>> files in a loop, and calls the SaveService,loadTree and
SaveService.saveTree
>> methods on each JMX?
>>
>> Regards
>> Sonam
>>
>>
>>
>> On Fri, Apr 29, 2011 at 12:46 PM, Deepak Shetty <[hidden email]>
wrote:
>>
>>> If I remember correctly there was a file called SaveService which had
the
>>> load and save methods that you could call from a custom program ?
>>>
>>> regards
>>> deepak
>>>
>>> On Thu, Apr 28, 2011 at 7:33 PM, Sonam Chauhan <[hidden email]> wrote:
>>>
>>> > Due to new functionality I required, I upgraded my testsuite from
JMeter
>>> > 2.3.1 to 2.4.
>>> >
>>> > However, I see that JMeter 2.4 cannot open my old JMX test scripts
(more

>>> > than 200 scripts).*
>>> > My old test scripts are 2.3.1 and earlier.
>>> > *
>>> >
>>> > From http://jakarta.apache.org/jmeter/changes.html
>>> >
>>> > **
>>> >
>>> > *The Avalon file format for JMX and JTL files is no longer supported.
>>> Any
>>> > such files will need to be converted by reading them in JMeter 2.3.4
and

>>> > resaving them.**
>>> >
>>> > *
>>> >
>>> > *
>>> > Is there any way to bulk-convert them?
>>> > *
>>> > *
>>> >
>>> > *
>>> > *
>>> > **
>>> > I can programmatically
>>> > **
>>> > open the scripts
>>> > **
>>> > in
>>> > **
>>> > non-GUI mode.
>>> > **
>>> > Is there a flag I can supply to the
>>> > **
>>> > JMeter 2.3.4
>>> > **
>>> > non-GUI invoke to make JMeter 'force-save' the JMX?
>>> > *
>>> >
>>> >
>>> > Regards
>>> >
>>> > Sonam
>>> >
>>>
>>
>>
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

Sonam Chauhan-2
Thanks Deepak. The error is an NPE (shown below) in
'org.apache.jmeter.samplers.SampleSaveConfiguration'. This is thrown when
calling this statement:

    HashTree tree = SaveService.loadTree(reader);

If this cannot be solved here, I'll try JMeter-dev.

Regards
Sonam

==============================================
# Compile ConvertJMX.java.
# Previously setup  dummy directory hierarchy for saveservice.properties
# (as setting JMETER_HOME did not work)
#
$ javac -cp "lib/*;lib/ext/*"  ConvertJMX.java


# Run with 'a.jmx'  being the JMX file to convert.
#
$ java -cp "lib/*;lib/ext/*;."  ConvertJMX a.jmx

Found file a.jmx
Attempting to load tree for a.jmx
INFO    2011-05-02 13:41:39.550 [jmeter.s] (): Testplan (JMX) version: 2.2.
Testlog (JTL) version: 2.2
INFO    2011-05-02 13:41:39.581 [jmeter.s] (): Using SaveService properties
file encoding ISO-8859-1
INFO    2011-05-02 13:41:39.583 [jmeter.s] (): Using SaveService properties
file version 1.2
Exception in thread "main" java.lang.ExceptionInInitializerError
        at java.lang.Class.forName0(Native Method)
        at java.lang.Class.forName(Class.java:169)
        at
org.apache.jmeter.save.converters.SampleSaveConfigurationConverter.class$(SampleSaveConfigurationConverter.java:65)
        at
org.apache.jmeter.save.converters.SampleSaveConfigurationConverter.canConvert(SampleSaveConfigurationConverter.java:98)
        at
com.thoughtworks.xstream.core.DefaultConverterLookup.registerConverter(DefaultConverterLookup.java:58)
        at
com.thoughtworks.xstream.XStream.registerConverter(XStream.java:981)
        at
com.thoughtworks.xstream.XStream.registerConverter(XStream.java:977)
        at
org.apache.jmeter.save.SaveService.initProps(SaveService.java:200)
        at org.apache.jmeter.save.SaveService.<clinit>(SaveService.java:148)
        at ConvertJMX.main(ConvertJMX.java:20)
Caused by: java.lang.NullPointerException
        at
org.apache.jmeter.samplers.SampleSaveConfiguration.<clinit>(SampleSaveConfiguration.java:288)
        ... 10 more
==============================================








On Sat, Apr 30, 2011 at 2:52 AM, Deepak Shetty <[hidden email]> wrote:

> What error are you getting. You had to define jmeter_home or something like
> that . Unfortunately I have no access to check. You might need to check
> with
> jmeter dev.
> On Apr 29, 2011 1:31 AM, "Sonam Chauhan" <[hidden email]> wrote:
> > *Should I write a custom Java Program that reads in each of the 200 JMX
> > files in a loop, and calls the SaveService,loadTree and
> SaveService.saveTree
> > methods on each JMX?*
> >
> > i.e. Something like the Java program below? (unfortunately, it isn't
> > working yet)
> >
> > Regards
> > Sonam
> >
> > *ConvertJMX.java*
> > import java.io.*;
> > import org.apache.jmeter.save.SaveService;
> > import org.apache.jorphan.collections.HashTree;
> >
> > public class ConvertJMX {
> >
> > public static void main (String args []) {
> > String filename = "a.jmx";
> > FileInputStream reader = null;
> > //Read file
> > try {
> > reader = new FileInputStream(filename);
> > System.out.println("Found file "+filename);
> > System.out.println("Attempting to load tree for "+filename);
> > HashTree tree = SaveService.loadTree(reader);
> > System.out.println("Loaded tree for "+filename);
> > //SaveService.saveTree(tree);
> >
> > } catch (Exception e){
> > System.out.println("Problem in conversion of "+filename + ", error was: "
> +
> > e.toString());
> > System.exit (1);
> > }
> > }
> > }
> >
> >
> > On Fri, Apr 29, 2011 at 4:40 PM, Sonam Chauhan <[hidden email]> wrote:
> >
> >> There is an API class named 'SaveService' and a 'saveservice.properties'
> >> configuration file.
> >>
> >> The SaveService class has two interesting-looking methods:
> >>
> >> static HashTree<
>
> http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html
> >
> >> *loadTree<
>
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#loadTree(java.io.InputStream)
> >
> >> *(InputStream<
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/io/InputStream.html?is-external=true
> >
> >> reader)
> >> Load a Test tree (JMX file)
> >>
> >> static void*saveTree<
>
> http://jakarta.apache.org/jmeter/api/org/apache/jmeter/save/SaveService.html#saveTree(org.apache.jorphan.collections.HashTree,+java.io.OutputStream)
> >
> >> *(HashTree<
>
> http://jakarta.apache.org/jmeter/api/org/apache/jorphan/collections/HashTree.html
> >
> >> tree, OutputStream<
>
> http://java.sun.com/j2se/1.5.0/docs/api/java/io/OutputStream.html?is-external=true
> >
> >> out)
> >>
> >>
> >> Should I write a custom Java Program that reads in each of the 200 JMX
> >> files in a loop, and calls the SaveService,loadTree and
> SaveService.saveTree
> >> methods on each JMX?
> >>
> >> Regards
> >> Sonam
> >>
> >>
> >>
> >> On Fri, Apr 29, 2011 at 12:46 PM, Deepak Shetty <[hidden email]>
> wrote:
> >>
> >>> If I remember correctly there was a file called SaveService which had
> the
> >>> load and save methods that you could call from a custom program ?
> >>>
> >>> regards
> >>> deepak
> >>>
> >>> On Thu, Apr 28, 2011 at 7:33 PM, Sonam Chauhan <[hidden email]>
> wrote:
> >>>
> >>> > Due to new functionality I required, I upgraded my testsuite from
> JMeter
> >>> > 2.3.1 to 2.4.
> >>> >
> >>> > However, I see that JMeter 2.4 cannot open my old JMX test scripts
> (more
> >>> > than 200 scripts).*
> >>> > My old test scripts are 2.3.1 and earlier.
> >>> > *
> >>> >
> >>> > From http://jakarta.apache.org/jmeter/changes.html
> >>> >
> >>> > **
> >>> >
> >>> > *The Avalon file format for JMX and JTL files is no longer supported.
> >>> Any
> >>> > such files will need to be converted by reading them in JMeter 2.3.4
> and
> >>> > resaving them.**
> >>> >
> >>> > *
> >>> >
> >>> > *
> >>> > Is there any way to bulk-convert them?
> >>> > *
> >>> > *
> >>> >
> >>> > *
> >>> > *
> >>> > **
> >>> > I can programmatically
> >>> > **
> >>> > open the scripts
> >>> > **
> >>> > in
> >>> > **
> >>> > non-GUI mode.
> >>> > **
> >>> > Is there a flag I can supply to the
> >>> > **
> >>> > JMeter 2.3.4
> >>> > **
> >>> > non-GUI invoke to make JMeter 'force-save' the JMX?
> >>> > *
> >>> >
> >>> >
> >>> > Regards
> >>> >
> >>> > Sonam
> >>> >
> >>>
> >>
> >>
>
Reply | Threaded
Open this post in threaded view
|

Re: Bulk JMX reconversion to 2.4 format

Barrie Treloar
On Mon, May 2, 2011 at 1:24 PM, Sonam Chauhan <[hidden email]> wrote:

> ==============================================
> # Compile ConvertJMX.java.
> # Previously setup  dummy directory hierarchy for saveservice.properties
> # (as setting JMETER_HOME did not work)
> #
> $ javac -cp "lib/*;lib/ext/*"  ConvertJMX.java
>
>
> # Run with 'a.jmx'  being the JMX file to convert.
> #
> $ java -cp "lib/*;lib/ext/*;."  ConvertJMX a.jmx
[del]
> Exception in thread "main" java.lang.ExceptionInInitializerError
>        at java.lang.Class.forName0(Native Method)
>        at java.lang.Class.forName(Class.java:169)
>        at

Are you sure the classpath is correct?
I'm guessing that you are getting errors because the a.jmx test case
contains references to classes it can't load.

Your a.jmx is stored in ${JMETER_HOME}?

---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]