Fully featured low overhead profiler for Java EE and Java SE platforms.
Ultimate profiling and monitoring solution for Gradle, Maven, Ant, JUnit and TestNG.
Easy to use performance and memory profiler for .NET framework.

Error using profiler API

Moderators: Vladimir Kondratyev, Anton Katilin

Error using profiler API

Postby markjhvt » Wed Nov 11, 2009 3:42 pm

We're trying to automate some profiler runs. So, I've set the appropriate environment variables to enable the profiling agent. That works fine - the log file shows the agent is listening. Plus, viewing open ports on the system reveals the process is listening on port 10001.

However, when I try to use the .Net API to connect to the process (using the Controller class), I get the following exception:

Communication with failed.
The response contains incorrect data.
Unexpected null string

However, the UI is able to connect to the application just fine.
Any reason why the API is having a hard time connecting to the application?

-Mark-
markjhvt
 
Posts: 2
Joined: Wed Nov 11, 2009 3:37 pm

Re: Error using profiler API

Postby Vladimir Kondratyev » Thu Nov 12, 2009 4:34 pm

Mark, please send post here

1) full exception stack trace
2) Code snippet (Controller code) which you are using
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Error using profiler API

Postby Vladimir Kondratyev » Fri Nov 13, 2009 6:23 pm

Mark, I'm looking forward to hear from you.
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Error using profiler API

Postby markjhvt » Mon Nov 16, 2009 8:29 pm

Sorry I took so long to reply. I got involved in helping with a production issue, which we eventually found with the help of your profiler.

So, here is the full exception with stacktrace:

Code: Select all
System.Exception was unhandled
  Message="Communication with failed.\nThe response contains incorrect data.\nUnexpected null string"
  Source="YourKit.Profiler.Api"
  StackTrace:
       at YourKit.Profiler.Api.Packet.readStringNotNull(Stream inputStream)
       at YourKit.Profiler.Api.Controller..ctor(String host, Int32 port)
       at ProfilerTest.Program.Main(String[] args) in C:\Users\mhenry\Documents\Visual Studio 2008\Projects\ProfilerTest\ProfilerTest\Program.cs:line 12
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException:


And this is as far as I've gotten with the code:

Code: Select all
       
static void Main(string[] args)
        {
            YourKit.Profiler.Api.Controller controller = new YourKit.Profiler.Api.Controller("localhost", 10001);

        }


The constructor is what throws the exception. And there is an agent listening on port 10001 - I did make sure of that.

-Mark-
markjhvt
 
Posts: 2
Joined: Wed Nov 11, 2009 3:37 pm

Re: Error using profiler API

Postby Vladimir Kondratyev » Mon Nov 30, 2009 1:49 pm

We have managed to reproduce the problem. This bug will be fixed in upcoming version 4.5.5. Most probable it will be released today.
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany

Re: Error using profiler API

Postby Anton Katilin » Mon Nov 30, 2009 2:14 pm

Hello,

4.5.5 is available for download. It should solve the problem.
Anton Katilin
 
Posts: 5576
Joined: Wed Aug 11, 2004 8:37 am

Re: Error using profiler API

Postby Vladimir Kondratyev » Wed Dec 09, 2009 11:03 am

Mark, did version 4.5.5 fix the problem for you?
Vladimir Kondratyev
 
Posts: 1444
Joined: Tue Aug 10, 2004 7:52 pm
Location: Düsseldorf, Germany


Return to .NET Profiler

Who is online

Users browsing this forum: No registered users and 1 guest