NI TestStand

cancel
Showing results for 
Search instead for 
Did you mean: 

Problems accessing class in JAR file [err = -4000]

Hi, my setup is as follows ....

I have a seq file that is accessing a Java class file, TestStandClient.java. something like

public class TestStandClient
{
   public String test (String arg)
   {
      String returnVal = "";
      try
      {
         TestClass testClass = new TestClass ();
         returnVal = testClass .test (arg);
      }
      catch (Exception e)
      {
         returnVal = e .toString();
      }
     
      return returnVal;
   }

TestClass.java is
public class TestClass
{
   public String test (String arg)
   {
      return arg + " : [Jar object has modified string]";
   }
}

Now. TestClass is in a seperate jar. When TestStandClient :: test  is called i get a -4000 error. From the readme in the Java example file it is described as ....

Error reading returned string
The string returned from Java was corrupt. Verify that the return type of the Java method is a string value.

I have noticed if I take out the call to the object in the jar file then everything works ok.
Could it be a classpath problem? the StartJVM has its classpath pointing at the folder where the jar is and also at where the TestStandClient class file is. I also set the classpath for the Java step to be the same (location of jar and class file)

So, can someone inform me of what support TestStand has for java? Does it support communicating with a class file that itself depends on other JAR files? This is surely the case?

thanks in advance


0 Kudos
Message 1 of 2
(2,928 Views)
Dear PCR Barry,
 
I am afraid that I must agree with my colleague Kostas, who replied to your first teststand post. These are very tricky, indepth issues, and will require quite significant investigation. Furthermore, it will be very difficult for us to answer via the forums as we will likely need more input from yourself. As previously suggested, if you have a Standard Service Program (SSP), you can generate a Service Request by calling or e-mailing your local branch.

Thank you for your time, and I am sorry that I have been unable to help you further,

Best wishes,

Rich Roberts
Senior Marketing Engineer, National Instruments
Connect on LinkedIn: https://www.linkedin.com/in/richard-roberts-4176a27b/
0 Kudos
Message 2 of 2
(2,869 Views)