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

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 R
Applications Engineer
National Instruments UK & Ireland

Similar Messages

  • Problem accessing class in jar file

    Hello. I am trying to create a jar file from my already compiled classes. I have around 5 packages, and my programs' entry point is in one of the packages, we'll call package A. Each package has its own purpose and package A calls any needed package to perform their task. This works well when I compile, run and all. However, when I create a jar file, it only works with the local package and any calls to another package do not work. How can I get around this? any help will be appreciated

    This is the output..
    05/05/2010  10:19 AM        10,946,787 MYJAR.jar
                   1 File(s)     10,946,787 bytes
                   0 Dir(s)   1,434,251,264 bytes freeMy manifest file contains
    Manifest-Version: 1.0
    Class-Path: .
    Main-Class: Login.loginMain
    AndrewThompson64 wrote:Is the code [swallowing exceptions|http://pscode.org/javafaq.html#stacktrace] at any point?
    Nope..
    AndrewThompson64 wrote:
    How do you know that if there is absolutely no error output?The when I ran the code from my compiler, it has no errors, and it works smoothly. I have used a JAR for a single package program before and it worked well but this multiple package program is giving me the problem and I don't want to put all the files in a single package

  • Problem accessing sounds in jar file

    Hi,
    I have made a program and packed it to a jar file.
    Everything works fine in the IDE, so this is purely a matter of jar access.
    The jar has 6 folders.
    framework (which is one of my packages)
    META-INF
    sound (also my package)
    sounds (my wav files for the program)
    sprite (another package)
    sprites (my graphics for the program).
    I access the graphics in sprites, from a class in sprite and have no problem with it.
    try {               
                   URL url = this.getClass().getClassLoader().getResource(ref);               
                   if (url == null) {
                        fail("Kan ikke finde ref: "+ref);
                   sourceImage = ImageIO.read(url);
              } catch (IOException e) {
                   fail("fejl ved load: "+ref);
              }The problem is accessing the wav file in the sounds folder from a class in the sound folder.
    try{
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File("Sounds/1999.wav"));
                   AudioFormat format = stream.getFormat();
                   DataLine.Info info = new DataLine.Info(Clip.class, stream.getFormat(),
                             ((int)stream.getFrameLength()*format.getFrameSize()));
                   clip = (Clip) AudioSystem.getLine(info);
                   clip.open(stream);
              }I have tried to use the class loader like this (instead of AudioSystem.getAudioInputStream) :
    AudioInputStream stream = (AudioInputStream) this.getClass().getClassLoader().getResourceAsStream("sounds/1999.wav");          
    but it didnt help.
    Does anyone have any suggestione?
    Please, if all you can do, is paste a link to the java API, save your energy. I have already looked and it was no help, as im still only a student of java.
    I would like an actual suggestion, so i can see it work, then i can make work my way through the API from there.
    Edited by: Mondariz on May 7, 2008 8:26 AM

    Don't try to use a File object to access resources from the jar. You have a working process for accessing the sprites, just use the same process to access the sounds. Only not quite the same method, there's one method which returns a URL and a very similar method which returns an InputStream. I would post the link to the documentation but you asked for us to not do that. Anyway you seem to know where it is.

  • Problems accessing resources in JAR Files

    Hi all,
    i'm using a third party software which isb trying to access a configuration file (xml file) residing inside its jar files.
    Without Webstart there are now problems, when deploying the software with Webstart, the resources could not be found.
    The software installs an streamhandler which handles all access to its resources.
    When this handler is instantiated, a Classloader is provided via Thread.currentThread()..getContextClassLoader().
    As i can see this classloader (and only this-) instance is used when resources are acessed.
    The classloader instance seems to me to be the correct one of type ...JNLPClassLoader.
    As i figured out the classloader is able to acess the resource In the Moment when the Handler is instantiated.
    But later in the code (inside of the Handler) any call of getResource() with identical parameter for the resource name fails.
    The classloader instance is the same as in the previous calls (which i have added for debug).
    The Handler class resides in a different jar file as the resource, but i have also tried to put them in one jar file achieving the same result.
    Has anyone an idea what is going wrong ?
    The application has "all-permissions" granted, but suprisingly i'm receiving an security exception when trying to call Class.getProtectactionDomain() inside of the Handler class.
    Could it be a security problem ?
    Thank you.
    Andrej
    Message was edited by:
    a.rippich
    Message was edited by:
    a.rippich

    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 R
    Applications Engineer
    National Instruments UK & Ireland

  • How to access classes in jar files

    hi I have added a jar file to my project in eclipse.How to access the classes in that jar file?

    cu is right.
    classloader returns the URL of your resource. You can the jar using something like the following...
    ClassLoader classloader = this.getClassLoader();
    url = classloader.getResource("your_resouces...");
    if(url == null)
    System.out.println("cannot find resource ");
    return null;
    String jar = url.getFile();
    jar = jar.substring(jar.indexOf("/")+1, jar.lastIndexOf("!")).replace('/', '\\');
    obviously, this code snippet works on windows only. Now you have the jar file path. I use Jar file classes to access the jar file. (e.g. you can search for each class files)
    Ming

  • Problem finding class in jar file

    I have an applet that will run when I have all the classes sitting in the same directory. ex) http://IPaddress/directory. But I try to put them all into a jar file and run the code and it says cant find the class. Below is my html code. Please help!
    <HTML>
    <HEAD>
    </HEAD>
    <BODY>
    <APPLET
    CODEBASE="http://IPaddress/directory1/directory2"
    CODE="Applet.class"
    ARCHIVE="1stJar.jar,2ndJar.jar,3rdJar.jar,Applet.jar"
    WIDTH=600 HEIGHT=600>
    </APPLET>
    </BODY>
    </HTML>

    Where are your jar files contained? They need to be in the same directory as your CODEBASE, or otherwise include a relative directory.
    Also, what browser are you using?
    From the Java web page on APPLET tags
    "Unfortunately, not all browsers understand the same archive format or use the same HTML code to specify the applet archive"

  • Problem accessing Application Ejb Jar files from Apache Axis jars

    I have deployed an EAR application, with a structure as shown below,
    MyApp.ear
    |____ MyApp_Ejb.jar
    |____ axis.war
    |_____ WEB-INF
    |_____ lib (This contains all axis specific jars)
    The application deploys just fine. But when i goto happyaxis.jsp and try to view all the web services that have been deployed. I get an exception "No provider type matches QName '{http://xml.apache.org/axis/wsdd/providers/java}SDL".
    Here SDL is a custom provider that i have written and all the required files for the provider are available in MyApp_Ejb.jar.
    I do not get as to why the axis.jar is not able to find classes in MyApp_Ejb.ear, when both these are in the same ear.
    Now i know i can add a utility jar to a war files classpath by adding a classpath line in the War file MANIFEST.MF. But since MyApp_Ejb.jar is defined as a Web Module this solution too doesnt help.
    Separating the provider related files from MyApp_Ejb.jar is not possible since there is too much dependance of other files within that jar.
    So i am looking for a solution where in i can continue to have MyApp_Ejb.jar as my ejb module as well as the axis related jars can find the required classes within MyApp_Ejb.jar. some way of sharing the ejb jar across to axis jars.
    Thanks in advance.
    Vicky

    I have deployed an EAR application, with a structure as shown below,
    MyApp.ear
    |____ MyApp_Ejb.jar
    |____ axis.war
    |_____ WEB-INF
    |_____ lib (This contains all axis specific jars)
    The application deploys just fine. But when i goto happyaxis.jsp and try to view all the web services that have been deployed. I get an exception "No provider type matches QName '{http://xml.apache.org/axis/wsdd/providers/java}SDL".
    Here SDL is a custom provider that i have written and all the required files for the provider are available in MyApp_Ejb.jar.
    I do not get as to why the axis.jar is not able to find classes in MyApp_Ejb.ear, when both these are in the same ear.
    Now i know i can add a utility jar to a war files classpath by adding a classpath line in the War file MANIFEST.MF. But since MyApp_Ejb.jar is defined as a Web Module this solution too doesnt help.
    Separating the provider related files from MyApp_Ejb.jar is not possible since there is too much dependance of other files within that jar.
    So i am looking for a solution where in i can continue to have MyApp_Ejb.jar as my ejb module as well as the axis related jars can find the required classes within MyApp_Ejb.jar. some way of sharing the ejb jar across to axis jars.
    Thanks in advance.
    Vicky

  • Where to put common classes and jar files

    hi,
    i want to put some classes and jar files in a common folder so that it can be accessed by other applications is there any way doing that.In tomcat server they have common and shared directories once any classes are into that folder they are being accessed easily ,but i am having problems with sun one .
    Regards
    Ameem Sami

    Did you find a solution for this? I'm having the same problem.
    Thanks,
    Tony

  • How to access additional supporting jar files from EJB JAR?

    Hi,
    How can we access additional supporting jar files as part of my EJB JAR .
    I don't want to keep them in the top level because other EJB JAR files also has
    the same jar files(code in the classes in the jar is slightly different)
    can I keep the additional jar files in my EJB JAR?
    Thanks
    NLB

    Include the supporting jar files in the Ejb jar file.
    Specifiy the jar files in the Ejb jar manifest file.
    Manifest-Version: 1.0 [CRLF]
    Class-Path: utility.jar [CRLF]
    thanks,
    Deepak
    "NLB" <[email protected]> wrote:
    >
    Hi,
    How can we access additional supporting jar files as part of my EJB JAR
    I don't want to keep them in the top level because other EJB JAR files
    also has
    the same jar files(code in the classes in the jar is slightly different)
    can I keep the additional jar files in my EJB JAR?
    Thanks
    NLB

  • How to access the database jar file using the derby 10.2.1.6 database ?

    Hi,
    How to access the database jar file using the derby 10.2.1.6 database ?
    I have used like below. And i am getting the following the error:
    "org.apache.tomcat.dbcp.dbcp.SQLNestedException: Cannot load JDBC driver class 'org.apache.derby.jdbc.EmbeddedDriver'
    at org.apache.tomcat.dbcp.dbcp.BasicDataSource.createDataSource(BasicDataSource.java:1136)"
    My context.xml file looks like this:
    <Context crossContext="true">
    <Resource name="jdbc/derby" auth="Container"
    type="javax.sql.DataSource" driverClassName="org.apache.derby.jdbc.EmbeddedDriver"
    url="jdbc:derby:jar(\CalypsoDemo\database.jar)samples"
    username="xxx" password="xxx" maxActive="20" maxIdle="10"
    maxWait="-1"/>
    </Context>
    What could be the reason.?
    Any suggestions will be appriciated.
    Thanks in Advance,
    Gana.

    ya, I have restarted. Can you please tell me whether the path which i am giving is right or not in the context file?
    Thanks,
    Gana.

  • Can I increase heap memory without specify any class or jar file??

    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    where options include:
    -client to select the "client" VM
    -server to select the "server" VM
    -hotspot is a synonym for the "client" VM [deprecated]
    The default VM is client.
    -cp <class search path of directories and zip/jar files>
    -classpath <class search path of directories and zip/jar files>
    A ; separated list of directories, JAR archives,
    and ZIP archives to search for class files.
    -D<name>=<value>
    set a system property
    -verbose[:class|gc|jni]
    enable verbose output
    -version print product version and exit
    -version:<value>
    require the specified version to run
    -showversion print product version and continue
    -jre-restrict-search | -jre-no-restrict-search
    include/exclude user private JREs in the version search
    -? -help print this help message
    -X print help on non-standard options
    -ea[:<packagename>...|:<classname>]
    -enableassertions[:<packagename>...|:<classname>]
    enable assertions
    -da[:<packagename>...|:<classname>]
    -disableassertions[:<packagename>...|:<classname>]
    disable assertions
    -esa | -enablesystemassertions
    enable system assertions
    -dsa | -disablesystemassertions
    disable system assertions
    -agentlib:<libname>[=<options>]
    load native agent library <libname>, e.g. -agentlib:hprof
    see also, -agentlib:jdwp=help and -agentlib:hprof=help
    -agentpath:<pathname>[=<options>]
    load native agent library by full pathname
    -javaagent:<jarpath>[=<options>]
    load Java programming language agent, see java.lang.instrument
    -splash:<imagepath>
    show splash screen with specified image
    can I increase heap memory without specify any class or jar file??
    thx

    chiara wrote:
    Hi,
    I tried to increase my heap memory in this way :
    java -Xms256m -Xmx256m
    but I got an error ... it's seem that I must specify a class java or a .jar file ...
    This is the error :
    Usage: java [-options] class [args...]
    (to execute a class)
    or java [-options] -jar jarfile [args...]
    (to execute a jar file)
    can I increase heap memory without specify any class or jar file??The job of java.exe is to execute java bytecode.
    What is it supposed to do with your request to use 256m of memory for heap
    when you are not giving it a class or a jar to run?

  • Ojvmtc reports xy.jar is not a class or jar file

    Hi
    I am a little bit confuced because ojvmtc reports an error I can not imagine about:
    oracle@cikic-desktop:~/Downloads/dom4j-1.6.1$ ojvmtc /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar is not a class or jar file
    The set is closed
    But jce.jar is a jar file and I can inflate it:
    oracle@cikic-desktop:/tmp/fo$ jar -xf /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar
    oracle@cikic-desktop:/tmp/fo$ ls -l
    total 8
    drwxr-xr-x 3 oracle oinstall 4096 2010-05-03 19:40 javax
    drwxr-xr-x 2 oracle oinstall 4096 2010-05-03 19:40 META-INF
    And if I do a ojvm on a class file everything is working like expected:
    oracle@cikic-desktop:/tmp/fo$ ojvmtc javax/crypto/Mac.class
    The set is not closed
    96 classes are missing
    So It must be a configuration mistake somewhere ...
    Can you please help me out.
    Thanks
    Christian Maier

    Coole thanks, this works pretty well!
    Chris
    oracle@cikic-desktop:~$ cp /u01/app/oracle/product/11.1.0/mds/jdk/jre/lib/jce.jar /tmp/
    oracle@cikic-desktop:~$ ojvmtc /tmp/jce.jar
    The set is not closed
    131 classes are missing

  • Problem Accessing Class in my package from jsp file

    Hi,
    I am using Apache tomcat server and i have made package which contains a class for database connection. I have imported this package in my jsp file but when i run the jsp tomcat gives the class not found exception. i have placed the jsp file in /webapps/my_project/ folder and the package in the /webapps/my_project/WEB-INF/classes/ folder.
    Still its not working.
    Please help me out!!!!!!!!

    hi,
    Thanks for ur reply. You have guessed it right, i dont have a .jar file its a .class file in a package subfolder. I have tried out ur suggestion but it didnt work. The following error i shown when i run it.
    org.apache.jasper.JasperException: Unable to compile class for JSPNote: sun.tools.javac.Main has been deprecated.
    C:\Apache Tomcat 4.0\work\localhost\_\College\test$jsp.java:4: Package college_lib not found in import.
    import college_lib.*;
    ^
    1 error, 1 warning
    Here, College_lib is the package name which contains the class my class file
    Is there any problem with my Apache Tomcat4.0 or any other thing.
    Message was edited by:
    Despo

  • Problem loading Applets from Jar files on 64 bit machine

    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases. The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Below are all of my test results. Can someone provide a suggestion for repairing this? The Windows Server machine is a clients computer I access to it via remote desktop but I can't do much with it though I do have administrator rights. The Windows 7 machine is my development platform so I have been able to do extensive testing on it.
    This problem is presenting in the following environments when trying to load an applet from JAR files in a HTML document using the Applet or Object tag.
    Windows Server 2008 (Intel Chipset)
    Tested Browsers:
    Internet Explorer 9 (32 bit) - Shows it is blocked by default then simply shows an x when loaded from a web page, same result when loading from local drive.
    Windows 7 Home Premium (AMD Chipset)
    Tested Browsers:
    Firefox 6.0.1 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    Internet Explorer 9 (64 bit) - Java logo shows with spinner and most of the windows desktop manager freezes, keyboard is the only thing that responds so you can alt-tab to another app to regain control of the desktop.
    Chrome (32 bit) - Java logo shows with spinner, after a few minutes there is finally an error that a class in the jar was not found
    The only way I have been able to get a Java applet to run on a 64 bit machine are the following ways.
    Firefox 9 nightly (64 bit) works perfectly! Go Firefox!
    Internet Explorer 9 (32 bit) loading directly from drive (c:\...)
    Chrome (32 bit) loading directly from drive (c:\...)
    Firefox 6.0.1 (32 bit) loading directly from drive (c:\....)
    Can someone please help! I've been fighting with this bug for over a week and I can't find anything that will solve it, I have noticed that in some cases if my jar has very little code in it than it will run on the server, but the minute I start adding things to it the jar won't load anymore.

    jschell wrote:
    rritoch wrote:
    I am developing an applet (extends Applet but uses swing components) using JDK 1.6 (Though these problems still happen in JDK 1.7) and I am unable to get the applet to load on a 64 bit machine in most cases.
    To clarify...
    1. You have tried it on 32 bit machine? Exactly which OS?I tested this on Windows Vista Business which is in 32 bit mode and the applets run without any problems
    >
    2. Your only 64 bit tests have involved 2008/Win7?
    If so then I would suspect something with windows not java. Probably permissions.
    The web server(s) are running on localhost and I am connecting on the same machine using a local network ip address (such as 192.168.*.*)
    Yes, I haven't tried running the jars on other operating systems.
    >
    I don't understand that. If you are running on localhost then you should connect to localhost. If running on an IP then you should connect to that. Perhaps you meant that you have tested using both of those?I'm testing using the lan ip address but I'm connecting from the same machine. I've tried localhost and that didn't work so I tried lan ip since that will likely have a different java security context than localhost. At first I was blaming the IIS server but I downloaded the jar directly and using HTTP fox was able to verify that the jar is being sent with the correct mime-type and that the server can upload the jar file without a problem. This leaves me to believe the problem is with Java.

  • Problem with addition of jar file to DC

    Hi WDers,
    I have a DC of type WD.
    I'm trying to add com.sap.security.api.jar file to this component so that I can get IUser and work on it.
    I have added this security jar file as an External jar file to the DC. But whenever I try to DC->Build, the jar entry is going away. So the Build is failing.
    Can you kindly let me know why this is happening?
    Or is there any other way to add a jar file so that I can use the IUser interface in my view?
    Thanks in Advance
    RK

    Hello,
    Add the Standard DC "com.sap.security.api.sda" from the SAP-JEE. This ahould solve the problem.
    To do that follow the steps:
    1. Go to the "DC Metadata" option available under the DC.
    2. Go to "Used DCs" and choose "Add used DCs" from the context menu which appears on a right click at the Used Dcs option.
    3.Select "com.sap.security.api.sda" under SAP-JEE and choose finish.
    4. Build the DC to gain access to the IUser and other related classes.
    Bala.

Maybe you are looking for

  • Audigy AUD_EXT 'line out' questi

    I found the details for the pin assignments on the AUD_EXT connector for my Audigy card. Using this information I was able to connect an old SP-DIF connector (with optical & coaxial outputs) from an old motherboard to my Audigy, and I'm now using the

  • "Unable to communicate with server error" when pasting data in in list via edit

    Hi Guys, I imported data into a SharePoint site and it seems that it made the fields in to multiline, so I had to edit each colum and make it single, but when I did that it seems that the html font code also detached and views in the record as you ca

  • CS6 or CS6 (64 Bit)

    I bought the CS6 Design & Web Premium. When I did the download I notice this two programs: Adobe Photoshop CS6 and Adobe Photoshop CS6 (64 Bit). My questions are, what is the difference between them? Should I download both of them? Which one should I

  • After rendering video the audio is no longer in sync. Stumped on what's wrong.

    I am working on a project similar to others I have done. This is in CS5 with Premiere Pro. The video is a .m4v at 1080p and 23.976. Audio is 48Hz 16-bit stereo wave. In editing the audio together I am finding that the further into the video I go the

  • Is it mandatory to reverse windows signature while doing verification in OpenSSL?

    We haved signed data on Win 7 using Crypto APIs and generated signature. We have observed this signature data needs to be reversed for verification using OpenSSL. If we revese signature data and pass it to OpenSSL verification command then OpenSSL ve