Replacing jar files real-time in classpath

Hi All
I have a swing application and It runs perfectly. I have created a update manager that can download jar files for the application. This update manager downloads jar files and replaces the jar files that are currently in the class path. You could say the update is real-time.
After the files are downloaded I get errors like class not found and other really strange Java errors. The class not found errors indicate that the application cant find classes that are in the downloaded jar file.
Is there any way to prevent this from happening?
Thanks in advance,
Martyn Hiemstra

I am currently just saving the downloaded files into the classpath directory, so in short I'm replacing them while the JVM is running.
The problem is that my Java application is installed using install4j meaning that the application is started as a .exe file. The problem is that I would need to create an external application to update the files but the external programme would have not idea where to put the newly downloaded files. T o overcome this all I want to create an updater within my own application.
Is there a way to shutdown real-time loading of jar files in the class path? That would solve the problem since the newly loaded jar files arent detected until the application is started again.

Similar Messages

  • Control JNLP jar files download time

    Hello,
    I have a JNLP application which will run over internet , my problem is that anyone can go to the url and launch the application and download all the jars, before even logging in, i'm worried about using this for Denial of service.
    is there a way that i can control the jar files download time, like only download the necessary jar first and when jars are needed will be downloaded eventually
    Any Help would be appreciaetd
    regards

    elie_nasrani wrote: I have a JNLP application which will run over internet , my problem is that anyone can go to the url and launch the application and download all the jars, before even logging in, i'm worried about using this for Denial of service.
    is there a way that i can control the jar files download time, like only download the necessary jar first and when jars are needed will be downloaded eventually
    Web start offers lazy downloads, as well as the DownloadService* (DS) to help with this kind of problem.
    'Lazy' means the resource is only downloaded when needed, but using the DS offers even greater control, even to the extent of manually blocking a download - if needed.
    * e.g. of the Download service, be sure to follow the links.
    <http://www.physci.org/jws/#ds>
    As far as 'signing' goes, I cannot imagine how that would help for your problem. Not only are signed Jar's (at least slightly) larger, but they can also be used by JWS apps. coming from other domains! If your app. is sandboxed, I strongly recommend keeping it as unsigned code.
    Why is your JNLP file exposed to the general public? Don't the users have to log in before they can get to the page with link to the application JNLP?
    If that is the case, the only chance for users who are not logged in to launch it, is if a friend sends them a direct link to the JNLP file.
    As an aside, I generally do not have time to look at posts with no 'dukes' assigned (see links at upper left), if getting a solution is important to you, it is a good idea to add some.

  • Jar file doesn't read classpath environment variable from windows xp

    I created a small program that uses javamail and jdbc driver. I program on Win XP and use java 1.6.04.
    When I compiled my classes the program works fine but when I created a jar package the jar file cannot 'see' the classpath that windows has already set.
    I have to set the classpath in the manifest file and then it works ok.
    Is this normal? I was expecting that the jar file would work just fine without any complication since the classpath is already set in the system?
    If you could point to any documentation that covers this it would be great.
    Thank you very much.
    Genti

    genti_tech wrote:
    I specified the class-path in manifest in jar file and I looked at the tutorial you are suggesting:
    http://java.sun.com/docs/books/tutorial/deployment/jar/
    which is not clear at all about the fact that jar ignores the class-path environment variable.It is specified for java. http://java.sun.com/j2se/1.5.0/docs/tooldocs/windows/java.html#-jar

  • Save file real time

    hello
    i was having problem with the saving file real time. the data is
    desired to be saved in the form of spreadsheet. using the date and time
    as file name, the file will be saved automatically. i do not what has
    gone wrong as it can be used to save file offline.
    it appears the message of
    ERROR 8 occur at create file (file exists) (althought it does not exist)
    NI 488: DMA hardware error detected
    here attached the error message
    someone pls help
    thanks
    regards
    Attachments:
    error.png ‏20 KB

    It is difficult to tell from the small segment of code shown, but it appears that the New File function is in a loop. Is it possible that the loop iterates quickly enough that it attempts to create the file twice with the same time? One way around this it to check first to see if the file exists. If it does, than append a 1 (or 2, or 3, or ...) to the filename and try again.
    Lynn

  • Replacing JAR files loaded by custom ClassLoader

    Hi all,
    I am trying to create an auto-updater for a stand alone application, which can look for new versions of relevant jar files on the internet and download them. I have code which will look for newly downloaded versions and can replace the old jar file with the new one (using simple File methods). This works fine for when the application is started initially, but as the application is a server and may not manually be started for a long time, I am trying to force the server to restart and reload with the new code.
    if(newCode.exists()) {
         System.out.println("new code!");
         if(oldCode.exists()) {
              oldCode.delete();
         if(code.exists()) {
              if(! code.renameTo(oldCode)) {
                        throw new IOException("Error backing up code file");
         if(! newCode.renameTo(code)) {
              throw new IOException("Error installing new code file");
    }I have looked around the forums a bit, and have come up with using a ClassLoader based on URLClassLoader:
    class ProxyLoader extends URLClassLoader
         public ProxyLoader(String jarFile) throws MalformedURLException {
              super(new URL[] { (new File(jarFile)).toURL() });
         public Class findClass(String name) throws ClassNotFoundException {
              System.out.println("Finding: " + name);
              return super.findClass(name);
    }This seems to work OK, as all the classes from the jar file are loaded by this classloader.
    I have a method which can create an instance of the class loader, and load the server application.
    private boolean startProxy(int port) {
         try {
              pl = new ProxyLoader("proxy.jar");
              Class ptClass = pl.loadClass("proxy.POPThread");
              pt = ptClass.newInstance();
              Method ptStart = ptClass.getMethod("start", new Class[0]);
              ptStart.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }I also have a method to shut down the server:
    private boolean stopProxy() {
         try {
              Class ptClass = pl.loadClass("proxy.POPThread");
              Method ptInterrupt = ptClass.getMethod("interrupt", new Class[0]);
              ptInterrupt.invoke(pt, new Object[0]);
              return true;
         } catch(Exception e) {
              return false;
    }These appear to be working fine, the problem I have however is when I try to rename the existing jar file (proxy.jar) in order to replace it with a new one (proxy.new), the renameTo method on the File object fails. I am guessing that is because the proxy.jar file is still in use by the JVM. I have tried setting the classloader var to null, but this doesnt seem to have any effect.
    My main question is how can I 'free' the jar file so that it can be replaced with new code? Is it possible? My only otherway of working around this is to have a variable stored in a file pointing at the 'current' code, but the jar file isn't litterally replaced.
    This is a standalone application, which will probably run in a startup script on a server, so webstart isn't really an option.
    TIA
    iklesteve

    I have found this to be true anytime I try to use the renameTo() API to rename a file with a .jar file extension (regardless of the actual file type - i.e. it could be a text file with .jar appended and it will still fail) in the case where the class making the renameTo() call is loaded from another .jar file.
    I run the same exact code after extracting from the .jar, then the rename to the other .jar file is successful. Also, if I rename the .jar file to a ".ja" file, I can successfully rename the jar file even if the code is running with the context of another .jar file.
    Is this some kind of bogus security measure within the JVM or is it a bug?

  • WebLogic 10.3.5 ClassNotFoundException (jar file is available in classpath)

    Hi, I'm facing a problem on WLS10.3.5 + Spring 3.1 + Hibernate 3.6.7 connecting to Apache Derby 10.8.1.2.
    The Spring ContextLoaderListener configured in the web.xml is failing since the the entityManagerFactory creation failed - since the derby datasource defined in WLS could not be created. Root cause - ClassNotFoundException by the weblogic.utils.classloaders.GenericClassLoader. I've tried adding derbyclient.jar in all locations - WLS server lib, domain lib, WEB-INF/lib, VM_HOME/jre/lib/ext, and also tried setting PRE_CLASSPATH. Also tried keeping a duplicate copy of the jar in all the locations at the same time. No luck.
    Caused By: java.lang.ClassNotFoundException: org.apache.derby.client.am.ConnectionCallbackInterface
    at weblogic.utils.classloaders.GenericClassLoader.findLocalClass(GenericClassLoader.java:297)
    at weblogic.utils.classloaders.GenericClassLoader.findClass(GenericClassLoader.java:270)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
    at weblogic.utils.classloaders.GenericClassLoader.loadClass(GenericClassLoader.java:179)
    Truncated. see log file for complete stacktrace
    The datasource is created successfully from the console so there's no problem with the jar file. I could also load the above class using a test JSP from another bare WAR deployed into the same domain.
    I'm out of ideas and need some options to explore. btw, I specified in the weblogic.xml that the antlr.* classes should be taken from the application. Also tried this option for org.apache.derby.* classes.
    This looks like a buggy class loader problem. Any ideas or solution please?

    "The datasource is created successfully from the console so there's no problem with the jar file."
    Did you also test the data source when you created it?
    - when yes then WebLogic can indeed find the derbyclient.jar as the driver org.apache.derby.jdbc.ClientDriver is part of it.
    "I specified in the weblogic.xml that the antlr.* classes should be taken from the application. Also tried this option for org.apache.derby.* classes."
    Have you only defined a
    <prefer-application-packages>
        <package-name>antlr.*</package-name>
        <package-name>org.apache.derby.*</package-name>
    </prefer-application-packages>in weblogic.xml or did you also turn on prefer-web-inf-classes?
    It is smart to start from scratch and delete all the jar files in all the directories. To make the derbyclient.jar part of the WebLogic classpath you can do the following:
    - edit setDomainEnv: When you open setDomainEnv there is an entry like "SET THE CLASSPATH". Just before - if [ "${JAVA_VENDOR}" != "BEA" ] ; then
    you can put something like: CLASSPATH=${CLASSPATH}${CLASSPATHSEP}location/derbyclient.jar
    If the class must be available on every server in a cluster, you can edit the commEnv file (located in the ${WL_HOME}/common/bin directory)
    Search for the entry "set up WebLogic Server's class path". And below the WEBLOGIC_CLASSPATH you can add something like:
    WEBLOGIC_CLASSPATH=${WEBLOGIC_CLASSPATH}${CLASSPATHSEP}location/derbyclient.jar
    Hope this helps you a little

  • How to add jar files to applet's classpath

    hi everyone,
    i got an issue to add jar file's to applt's classpath,
    i looked around accross many resources but getting no solution on this.
    i have a commons-httpclient3.1.jar and i have to make it available it to a an applet class bundled in a jar file say myjar.jar
    how can i achieve it?
    any help would be much appreciated
    thanks

    That's a long time I haven't written applets, but if I remind well, we are able to set multilple jar in the classapth parameter, separated by semicolon.
    Look the page http://java.sun.com/docs/books/tutorial/deployment/applet/html.html
    Edited by: jswim on Dec 6, 2007 3:51 PM

  • Jar File executes without the CLASSPATH being set???

    Hello all:
    I have been writing an application with JBuilder 4.0 Professional. I have finished the program and then let JBuilder create a JAR file. About the first 5 times I created the JAR file, I could never get it to execute from the command line. However, the last time I created the JAR file, I doubled clicked on it and it executed by using javaw. I had the CLASSPATH pointing to the file. I later removed the CLASSPATH variable, and the JAR file still executed. My MANIFEST.MF file includes the package name(not classpath) and the main class(which contains the public static void main method).
    I installed the JAR file and the JRE on another computer and it would not work. Can anyone give me some information??? Thanks in advance.

    probably this is due to the fact on your windows explorer under view - options, File Types tab you have the executable jar file pointing to a jdk.
    click on Executable Jar File and click edit then click on open in the Actions box (if this isn't here then this isn't the reason, sorry) and click edit. a pop up will appear with the java exe path - this is what the app is running from.
    gaz

  • Classpath Issue - but JAR file is in the classpath

    I'm having an issue getting a JAVA Application Client to run and would welcome any suggestions or input to resolve this problem. I'm not a developer, just the builder/deployer of the applications. There are two developers looking at this problem too, but they are stumped too.
    It complains that it can't find sun/jdbc/rowset/CachedRowSet, which is contained in the rowset.jar - which is in the classpath. I've put all the supporting information below, if you need additional information please let me know and I'll provide it.
    ***** ERRORS FROM RUNNING SCRIPT BELOW *****
    *** NOT Using Verbose: ***
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/jdbc/rowset/CachedRowSet
    *** Using Verbose (only included the output with the error): ***
    [Loading superclasses of com/actuate/schemas/SubmitJobResponse]
    [Loaded java.sql.SQLException from /usr/java130/jre/lib/rt.jar]
    [Loading superclasses of java/sql/SQLException]
    [Signaling in VM: java/lang/NoClassDefFoundError, message: sun/jdbc/rowset/CachedRowSet]
    Exception in thread "main" java.lang.NoClassDefFoundError: sun/jdbc/rowset/CachedRowSet[Loaded sun.i
    o.UnknownCharacterException from /usr/java130/jre/lib/rt.jar]
    [Loading superclasses of sun/io/UnknownCharacterException]
    [Preparing sun/io/UnknownCharacterException]
    ***** SCRIPT TO RUN THE JAVA COMMAND *****
    #!/usr/bin/ksh
    LIBDIR="/actuate/Mace/lib"
    JAVA_CP=""
    MAIN_JAR="MaceEXT.jar"
    JAVA_PATH="/usr/java130/jre/bin"
    JAVA_HOME="/usr/java130/jre"
    JAVA_FULLVERSION=`$JAVA_PATH/java -fullversion`
    JAVA_EXE=${JAVA_HOME}/bin/java
    PATH=$JAVA_PATH:$PATH
    export PATH
    export JAVA_HOME
    JAVA_CP="${LIBDIR}/sljcx.jar"
    JAVA_CP="${LIBDIR}/sljc.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/rowset.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/wsdl4j.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/tt-bytecode.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/servlet.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/saaj.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/log4j-1.2.4.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/jaxrpc.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/commons-logging.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/axis.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/ivjejb35.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/j2ee.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/activation.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/mail.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/ns.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/xmlParserAPIs.jar":${JAVA_CP}
    JAVA_CP="${LIBDIR}/xercesImpl.jar":${JAVA_CP}
    JAVA_CP="$JAVA_HOME/lib/rt.jar":${JAVA_CP}
    echo ""
    echo "Classpath"
    echo $JAVA_CP
    echo ""
    echo "JAVA_Home"
    echo $JAVA_HOME
    echo ""
    echo "JAVA_EXE"
    echo $JAVA_EXE
    echo ""
    echo "JAVA_Path"
    echo $JAVA_PATH
    echo ""
    echo "JAVA FullVersion"
    echo $JAVA_FULLVERSION
    #$JAVA_EXE -cp $JAVA_CP -jar $MAIN_JAR -h dev -c adduser -u 000 -p ""
    $JAVA_EXE -verbose -cp $JAVA_CP -jar $MAIN_JAR -h dev -c adduser -u 000 -p ""
    ***** JAR -tvf OF ROWSET.JAR *****
    server105:/actuate/Mace/lib $ jar -tfv rowset.jar
    0 Tue Jun 13 19:45:42 EDT 2000 META-INF/
    66 Tue Jun 13 19:45:42 EDT 2000 META-INF/MANIFEST.MF
    0 Tue Jun 13 19:45:30 EDT 2000 sun/
    0 Tue Jun 13 19:45:30 EDT 2000 sun/jdbc/
    0 Tue Jun 13 19:45:42 EDT 2000 sun/jdbc/rowset/
    551 Tue Jun 13 19:45:30 EDT 2000 sun/jdbc/rowset/BaseRow.class
    9112 Tue Jun 13 19:45:32 EDT 2000 sun/jdbc/rowset/BaseRowSet.class
    35562 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/CachedRowSet.class
    597 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/ColInfo.class
    1290 Tue Jun 13 19:45:36 EDT 2000 sun/jdbc/rowset/InsertRow.class
    18442 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/JdbcRowSet.class
    2109 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/Row.class
    4489 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetMetaDataImpl.class
    4707 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetReaderImpl.class
    8270 Tue Jun 13 19:45:38 EDT 2000 sun/jdbc/rowset/RowSetWriterImpl.class
    4745 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SQLInputImpl.class
    3287 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SQLOutputImpl.class
    2326 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialArray.class
    1560 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialBlob.class
    1948 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialClob.class
    592 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialRef.class
    2419 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/SerialStruct.class
    1903 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/WebRowSet.class
    257 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReader.class
    15620 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReaderDocHandler.class
    2029 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlReaderImpl.class
    258 Tue Jun 13 19:45:40 EDT 2000 sun/jdbc/rowset/XmlWriter.class
    9797 Tue Jun 13 19:45:42 EDT 2000 sun/jdbc/rowset/XmlWriterImpl.class
    ***** ECHO OF VARIABLES FROM SCRIPT *****
    Classpath
    /usr/java130/jre/lib/rt.jar:/actuate/Mace/lib/xercesImpl.jar:/actuate/Mace/lib/xmlParserAPIs.jar:/ac
    tuate/Mace/lib/ns.jar:/actuate/Mace/lib/mail.jar:/actuate/Mace/lib/activation.jar:/actuate/Mace/lib/
    j2ee.jar:/actuate/Mace/lib/ivjejb35.jar:/actuate/Mace/lib/axis.jar:/actuate/Mace/lib/commons-logging
    .jar:/actuate/Mace/lib/jaxrpc.jar:/actuate/Mace/lib/log4j-1.2.4.jar:/actuate/Mace/lib/saaj.jar:/actu
    ate/Mace/lib/servlet.jar:/actuate/Mace/lib/tt-bytecode.jar:/actuate/Mace/lib/wsdl4j.jar:/actuate/Mac
    e/lib/rowset.jar:/actuate/Mace/lib/sljc.jar:/actuate/Mace/lib/sljcx.jar
    JAVA_Home
    /usr/java130/jre
    JAVA_EXE
    /usr/java130/jre/bin/java
    JAVA_Path
    /usr/java130/jre/bin
    JAVA FullVersion
    java full version "J2RE 1.3.0 IBM build ca130-20020504"
    ***** DIRECTORY LISTING *****
    server105:/actuate/Mace $ ls -lat
    -rwxr-xr-x 1 actuate actuate 1673 Apr 04 09:11 go.sh
    -rw-r----- 1 actuate actuate 476699 Apr 03 12:37 MaceEXT.jar
    drwxr-xr-x 2 actuate actuate 4096 Apr 02 10:49 lib
    -rw-r----- 1 actuate actuate 1818 Mar 28 11:15 MaceConfig.xml
    server105:/actuate/Mace/lib $ ls -lat
    -rw-r----- 1 actuate actuate 32033 Apr 02 10:49 ivjejb35.jar
    -rw-r----- 1 actuate actuate 329096 Apr 02 10:49 j2ee.jar
    -rw-r----- 1 actuate actuate 374291 Apr 01 16:39 ns.jar
    -rw-r----- 1 actuate actuate 654326 Apr 01 16:31 sljc.jar
    -rw-r----- 1 actuate actuate 81987 Apr 01 16:31 sljcx.jar
    -rw-r----- 1 actuate actuate 54368 Mar 31 08:32 activation.jar
    -rw-r----- 1 actuate actuate 867459 Mar 31 08:32 axis.jar
    -rw-r----- 1 actuate actuate 24287 Mar 31 08:31 commons-logging.jar
    -rw-r----- 1 actuate actuate 32069 Mar 31 08:31 jaxrpc.jar
    -rw-r----- 1 actuate actuate 378778 Mar 31 08:31 log4j-1.2.4.jar
    -rw-r----- 1 actuate actuate 305414 Mar 31 08:31 mail.jar
    -rwxrwxrwx 1 actuate actuate 62388 Mar 31 08:31 rowset.jar
    -rw-r----- 1 actuate actuate 18468 Mar 31 08:31 saaj.jar
    -rw-r----- 1 actuate actuate 78350 Mar 31 08:31 servlet.jar
    -rw-r----- 1 actuate actuate 130773 Mar 31 08:31 tt-bytecode.jar
    -rw-r----- 1 actuate actuate 109356 Mar 31 08:31 wsdl4j.jar
    -rw-r----- 1 actuate actuate 933730 Mar 31 08:31 xercesImpl.jar
    -rw-r----- 1 actuate actuate 78440 Mar 31 08:31 xmlParserAPIs.jar

    All that script made my eyes glaze over, but it appears you are running your main class from an executable jar file. Is that correct? Executable jar files don't use the classpath. If you want them to refer to anything outside the executable jar, you have to put Class-Path entries in its manifest.

  • Why doesn't my jar file know about my classpath

    I have created a simple java program to illustrate my point. My java program is called ABC.java and this is what is in it:
    import java.lang.String;
    public class ABC {
         public static void main(String[] args) {
              String myClassPath;
              myClassPath = System.getProperty("java.class.path");
              System.out.println("Running ABC\n");
              System.out.println(myClassPath);
              System.out.println("\nFinished ABC");
    If I run java ABC.class I get my classpath printed out, but if I create a jar file I do not get a classpath printed out.
    I am asking this because I have written a java app that uses a class from a third part jar file that is in my class path. If I run the .class version the app works as it should. If I run the jar version of the app I get a NoClassDefFoundError for the class in the third party jar file.
    Since the third party jar file may be in a different path on diferent machines I can not hard code the classpath in my manifest file.
    If I use the -classpath or -cp switch when I run the jar file my demo app still does not print the classpath as it should.
    I hope this is just a bonehead error on my part.
    Thanks in advance.

    This suggestion would work well if I only needed to support one OS.
    The problem is that under Windows the third party JAR would be in a
    subdirectory under "C:\Program Files" but under Linux and Solaris the JAR
    file might be in a subdirectory under opt. My relative path would be different
    for each OS. It would be great if I did not have to have a JAR for each OS.
    One of the great things about Java was supposed to be that you could have
    one application that ran under several OSes.
    I forgot to mention that for me example above I was using JDK 1.5.0_09.

  • Windows media player in browser asking to replace html file every time

    Hi Alll,
    I have a case in which I am running a WMP in a Browser using ActiveX container , the problem I am facing is on every run its asking me to replace the existing html file in the folder , Is there a way to get rid of that, I dnt want to click replace every time. Is there a easy way of doing this.
    Please let me know.
    Ankit
    Solved!
    Go to Solution.
    Attachments:
    wmp.JPG ‏47 KB

    Thanks, It was very helpfull
    smercurio_fc wrote:
    The dialog is being caused by the Write Characters to File VI that you are using. If the file already exists, it will ask you if you want to replace it. Instead of using those VIs, just use the Read From Text File and Write to Text File functions that are in the File I/O palette.
    Your code has another issue: your use of the Current VI Path constant. See Why Does My Executable Not Work When Using the Current VI's Path Constant?
    smercurio_fc wrote:
    The dialog is being caused by the Write Characters to File VI that you are using. If the file already exists, it will ask you if you want to replace it. Instead of using those VIs, just use the Read From Text File and Write to Text File functions that are in the File I/O palette.
    Your code has another issue: your use of the Current VI Path constant. See Why Does My Executable Not Work When Using the Current VI's Path Constant?

  • Replacing jar files within ear

    Hi
    Once you package your component as an EAR and deploy it in WebLogic/Jboss is it possible to replace one or more JARs within the EAR without actualy having to recreate the EAR?
    Sudhi

    Yes, just use the jar update command, e.g.
    jar uvf My.ear JarInEar.jar
    replaces file JarInEar.jar in My.ear.

  • Download to a file, real-time oscillosco​pe traces accessed through the web: How?

    Our new Textronix oscilloscope was assigned an IP address, and we are
    viewing this oscilloscope's traces over the web using the IP address
    assigned. Now, using LabVIEW, we want to download into a file an
    oscilloscope trace at a particular instant in time, and we want to do
    it many times as we want. Is LabVIEW 6.1 capable of doing that? If YES,
    then how? What features do I use?
    Thank you very much for your help!
    Sincerely,
    reynann7

    Do a search for the Tektronix model under drivers, you should be able to find a labview driver for the instrument. The Tektronics scope I have (TDS3034) used TekVisa to what looked like "fake" a GPIB bus. When I installed Labview and NI-488 TekVisa would no longer work, I used the serial port on the TDS3034 instead.
    Hopfully this points you in the right direction.
    Andrew Alford
    Production Test Engineering Technologist
    Sustainable Energy Technologies
    www.sustainableenergy.com

  • What is directory where I can put in jar file without specify classpath ?

    hi,
    Is there any directory in weblogic similar to the directory of WEB-INF/lib/ where I can throw a jar file in without specify classpath explicitly.
    The reason I'm looking for such directory is :
    -- I do not want to specify classpath explicitly
    -- I'd like it outside of an application so that it stay even if the application redeployed.
    Thanks

    Hi Aacc,
    The domain library directory that you are looking for is usually $DOMAIN_DIR/lib, for example "C:\Oracle\WLS_Middleware10.3.4\user_projects\domains\test_domain_1\lib" (Windows) or "/u01/weblogic/domains/my_domain/lib" (Linux/Unix).
    The jars located in this directory will be picked up and added dynamically to the end of the server classpath at server startup. The jars will be ordered lexically in the classpath. The domain library directory is one mechanism that can be used for adding application libraries to the server classpath.
    You can override the $DOMAIN_DIR/lib directory using the -Dweblogic.ext.dirs system property during startup. This property specifies a list of directories to pick up jars from and dynamically append to the end of the server classpath using java.io.File.pathSeparator as the delimiter between path entries.
    -Cris

  • Netbeans 551: Include all libs in project jar file. Possible?

    Is it possible to manually, or automaticly, include the /dist/lib directory into my "GonioLabt,jar" to make it more 'stand alone', file wise.
    Netbeans generates this dist/README.TXT
    ========================
    BUILD OUTPUT DESCRIPTION
    ========================
    When you build an Java application project that has a main class, the IDE
    automatically copies all of the JAR
    files on the projects classpath to your projects dist/lib folder. The IDE
    also adds each of the JAR files to the Class-Path element in the application
    JAR files manifest file (MANIFEST.MF).
    To run the project from the command line, go to the dist folder and
    type the following:
    java -jar "GonioLab.jar"
    To distribute this project, zip up the dist folder (including the lib folder)
    and distribute the ZIP file.
    Notes:
    * If two JAR files on the project classpath have the same name, only the first
    JAR file is copied to the lib folder.
    * If the classpath contains a folder of classes or resources, none of the
    classpath elements are copied to the dist folder.
    * If a library on the projects classpath also has a Class-Path element
    specified in the manifest,the content of the Class-Path element has to be on
    the projects runtime path.
    * To set a main class in a standard Java project, right-click the project node
    in the Projects window and choose Properties. Then click Run and enter the
    class name in the Main Class field. Alternatively, you can manually type the
    class name in the manifest Main-Class element.

    Yes it is possible. The same question has been
    killing me all day. Here is how I did it.
    (I'm on Mac OS 10.4, but this should work anywhere)
    Netbeans produces the following:
    dist/myJar.jar
    dist/lib/swing-layout-1.0.jar
    I would prefer to have only:
    dist/myJar.jar
    But, as you know, myJar.jar requires the class files
    stored in swing-layout-1.0.jar. I unpacked the jar
    files and examined the manifest files. Here is how to
    unpack and repack the jar files into a single jar
    file:
    First, I renamed myJar.jar to myJar.zip and let OS X
    unarchive the jar for me. I did the same for
    swing-layout-1.0.jar.
    I then dropped the MANIFEST.MF file from
    MyJar/META-INF/ into a new folder on my harddrive
    Then, I dropped the package (its a folder full of
    class files) from MyJar/ into the same new folder on
    my harddrive.
    At this point, the new folder contains:
    /newFolder/MANIFEST.MF
    /newFolder/myPackage/
    Then, I grabbed /dist/lib/swing-layout-1.0/org/ and
    dropped that into the new folder.
    We now have in the new folder:
    /newFolder/MANIFEST.MF
    /newFolder/myPackage/
    /newFolder/org/
    Almost done:
    Open the MANIFEST.MF file with a text editor. Mine
    looked like this:
    Manifest-Version: 1.0
    Ant-Version: Apache Ant 1.6.5
    Created-By: 1.5.0_07-87 ("Apple Computer, Inc.")
    Main-Class: ohm.GUI
    Class-Path: lib/swing-layout-1.0.jar
    X-COMMENT: Main-Class will be added automatically by
    build
    I replaced the ENTIRE contents of the file with
    this:
    Manifest-Version: 1.0
    Main-Class: myPackage/Main
    Where 'myPackage' is the folder containing my class
    files, and 'Main' is the class containing the
    'main(String[] args) method.
    Save the file and we're ready to repack the archive.
    Open the command line (in OS X this is the Terminal)
    I assume the syntax is the same in windoze; Navigate
    to the new folder you created.
    In OSX: cd /newFolder
    in windoze: cd \newFolder
    Then use java's jar command:
    jar cmf MANIFEST.MF MyJar.jar *
    What this does:
    jar is the command. cmf are flags: the 'c' is for
    creating a new jar archive, the 'm' is to specify a
    premade manifest file, the 'f' tells jar to write the
    results to a file. MyJar.jar is the name you have
    chosen for the resulting .jar file. the '*' is a
    wildcard character that tells jar to put every file
    in the present working directory into the new .jar
    Thats it! This produced myJar.jar which worked fine
    by itself, as it included all the classes from
    swing-layout-1.0.jar. It would be a trivial matter to
    write a shell script to do all this for you, unless
    of course you use something silly like windows, in
    which case you'll have to write a batch file or use
    python or something. Good luck, I hope this saves
    others time, drop me a e-mail if this was at all
    confusing! [email protected]
    You should be aware that doing this may well violate the licensing terms for third-party libraries
    By the way, what's silly about using Windows? Are you saying you don't develop for Windows because it's "silly"?

Maybe you are looking for

  • IPod Is not recognized by any computer

    Hi, I just bought a new iPod, I tried with a Mac and a Windows system and any of them recognized the iPod, once the iPod is connected, the computer is "blocked", if i disconnect it, it works again, what should i do?

  • Return to Vendor Error

    Hello All, I am not exactly a MM or QM or FI guy, but have given this task to resolve it ASAP, so i am asking for help on this forum. we are facing an error when we are trying to return the goods to the vendor, the  items to return are entered in the

  • It's not your router this is what I do.

    This has been happening for 4 months now and I use to unplug the router which killed everybody else's good time. Then i thought somebody got into my router and limited my usage checked it. Then I thought apple and AT&T Was spying on me o O   Who know

  • IPhone Programming: Using a Button to change views in iOS4

    Hey guys, I've been working with the iOS3 version until the other day when I began recreating my project and updating it for iOS4. I'm using a tab bar with 4 icons, the first tab being a "Home" screen. On the home screen I have 4 buttons that trigger

  • Check boxes not retaining their correct value

    Hello, I have a perplexing issue going on. I have a simple, two checkbox form for updating two values in my login table. The row type is enum('y','n') so naturally a check box is my preferred way to set the value. Even though the value in the table i