You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@jmeter.apache.org by Sireesha Sridhara <ss...@avolent.com> on 2007/05/26 02:56:46 UTC

RE: java request

 
Hi all,
I wrote a class which extends AbstractJavaSamplerClient and implementd
all the methods. Now when I add a java request and run the test, it says
error and in the log it see the erros :  Exception creating: AVOClient
java.lang.InstantiationException: AVOClient
	at java.lang.Class.newInstance0(Unknown Source)

I think it is not able to instantioate the constructur. Are there any
security issues? Thanks in advance.
public class AVOClient extends AbstractJavaSamplerClient implements
               Serializable {

	// pass the string to be encrypted/decrypted
	public AVOClient() {
		System.out.println("trying to print");
  	}
	// any set up data
  	public void setupTest(JavaSamplerContext context) {
		System.out.println("trying to print");
  	}
  	public Arguments getDefaultParameters() {
		System.out.println("trying to print");
    		Arguments params = new Arguments();
    		//params.addArgument("decid", "yuig");
    		return params;
  	}


	// run the program here
  	public SampleResult runTest(JavaSamplerContext context) {
		System.out.println("trying to print");
    		SampleResult results = new SampleResult();
		results.sampleStart();
		results.setResponseCode("200");
		results.setSampleLabel("my label");
	
results.setResponseData("dfd"+context.getParameter("decid"));
		results.setSuccessful(true);
		results.sampleEnd();
    		return results;
  	}

  	public void teardownTest(JavaSamplerContext context) {
		System.out.println("trying to print");
  	}

}

Thank you,
Sireesha Sridhara.

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org


Re: java request

Posted by sebb <se...@gmail.com>.
Make sure that the class is in a jar, and the jar is in lib/ext

On 26/05/07, Sireesha Sridhara <ss...@avolent.com> wrote:
>
> Hi all,
> I wrote a class which extends AbstractJavaSamplerClient and implementd
> all the methods. Now when I add a java request and run the test, it says
> error and in the log it see the erros :  Exception creating: AVOClient
> java.lang.InstantiationException: AVOClient
>        at java.lang.Class.newInstance0(Unknown Source)
>
> I think it is not able to instantioate the constructur. Are there any
> security issues? Thanks in advance.
> public class AVOClient extends AbstractJavaSamplerClient implements
>               Serializable {
>
>        // pass the string to be encrypted/decrypted
>        public AVOClient() {
>                System.out.println("trying to print");
>        }
>        // any set up data
>        public void setupTest(JavaSamplerContext context) {
>                System.out.println("trying to print");
>        }
>        public Arguments getDefaultParameters() {
>                System.out.println("trying to print");
>                Arguments params = new Arguments();
>                //params.addArgument("decid", "yuig");
>                return params;
>        }
>
>
>        // run the program here
>        public SampleResult runTest(JavaSamplerContext context) {
>                System.out.println("trying to print");
>                SampleResult results = new SampleResult();
>                results.sampleStart();
>                results.setResponseCode("200");
>                results.setSampleLabel("my label");
>
> results.setResponseData("dfd"+context.getParameter("decid"));
>                results.setSuccessful(true);
>                results.sampleEnd();
>                return results;
>        }
>
>        public void teardownTest(JavaSamplerContext context) {
>                System.out.println("trying to print");
>        }
>
> }
>
> Thank you,
> Sireesha Sridhara.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: jmeter-user-help@jakarta.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: jmeter-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: jmeter-user-help@jakarta.apache.org