Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

null pointer exception and illegalstateexception while tracing an application #168

Closed
AbhishekPuligundla opened this issue Sep 11, 2015 · 5 comments

Comments

@AbhishekPuligundla
Copy link

I am getting the following exception message when tracing an application with btrace
Exception in thread "main" java.lang.NullPointerException
at com.sun.btrace.client.Client.submit(Client.java:353)
at com.sun.btrace.client.Main.main(Main.java:189)
Exception in thread "Thread-0" java.lang.IllegalStateException
at com.sun.btrace.client.Client.send(Client.java:458)
at com.sun.btrace.client.Client.sendExit(Client.java:392)
at com.sun.btrace.client.Main$2.run(Main.java:226)
at java.lang.Thread.run(Thread.java:745)
Can you tell me whats wrong

@jbachorik
Copy link
Collaborator

Could you provide the BTrace version and possibly the script causing this failure?

@AbhishekPuligundla
Copy link
Author

i am using the btrace 1.3

The tracing is performed on tomcat web application. I imported my war file to the webapps folder of linux system which have already existing tomcat server and is being used by another application and i tried to trace both applications seperately with two different scripts but both the scripts generated the above error. I checked in another tomcat server installed later and its working fine. It's not working with the already existing tomcat.

The old tomcat is performing perfectly and the applicaitons(my war file and the preexisted application) are also running fine. Only the tracing is not working and exception message is generating

the script i used is like below:

import com.sun.btrace.annotations.;
import static com.sun.btrace.BTraceUtils.
;

@btrace
public class TraceTomcat
{

    @OnMethod(clazz="/comtomcatbtrace.*/",method="/.*/",location=@Location(value=Kind.ENTRY))

public static void traceMethod(@ProbeClassName String pcm, @ProbeMethodName String pmn)
{
println(pcm);
println(pmn);
}
@OnMethod(clazz="/javax.servlet../",method="/.*/",location=@location(Kind.RETURN))
public static void traceMethod2(@return String obj, @ProbeClassName String pcm, @ProbeMethodName String pmn)
{
println(strcat(strcat("The value returned from method ",pmn),strcat(" of class",pcm)));
}
}

@jbachorik
Copy link
Collaborator

Can you verify that the tomcat is running under the same user you are using when attaching with BTrace?

@jbachorik
Copy link
Collaborator

Could you reply, please? Otherwise I will close this issue.

@AbhishekPuligundla
Copy link
Author

Yes the tomcat is running under the same user. The error is not occurring after what i have done(explained in the #169).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants