CLASSPATH in applet

There is a wonderful package called lava.clib:
http://sharkysoft.com/software/java/lava/docs/javadocs/lava/clib/package-summary.html
which formats numbers like the printf() function in C.
I downloaded jprintf.jar and added it to my CLASSPATH and use it routinely in batch programs (eg: to line up the printed totals nicely).
But to use in an applet, is it possible? I tried putting this in my html:
archive="jprintf.jar"

JAR files are specified using the ARCHIVE attribute of the <APPLET> tag.
<APPLET CODE="Appletclass.class" ARCHIVE="jprintf.jar">
</APPLET>

Similar Messages

  • HELP please...how to change classpath on applet

    My applet wont launch because it can't find the class. Is there a way to point to a directory with html?

    Put your class file in the same folder as the html file

  • Applet to Oracle

    Hello,
    I have written an aplet to connect to oracle. Now, i have the oracle loaded on to my PC and the applet is also there on the same PC. I am using Oracle thin driver to connect. It works fine with application as i give the classpath while executing the java programs. But here when i load the HTML for the applet, i get error
    Can't find the driver specified : OracleDriver
    here is the code i am using:
    String url = "oracle.jdbc.driver.OracleDriver";
    String connect_string = "jdbc:oracle:thin:@homepc:1521:ORA815";
    I am using ForName(url) and DriverManager.getConnection(connect_string..)
    I guess it is not recognizing the path where this orcledriver class is located. I don't have any knowledge as to how to specify this classpath in applet tag in HTML file if atall it is possible. Somebody please help in telling me what should be done to connect to Oracle from an Applet.
    Once more i am telling the applet and Oracle both are on the same PC. Only in different directories. Hope this is ok.
    I will appreciate any kind of help.
    Thanks a lot for the helper in advance.

    Are you using a Webserver to deploy the applet ?.
    Are you using the appletviewer ?.
    By default all classfiles required by the Applet would be searched relative to the codebase from which the applet was downloaded.
    You could include Java Archive files using
    the ARCHIVE tag of the applet to download jar files containing the classes required by the applet.
    <APPLET CODE="mypackage.MyApplet.class"
    CODEBASE="/test/"
    ARCHIVE = "MyApplet.jar,
    jdev-rt.zip,
    classes111.zip" ...>
    In your case, its not able to find the Driver, since th driver classes are present in the JDBC zip file classes111.zip. You need
    to include it in the ARCHIVE.
    If you are excuting the applet without the webserver, then
    In the above, "/test/" is a virtual directory
    mapped in the webserver pointing to a physical directory. It is in this directory
    on the webserver system that the class file
    pointed by the CODE & the JAR files pointed
    by ARCHIVE.
    If you are executing the applet without the
    webserver, then have the classes111.zip &
    the applet class in the directory where the html file is and have the applet tag as follows
    <APPLET CODE="applet.class"
    CODEBASE="."
    ARCHIVE = "classes111.zip">
    You could find the classes111.zip under
    $ORACLE_HOME\jdbc\lib
    Hope this helps.
    null

  • Applet and Apache Package

    My applet works up until it needs to use classes found in the Apache HttpClient package - the java console displays an error stating that classes from the Apache package cannot be found. The entire java console error message is below. I don't understand why the Apache package cannot be found. When I run the code as an app from eclipse or from the java command line, the code works just fine - there is no problem finding the Apache package. Anyone know what I'm missing?
    Applet tag:
    <applet code="projects.web.UploadApplet" archive="../applets/webtools.jar" width="700" height="600"></applet>Java console error message:
    Exception in thread "AWT-EventQueue-2" java.lang.NoClassDefFoundError: org/apache/commons/httpclient/methods/RequestEntity
    at projects.web.AppletGUI$ButtonHandler.actionPerform ed(AppletGUI.java:169)
    at javax.swing.AbstractButton.fireActionPerformed(Unk nown Source)
    at javax.swing.AbstractButton$Handler.actionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.fireActionPerformed (Unknown Source)
    at javax.swing.DefaultButtonModel.setPressed(Unknown Source)
    at javax.swing.plaf.basic.BasicButtonListener.mouseRe leased(Unknown Source)
    at java.awt.Component.processMouseEvent(Unknown Source)
    at javax.swing.JComponent.processMouseEvent(Unknown Source)
    at java.awt.Component.processEvent(Unknown Source)
    at java.awt.Container.processEvent(Unknown Source)
    at java.awt.Component.dispatchEventImpl(Unknown Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.LightweightDispatcher.retargetMouseEvent( Unknown Source)
    at java.awt.LightweightDispatcher.processMouseEvent(U nknown Source)
    at java.awt.LightweightDispatcher.dispatchEvent(Unkno wn Source)
    at java.awt.Container.dispatchEventImpl(Unknown Source)
    at java.awt.Component.dispatchEvent(Unknown Source)
    at java.awt.EventQueue.dispatchEvent(Unknown Source)
    at java.awt.EventDispatchThread.pumpOneEventForFilter s(Unknown Source)
    at java.awt.EventDispatchThread.pumpEventsForFilter(U nknown Source)
    at java.awt.EventDispatchThread.pumpEventsForHierarch y(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
    at java.awt.EventDispatchThread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: org.apache.commons.httpclient.methods.RequestEntity
    at sun.plugin2.applet.Applet2ClassLoader.findClass(Un known Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 25 more
    Caused by: java.io.IOException: open HTTP connection failed:http://xxx.xxx.xxx.xxx/site/php/org/apache/commons/httpclient/methods/RequestEntity.class
    at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unk nown Source)
    at sun.plugin2.applet.Applet2ClassLoader.access$000(U nknown Source)
    at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknow n Source)
    at java.security.AccessController.doPrivileged(Native Method)
    ... 29 more

    paulcw wrote:
    Since the JVM is going to look on the web server (since that's where it found the HTML and the applet class to begin with), that's not going to work then, is it?No, it isn't going to work. The root of this problem was a fundamental misunderstanding I had about the compile process. I mistakenly thought that when any source code is complied the compiler checks the imported packages and classes to see if they are java library classes and if not then it adds them to the compiled code. So, when the error message indicated that the server was searching for the classes (in the jar file) I was confused as to why/where it was searching. After re-reading my notes I realize that I was completely off on the compile process.
    paulcw wrote:
    Yeah apparently you can set the classpath for applets, although I can't recall the syntax. (I believe the easiest way is to package your applet's class files into a jar, and use a Classpath attribute in the jar's manifest, but honestly I don't recall. Check the docs.)I looked into the docs and found out you can change the classpath by modifying the manifest file. According to the doc you create a txt file and use the "m" option during archiving to add it to the manifest file.
    I created a txt file that has the classpath information like so:
    Class-Path: ../apache/commons-httpclient/commons-httpclient-3.1.jar ../apache/commons-logging/commons-logging-1.1.1.jar ../apache/commons-codec/commons-codec-1.3.jar ../apache/junit-4.5.jarand added it to the manifest file via jar cfm jarFileName inputFiles
    Thanks paulcw.
    Edited by: Dan06 on Mar 31, 2009 1:44 PM Issues with modifying the manifest file were resolved by re-starting my computer.

  • How to use appletviewer tool in JDK1.4

    hi
    can anyone help me in running an applet program from different directory. also i need to set classpath for applet whenever i am using appletviewer tool.
    thankx

    hi
    can anyone help me in running an applet
    applet program from different directory. also i need
    to set classpath for applet whenever i am using
    appletviewer tool.
    thankxJust open the html in JCreator and execute
    google for the IDE

  • Setting PATH and CLASSPATH in Java Applet

    Hi,
    I have been wondering if there was a way to set the PATH and the CLASSPATH in the HTML file within the <APPLET> tag...
    What I would like to do is to read some xml files outside of the directory where my html file is located to run my test application with the configuration on my computer.
    (The applet and the html file from which it is called is on my local host.)
    Therefore, I have seen that in order to access local files, I have to sign my jar files, which I did.
    But the tricky part is that for my test application to work, I need to set the PATH and the CLASSPATH... and I have no idea if this is possible or not...
    I have seen that:
    *CODEBASE: I specify here the main directory where my jar files are located
    *ARCHIVE: I specify here the list of my jar files
    In my case:
    CODEBASE=../../   (this is the root directory of my whole application)
    ARCHIVE=dir/lib/jar1.jar,dir2/jar2.jar,configXML/,etc...I don't know if I can specify the filepath of my xml files (here "configXML") in ARCHIVE (I suspect we can only specify jar files there... right ?)
    Maybe I can use ARCHIVE this way to specify my CLASSPATH (and well... not completely the way I would like I suppose), but what about the PATH ?
    I have been searching this for soooo long now...
    Any help, hint or suggestions (I might doing this all the wrong way...) would be greatly appreciated !
    Thanks in advance !

    You need to use the code attribute to specify the class that contains the main method to start the application.
    <applet code="myPackage.myClass.class" codeBase="http://www.someServer/someFolder/" archive="myApplet.jar">
    I hope this solves part of your problem at least.
    Andrew

  • Windows classpath vs java.class.path error in QuickTime based applet

    Hello
    I've spent days reading and searching the internet, and I'm still stumped why some Windows installations are not able to run my QuickTime for Java based applet even though QuickTime is installed (the specific error is: java.lang.NoClassDefFoundError: quicktime/QTException). I have some additional details and a question that might spur someone to an insightful nudge.
    On a Windows system that fails:
    echo %classpath%
    .;C:\Program Files\QuickTime\QTSystem\QTJava.zipWhich is where QTJava.zip is found on the (faulty?) system, but java.class.path is just:
    java.class.path = C:\PROGRA~1\Java\jre6\classes
    Of the dumped system properties, only java.library.path makes any mention of the QTSystem folder (or any other QT or QuickTime related items).
    java.library.path = C:\Program Files\Safari;.;C:\Windows\Sun\Java\bin;C:\Windows\system32;C:\Windows;C:\PROGRA~1\Java\jre6\bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files\QuickTime\QTSystem\
    I ran across one thread (elsewhere) where the user was having problems with loading some classes from a complex JAR environment, and a solution was to write a custom class loader. After doing so, the user got the same error "java.lang.NoClassDefFoundError: quicktime/QTException" that was resolved by extending the custom class loader to include .zip files. I'm not sure if the solution is relevant, or if he simply broke something in his custom class loader that would have worked otherwise. I've not written a custom class loader and not sure where to begin, so before I ventured down that path I was hoping someone might shed some light as to if this is a dead end or potential solution. This is a signed applet (QuickTime now requires it, even if you are only playing files of the same server) and it does work on several Windows machines and all tested Macs.
    Thank you,
    Deron
    output to Java Console with level 5 tracing enabled
    basic: Joining applet thread ...
    basic: Joined applet thread ...
    basic: Referencing classloader: sun.plugin.ClassLoaderInfo@750159, refcount=2
    basic: Finding information ...
    basic: Releasing classloader: sun.plugin.ClassLoaderInfo@750159, refcount=1
    basic: Done ...
    basic: Added progress listener: sun.plugin.util.GrayBoxPainter$GrayBoxProgressListener@3a9bba
    basic: Loading applet ...
    basic: Initializing applet ...
    basic: Starting applet ...
    basic: completed perf rollup
    network: Cache entry not found [url: http://www.equushd.com/quicktime/QTException.class, version: null]
    network: Connecting http://www.equushd.com/quicktime/QTException.class with proxy=DIRECT
    network: Connecting socket://www.equushd.com:80 with proxy=DIRECT
    java.lang.NoClassDefFoundError: quicktime/QTException
    at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Unknown Source)
    at java.lang.Class.getConstructor0(Unknown Source)
    at java.lang.Class.newInstance0(Unknown Source)
    at java.lang.Class.newInstance(Unknown Source)
    at sun.applet.AppletPanel.createApplet(Unknown Source)
    at sun.plugin.AppletViewer.createApplet(Unknown Source)
    at sun.applet.AppletPanel.runLoader(Unknown Source)
    at sun.applet.AppletPanel.run(Unknown Source)
    at java.lang.Thread.run(Unknown Source)
    Caused by: java.lang.ClassNotFoundException: quicktime.QTException
    at sun.applet.AppletClassLoader.findClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at sun.applet.AppletClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    ... 10 more
    basic: Exception: java.lang.NoClassDefFoundError: quicktime/QTException
    Ignored exception: java.lang.NoClassDefFoundError: quicktime/QTException

    Something is wrong with the library.
    Staring at java code will not help you figure that out.
    Maybe it isn't intended to be loaded in java but instead it loads java itself?
    If not then write a C/C++ basic app that links that dll in and see if you can at least get it to start.

  • 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

  • Applet - classpath problem

    we have a (signed) applet running which loads it's own jar file using 'archive' parm. A second jar-file is pre-installed on each user machine (performance).
    For every new user we:
    install 1.2 plug-in
    install certificate
    copy big.jar on machine
    add 'classpath' statement to autoexec.bat to have big.jar found.
    Then the user can load this app from his browser.
    Now, we have installed a new machine but we installed 1.3.1_04 plug-in.
    The user loads same app but classes in big.jar aren't found anymore???
    When I add big.jar to 'archive' parm, big.jar is loaded from our website and app works.
    any idea's???

    Try this:
    <html>
    <head>
    </head>
    <body padding="0" margin="0" border="0" bgcolor="#cccccc">
    <APPLET CODE = "whatever.class" WIDTH = "100%" HEIGHT = "100%" ALIGN = "baseline" VSPACE = "0" HSPACE = "0">
    <PARAM NAME = "java_code" VALUE ="whatever.class">
    <PARAM NAME = "java_codebase" VALUE ="C://wherever//the//jarfile//is//">
    <PARAM NAME = "java_archive" VALUE ="whatever.jar">
    <PARAM NAME = "java_type" VALUE ="application/x-java-applet;jpi-version=1.2">
    <PARAM NAME = "scriptable" VALUE ="true">
    </APPLET>
    </body>
    </head>

  • Applet classpath

    Hy
    I download a demo applet from internet
    Now I can compile it in windows vista. In the batch file that launch javack there is set a classpath with the path of all necessary classes.
    But when I launch the applet from html file one of this classes is not find!
    for example: the structure of the folder is:
    |---> prova
    |---> prog
    |---> lib
    |---> clas--> org
    now the applet is in the folder prog
    in the applet there is a statement:
    import org.swingcl1
    when I try to launch the applet by the html script as:
    <html>
    <p> This file launches the applet: esemp.class! </p>
    <applet code="applesemp.class" height=200 width=320>
    No Java?!
    </applet>
    </html
    the java console show the error:
    java.io.FileNotFoundException:
    C:\prova\prog\org\swingcl1 not found
    the applet look to the class swingcl1 not in the right folder clas\org
    How I can solve?
    thanks in advance .
    Dan

    Dan_58 wrote:
    HyG'day. ..and what language is "Hy"? Note that you will generally get more respect, as well as more and better answers, if using more formal language. That means 'Hi' or 'Hello', in this instance.
    I download a demo applet from internetThe internet is a big place. Care to narrow it down with an URL to where you downloaded this?
    On the subject of the rest of your post, could you go back and edit the original post to add code tags, as explained on the 'sticky post' at the top of the forum thread list? These tags need to be put around the
    - file structure
    - code snippet
    - HTML
    - console output
    Here is an example of how the file structure looks if the code tags are used.
       |---> prova
               |---> prog
               |---> lib
               |---> clas--> org Compare that to your original post and you might see the value of code tags. ;)

  • JDK 1.4.2_10; problem with applet/classpath/OBJECT tag

    I'm supporting an applet that needs to run in JDK 1.4.2_10 in order to work. (I don't own the code, so I can't fix the issue)
    I'd like to force that particular applet to run under JDK 1.4.2_10, but allow other applets to run on the current default JVM.
    I'm trying to do this by using the JDK's htmlconverter.exe utility to force the use of JDK 1.4.2_10. That part is working as expected, but I'm experiencing a side effect.
    The problem is that, when I use the OBJECT tag instead of the APPLET tag, the browser attempts to download the class with this URL
    http://hostname.here.com/app.testing/app.testbed/classes/appls%2fDOLARS%2fuser%2fApplet%2fclass.class
    instead of this URL
    http://hostname.here.com/app.testing/app.testbed/classes/appls/DOLARS/user/Applet.class
    The second URL works; the first does not. When I use the APPLET tag, it generates the second URL and downloads the class successfully.
    I'd like to a) use the OBJECT tag. b) get it to use the correct URL to download the Applet.class file. What do I need to do to make this happen?
    Thanks,
    Tom Valesky

    Here's the exception I'm getting (slightly sanitized):
    Java Plug-in 1.4.2_10
    Using JRE version 1.4.2_10 Java HotSpot(TM) Client VM
    User home directory = C:\Documents and Settings\tvalesky
    c: clear console window
    f: finalize objects on finalization queue
    g: garbage collect
    h: display this help message
    l: dump classloader list
    m: print memory usage
    o: trigger logging
    q: hide console
    r: reload policy configuration
    s: dump system and deployment properties
    t: dump thread list
    v: dump thread stack
    x: clear classloader cache
    0-5: set trace level to
    load: class appls/DOLARS/user/Applet.class not found.
    java.lang.ClassNotFoundException: appls.DOLARS.user.Applet.class
         at sun.plugin2.applet.Applet2ClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.plugin2.applet.Plugin2ClassLoader.loadCode(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager.createApplet(Unknown Source)
         at sun.plugin2.applet.Plugin2Manager$AppletExecutionRunnable.run(Unknown Source)
         at java.lang.Thread.run(Unknown Source)
    Caused by: java.io.IOException: open HTTP connection failed:http://hostname.com/DOLARS.testing/dolars.testbed/classes/appls%2fDOLARS%2fuser%2fApplet%2fclass.class
         at sun.plugin2.applet.Applet2ClassLoader.getBytes(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader.access$000(Unknown Source)
         at sun.plugin2.applet.Applet2ClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         ... 7 more
    Exception: java.lang.ClassNotFoundException: appls.DOLARS.user.Applet.class

  • Applet classpath question

    I have my applet "applet.class" in my directory "." along with the html page.
    so, codebase=. code="applet.class"
    This class is in a package: this/is/my/pkg
    so we have this/is/my/pkg/applet.class
    I get an exception stating: ClassNotFound applet.class(wrong name: this.is.my.pkg.applet.class
    I have my html page and my applet.class in the pkg directory, so I use "." as code base, right?
    Well I try changing applet.class to this.is.my.pkg.applet.class like the exception says to and I get ClassNotFound again, but without the wrong name part.
    This will only work if I do this:
    codebase=../../../.. code="this/is/my/pkg/applet.class
    WHY?

    Package assumes a directory structure. So when your class is compiled it has to be in the pkg folder, int the my folder etc. (this/is/my/pkg)
    You still have to maintain the folder structure and put the html at the root of the this folder.

  • Applets not working in WLS 6.1

              I am migrating an application from WLS 5.1 SP 9 to WLS 6.1 SP 1. This
              application contains several applets and ran without error or problems
              under WLS 5.1. However I'm seeing strange behaviour/errors under WLS
              6.1.
              Environment:
              Unix box:
              Sun Solaris - SunOS dargo 5.6 Generic_105181-28 sun4u sparc
              SUNW,Ultra-Enterprise
              Oracle 8.1.7.2
              JDK 1.3.1 that was delivered with WLS 6.1
              Client -- Netscape 4.75 from Window 2000
              In my WLS 5.1 environment I delivered the applets to
              /opt/weblogic/myserver/applets and my JSPS/HTML to
              /opt/weblogic/myserver/public_html.
              In WLS 6.1 I'm currently working on deploying the application in
              exploded format for debugging. I delivered the jar'd up applets to
              /opt/fedex/crs/currentGUI/applets. The remainder of the application is
              in exploded format under /users/crs/{ApplicationName}.
              /users/crs/{ApplicationName} has the following structure:
              deploy
              META-INF -- Contains an application.xml
              astracons-web -- contains the JSPS/HTML
              WEB-INF
              classes -- contains the compiled servlet classes
              lib -- empty
              astracons-ejb
              META-INF -- deployment descriptors for EJB
              com/.... top level of our package that contains our
              EJB.
              Application appears to work correctly with the exception of the
              applets.
              The applet jar files appear OK (jar tvf and jar xvf function correctly).
              Applet tag in JSP is:
              <applet width="180" height="335"
              codebase="/classes/"
              archive="treetable.jar"
              code="com.scand.treetable.JTreeGridApplet.class"
              CLASSPATH includes /opt/fedex/crs/currentGUI/applets/treetable.jar. Applet tag
              and classpath are
              consistent for the other applet (SelectedLocations).
              When I run the application and access the LocationLookupJSP, the
              SelectedLocations applet appears on the screen and appears to function
              correctly (despite the errors in the java console). The treetable
              applet shows the following error on the status line "Applet
              com.scand.treetable.JTreeGridApplet can't init: NEW". I also get the bad zip file
              format error in the
              console. Java console errors are:
              Netscape Communications Corporation -- Java 1.1.5
              Type '?' for options.
              Symantec Java! ByteCode Compiler Version 210.065
              Copyright (C) 1996-97 Symantec Corporation
              java.io.IOException: bad zip file format
              at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              at netscape.applet.AppletClassLoader.<init>(Compiled Code)
              at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              Code)
              at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              Code)
              at java.awt.EventDispatchThread.run(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              Code)
              # Unable to load archive
              http://dargo.rmtc.fedex.com:7009/classes/SelectedLocations.jar:
              java.io.IOException: bad zip file format
              java.io.IOException: bad zip file format
              at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              Code)
              at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              Code)
              at java.awt.EventDispatchThread.run(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              Code)
              java.lang.ArrayIndexOutOfBoundsException
              at java.lang.Throwable.printStackTrace(Compiled Code)
              If I run the AstraconsSummaryReport.jsp everything appears to work correctly
              however the java
              console shows the following errors:
              Netscape Communications Corporation -- Java 1.1.5
              java.io.IOException: bad zip file format
              at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              at netscape.applet.AppletClassLoader.<init>(Compiled Code)
              at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              Code)
              at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              Code)
              at java.awt.EventDispatchThread.run(Compiled Code)
              at
              netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              Code)
              # Unable to load archive
              http://dargo.rmtc.fedex.com:7009/classes/treetable.jar:
              java.io.IOException: bad zip file format
              I've searched through the newsgroups and the WLS 6.1 documentation but
              have reached a dead-end. Any help you can provide would be greatly
              appreciated.
              Terry Jahelka
              

    Terry:
              I recommend opening a case with BEA Support. I don't see a simple answer without someone taking
              the time to personally sort this out with you.
              Regards,
              Jim Brown
              Terry Jahelka wrote:
              > I am migrating an application from WLS 5.1 SP 9 to WLS 6.1 SP 1. This
              > application contains several applets and ran without error or problems
              > under WLS 5.1. However I'm seeing strange behaviour/errors under WLS
              > 6.1.
              >
              > Environment:
              >
              > Unix box:
              >
              > Sun Solaris - SunOS dargo 5.6 Generic_105181-28 sun4u sparc
              > SUNW,Ultra-Enterprise
              > Oracle 8.1.7.2
              > JDK 1.3.1 that was delivered with WLS 6.1
              >
              > Client -- Netscape 4.75 from Window 2000
              >
              > In my WLS 5.1 environment I delivered the applets to
              > /opt/weblogic/myserver/applets and my JSPS/HTML to
              > /opt/weblogic/myserver/public_html.
              >
              > In WLS 6.1 I'm currently working on deploying the application in
              > exploded format for debugging. I delivered the jar'd up applets to
              > /opt/fedex/crs/currentGUI/applets. The remainder of the application is
              > in exploded format under /users/crs/{ApplicationName}.
              >
              > /users/crs/{ApplicationName} has the following structure:
              > deploy
              > META-INF -- Contains an application.xml
              > astracons-web -- contains the JSPS/HTML
              > WEB-INF
              > classes -- contains the compiled servlet classes
              > lib -- empty
              > astracons-ejb
              > META-INF -- deployment descriptors for EJB
              > com/.... top level of our package that contains our
              > EJB.
              >
              > Application appears to work correctly with the exception of the
              > applets.
              >
              > The applet jar files appear OK (jar tvf and jar xvf function correctly).
              >
              > Applet tag in JSP is:
              >
              > <applet width="180" height="335"
              > codebase="/classes/"
              > archive="treetable.jar"
              > code="com.scand.treetable.JTreeGridApplet.class"
              >
              > CLASSPATH includes /opt/fedex/crs/currentGUI/applets/treetable.jar. Applet tag
              > and classpath are
              > consistent for the other applet (SelectedLocations).
              >
              > ____________________________________________________________________________________________
              >
              > When I run the application and access the LocationLookupJSP, the
              > SelectedLocations applet appears on the screen and appears to function
              > correctly (despite the errors in the java console). The treetable
              > applet shows the following error on the status line "Applet
              > com.scand.treetable.JTreeGridApplet can't init: NEW". I also get the bad zip file
              > format error in the
              > console. Java console errors are:
              >
              > Netscape Communications Corporation -- Java 1.1.5
              >
              > Type '?' for options.
              >
              > Symantec Java! ByteCode Compiler Version 210.065
              > Copyright (C) 1996-97 Symantec Corporation
              > java.io.IOException: bad zip file format
              > at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              > at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              > at netscape.applet.AppletClassLoader.<init>(Compiled Code)
              > at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              > Code)
              > at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              > Code)
              > at java.awt.EventDispatchThread.run(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              > Code)
              > # Unable to load archive
              > http://dargo.rmtc.fedex.com:7009/classes/SelectedLocations.jar:
              > java.io.IOException: bad zip file format
              > java.io.IOException: bad zip file format
              > at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              > at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              > Code)
              > at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              > Code)
              > at java.awt.EventDispatchThread.run(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              > Code)
              > java.lang.ArrayIndexOutOfBoundsException
              > at java.lang.Throwable.printStackTrace(Compiled Code)
              >
              > _____________________________________________________________________________________________
              >
              > If I run the AstraconsSummaryReport.jsp everything appears to work correctly
              > however the java
              > console shows the following errors:
              >
              > Netscape Communications Corporation -- Java 1.1.5
              >
              > java.io.IOException: bad zip file format
              > at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              > at netscape.applet.AppletClassLoader.openArchive(Compiled Code)
              > at netscape.applet.AppletClassLoader.<init>(Compiled Code)
              > at netscape.applet.AppletClassLoader.getClassLoader(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$LoadAppletEvent.dispatch(Compiled
              > Code)
              > at java.awt.EventDispatchThread$EventPump.dispatchEvents(Compiled
              > Code)
              > at java.awt.EventDispatchThread.run(Compiled Code)
              > at
              > netscape.applet.DerivedAppletFrame$AppletEventDispatchThread.run(Compiled
              > Code)
              > # Unable to load archive
              > http://dargo.rmtc.fedex.com:7009/classes/treetable.jar:
              > java.io.IOException: bad zip file format
              >
              > I've searched through the newsgroups and the WLS 6.1 documentation but
              > have reached a dead-end. Any help you can provide would be greatly
              > appreciated.
              >
              > Terry Jahelka
              Jim Brown
              Developer Relations Engineer
              BEA Support
              

  • Retrieving .txt file from jar for an applet

    I guess this is a newbie question but i checked the tutorial sessions and i am doing exactly what it says there but still...no luck:
    I'm trying to access a .txt. file stored in the .jar file where my applet .class file is stored. I'm using:
    String s = "myfile.txt";
    // get current Class loader
    ClassLoader cl = this.getClass().getClassLoader();
    FileInputStream is = new FileInputStream((cl.getResource(s)).toString());
    BufferedReader in = new BufferedReader(new InputStreamReader(is));But when the applet is viewer from the browser or from the appletviewer, i'm getting the FileNotFoundException:
    java.io.FileNotFoundException: jar:file:\C:\FeatureSelection\sFeatureSelection.jar!\myfile.txt (The filename, directory name, or volume label syntax is incorrect)
    I tried to use the following instead:
    FileInputStream is = new FileInputStream((myApplet.class.getResource(s)).toString());orFileInputStream is = new FileInputStream((getClass().getResource(s)).toString());but the same exception is still there.
    The jar file and the html file are all stored in this directory C:\FeatureSelection\
    The signed jar file is called sFeatureSelection.jar
    Any help would be greatly appreciated!
    Thanks.

    One way to get at files in a jar is to put the jar in the CLASSPATH and then just refer to the resource by its path in the jar. If the same path occurs in two different jars, then you only get the first one, based on the order of the jars in CLASSPATH, I think.
    The classloader is involved, which can be confusing, but an easy way to try this is:
    String s = "myfile.txt";
    URL u = this.class.getClassLoader().getResource(s);
    Object o = u.getContent();Now, you only really know that something matched that path and now it is in a URL.
    I think the Object will be a stream and you have to read() it or something.
    BTW: I encourage you to examine the URL, but it is not necessary to do so.
    If you have somehitng like a GIF image, then here is an example of how to work with that:
    http://www.devx.com/tips/Tip/5697
    Here is a way to get the bytes without involved the ClassLoader:
    http://www.javaworld.com/javaworld/javatips/jw-javatip49.html
    Take your pick.

  • Not able to load jspx file from the classpath in Integrated OC4J

    Hi,
    I am using integrated OC4J from my jdeveloper to deploy my application as an ear file. It contains one jar file (with ejb deployment desscriptors) and a war file (including Model and Viewcontroller project contents).
    The war file contails a jspx file (say Test.jspx) which contails a link to another jspx file (say Remote.jspx) which resides in its WEB-INF/lib directory.
    When I load Test.jspx and click on the link, it fails to look for the Remote.jspx. It displays a message "OracleJSP error: java.io.FileNotFoundException:" on the web browser.
    From the message written to log file, found that it is actually trying to search for Remote.jspx file in the current context.
    Also tried including the classpath to the jar file containing the Remote.jspx file in orion-web.xml of the web application. using the following:
    <classpath path="file:/xxx/yyy.jar" />
    The issue is still there even after this.
    Can anyone suggest me how to achieve this?
    Thanks,
    Aparna

    this.getCodeBase(), would get RSPL / RLog or whatever you have in your codebase (html parameter of
    the OBJECT/APPLET(:hope not) tag.
    URL u = new URL(this.getCodeBase(), "../something.jpg");
    would get RSPL/something.jpg
    URL u = new URL(this.getCodeBase(), "../VIRA/JPG/00/1.jpg");
    would get RSPL / VIRA / JPG / 00 / 1.jpg
    If you are not sure what your codebase is your can print it out:
    System.out.println(this.getCodeBase().toString());

Maybe you are looking for

  • Context not updated from adobe from fields to ABAP web dynpro every time

    Hi, I work through a turtorial for interactive adobe form in web dynpro. The turtorial link is as following: https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/media/uuid/c766e918-0b01-0010-99b1-c2b78cd059b3?prtmode=navigate I use Active X adobe

  • PO Collaboration : Invoice Creation Type field

    Hello, The Invoice Creation Type field in the SNC Web UI is always "Invoice Creation not allowed" irrespective of the settings to the Master Data / Transaction Data. Given below are the settings I ve maintained ECC System: PO -> Item Details -> Invoi

  • How To Import / Export My Portal

    I'm beginer to learn Portal .. and Now i create page finish..but i don't know ..how to export and import to other PC ..Plz help me..

  • Integration Safeword with Cisco ISE

    Hi, we have a Domain Integrated Safeword application, which was installed on our Domain Controller. Safeword requests were send over the Radius Port to the NPS server, and from there over Port 5040 to the Safeword application. This works without any

  • Icloud Backup with separate Apple ID's: Purchased songs etc

    if I use one Apple ID for icloud and and another for iTunes will my purchased songs be backed up?