Applet java file not refreshing in browser

I have an applet that I am updating and I am not seeing the corresponding update when I open the web page. I can manually download the java class file and look inside it and it definitely is the updated file. I have deleted the browser history. (I am running tests with Firefox 3, IE7, and Safari 4 public beta). Is there something else I need to do to make sure the browser pulls in the latest version of the class file referenced in the html?
Here is the code:
<HTML>
<HEAD>
   <TITLE>A Simple Program</TITLE>
</HEAD>
<BODY>
   <CENTER>
      <APPLET CODE="SendRequest.class" WIDTH="500" HEIGHT="150">
      </APPLET>
   </CENTER>
</BODY>
</HTML>The applet refers to a hard coded URL to read through a urlconnection. It is always reading a file and showing content, but it is not showing the right file. If I change the name of the referenced file in the java program, it looks like the browser has cached the referred file, rather than throwing and error and saying the file doesn't exist.
Here is the java
import java.applet.*;
import java.awt.*;
import java.net.URLConnection;
import java.net.URL;
import org.w3c.dom.Document;
import java.lang.String;
import java.io.*;
public class SendRequest extends Applet {
    @Override
    public void paint(Graphics g) {
        g.drawRect(0, 0, 499, 149);
        g.drawString(getResponseText(), 5, 70);
    public String getResponseText() {
        try {
            URL url = new URL("http://myserver.com/stats/logs/ex20090603000001-72.167.131.217.log");
            URLConnection urlconn = url.openConnection();
            BufferedReader in = new BufferedReader(
                                new InputStreamReader(
                                urlconn.getInputStream()));
            String inputLine;
            String htmlFile = "";
            try {
                while ((inputLine = in.readLine()) != null)
                    htmlFile += inputLine;
                in.close();
                return htmlFile;
            } catch (Exception e) {
                return "Can't get the string.";
        } catch (Exception e) {
            return "Problem accessing the response text.";
}Any help would be appreciated. I heard that some files may cache more persistently than others, but I don't fully understand the details.
Thanks,
Jim

Check this [document loader example|http://pscode.org/test/docload/] & follow the link to sandbox.html for tips on clearing the class cache. That relates specifically to caching a refused security certificate, but class caching is much the same. As an aside, getting a console can be tricky in modern times (unless the applet fails completely). It is handy to configure the [Java Control Panel|http://java.sun.com/docs/books/tutorial/information/player.jnlp] to pop the Java console on finding an applet (Advanced tab - Settings/Java Console/Show Console).
Of course there are two better tools for testing applets, especially in regard to class caching. AppletViewer and Appleteer both make class refresh fairly easy. Appleteer is the better of the two. I can tell you that with confidence, since I wrote it. ;-)

Similar Messages

  • PDF File not opening in browser for sharepoint 2010

    Recently we have moved our web application from one server to another in Sharepoint 2010. Back up of entire web application was taken and restored in another server. But in the new server , the PDF files in the document library is not getting opened in browser.
    it always open in browser
    I have already made following changes but didn,t work
    Set browser file handling to Permissive from central admin
    Set "open in browser" in setting s of doc library
    Set the doc library file handling property using $docLib = $web.lists["Your Document Library Title"] $docLib.BrowserFileHandling = "Permissive" $docLib.Update()
    Added "AllowedInlineDownloadedMimeType.Add("Application/Pdf") in web app
    Installed Adober eader in client machine
    Even after trying all these, the PDF files are still opening in Client application(Adobe reader) but not in the browser
    It would have been great help if anybody provide a solution for this. I have been banging head on this for two days

    It would be handy if you didn't double post too.
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/81ed0362-4033-4a31-b265-c1aba43c3d14/pdf-file-not-opening-in-browser-for-sharepoint-2010?forum=sharepointadminprevious
    To answer your question, you've tried most things that I normally see working, but there may be an extra solution here for you.  The solution 2 Powershell that deals with updating the Inline MimeType may help.
    http://www.pdfshareforms.com/sharepoint-2010-and-pdf-integration-series-part-1/
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Applet not refreshing in browser

    I wrote a HelloWorld applet and viewing it through internet explorer. when i modify the code, compile it, then it replaces the original .class file, but when i refresh the browser, it loads the original applet. when i delete the .class file from the directory, the applet still shows up on the browser after i refresh it. whats going on? and how do i update the applet.

    you hafta CLOSE the browser and then re-open it so the VM sarts up again

  • Applet.java file which used to compile, now does not

    I cannot re-compile a java file which I used to compile many times.
    It keeps saying:
    error: cannot read PopupNavigatorApplet.java
    1 error
    I extracted the original from the archive - the same result
    What might be wrong?

    Perhaps you don't have the rights to access the file in the filesystem? Are you working on *nix or Windoze (or any other)? Is your classpath set properly (including the current working directory '.')?
    So many questions and no answers.. ;o)
    cheers,
    kelysar

  • Applet with Image not working in Browser, works fine in Appletviewer

    Hi,
    I encountered a problem , running my Applet in a browser. (IE and Firefox, ame problem).
    When I use an ImageIcon, it doesnot work. in a browser.(When I remove the icon, it's oke)
    In Appletviewer it works fine. In the browser I first got a security-exception.
    I dealed with that by signing the jar (with the test certificate).
    Now the browser's java console is not showin any faults, but the applet is showing no picture at all.
    Only the text of the label is shown.
    Can someone help me?
    I downgraded the class to a very simple form, shown underneath. This runs fine in Appletviewer, but not in a Browser.
    Best Regards
    Remco

    I have recently had the same problem, after lots of searching, I found that only Java 1.1 is supported by browsers, leaving out everything else including swing. So if you cant play the applet through your browser you need to download the appropriate patch i think about 5mbs.
    You should find one at java.sun.com/getjava/download.html
    Mine worked fine afterwards

  • Servlet does not refresh in browser

    Hi,
    If I change a Servlet code, re-compile it and Refresh the browser (Firefox), it does not refresh. I can only get it to refresh if I re-start Tomcat (v 5.5.4).
    Is there a workaround for this please?
    I put the lines:
    response.setHeader("Cache-Control", "no-cache");
    response.setHeader("Pragma", "no-cache");
    response.setDateHeader("max-age", 0);
    response.setDateHeader("Expires", 0);
    at the top of my doGet method and this does not work.
    Thanks,
    Hal.

    Hi,
    For classes, you can set the reloadable parameter in your application configuration file (in the $CATALINA_HOME/conf/[enginename]/[hostname]/ directory)
    Set it to true if you want Catalina to monitor classes in /WEB-INF/classes/ and /WEB-INF/lib for changes, and automatically reload the web application if a change is detected. This feature is very useful during application development, but it requires significant runtime overhead and is not recommended for use on deployed production applications. That's why the default setting for this attribute is false. You can use the Manager web application, however, to trigger reloads of deployed applications on demand.
    http://jakarta.apache.org/tomcat/tomcat-5.5-doc/config/context.html
    For JSPs, you can configure Jasper (in $CATALINA_BASE/conf/web.xml file) and use the reloading parameter.
    http://jakarta.apache.org/tomcat/tomcat-5.0-doc/jasper-howto.html

  • Problem - Scanner.java file not found

    Hello all, I've been having a problem with a Java installation on windows vista. I've installed both the Java 2 1.4.2_16 sdk, and the Java EE 5 update 3 sdk. However, neither install contains the Scanner.java file... On my desktop running XP, this is not the case. I've tried reinstalling but to no avail. My classpath is set correctly because my programs compile that import java.util.*; But when I create a scanner object I get the dreaded can't resolve symbol error, but only when I compile under vista... Any suggestions? Thanks in advance :)

    Scanner was implemented beginning with v1.5x, and comes in the JDK SE, not the EE.

  • Crystal Report Not Refreshing in browser

    Hi all,
    Am using crystal report for my web application so here am passing my parameter from jsp page
    but it is not refreshing
    For example
    I am select Month=jan my query goes this way.
    Select * from employee where month='jan' group by department order by designation
    when am intially design in eclipse in filter option am selecting 'jan' and when am running in browser am passing the same query with the parameter but here instead of 'jan' am passing month variable where my month variable changes every time according to user choose
    my crystal report is not getting refreshed ..
    hope u understood my problem
    Regards
    Vanishree.B

    Hi Tejomay ,
    I have tried that even after calling refresh() , it ;s not getting refreshed..but if am using signal table in my query  it is getting refreshed .but when am grouping with another table it is not refreshing..
    Regards
    Vanishree

  • File not refreshing and error problem

    well i have 2 problems..
    first:
    i dont know why a jsp file does not reload to the edited version
    meaning lets say I have a jsp file doing something it loads up fine and does I edit the file and try reloading the old copy keeps on coming back..
    there are times when the new copy loads up but that is rare..
    second can anyone tell me what is wrong with this code.. I cant figure out what is wrong with it.. only in the <form></form> tags
    because rest of the code is fine
    i keep on getting nullpointerexception i dont understand why
    <%@ page import="java.io.*"%>
    <%@ taglib uri="taglibdb.tld" prefix="sql" %>
    <html>
    <head>Admin Property</head>
    <body>
         <form name="addproperty" method="post" action="../servlet/PropertyServlet">
         <% if (request.getParameter("action").equalsIgnoreCase("edit")){
         %>
              <input type="text" name="val" value="<%=request.getParameter("val")%>">
              <input type="text" name="property" value="<%=request.getParameter("property")%>">
              <input type="submit" name="editproperty">
         <% } else { %>
         <input type="text" name="property">
         <input type="submit" value="addprop">
         <% } %>
    </form>
    <sql:openConnection driver="com.mysql.jdbc.Driver" url="jdbc:mysql://localhost:3306/mydb" user="guest" password="guest" id="A" />
    <sql:ifError id="A">
    <br>Could not connect to database
    </sql:ifError>
    <sql:setQuery id="A" query="select * from PROPERTY" res="B"/>
    <table>
    <sql:forEachRow res="B">
    <tr>
         <td><sql:getColumn position="1" res="B"/></td>
         <td><sql:getColumn position="2" res="B"/></td>
         <td>">Delete...</a></td>
         <td><a href="../jsp/property.jsp?action=edit&val=<sql:getColumn position="1" res="B"/>&property=<sql:getColumn position="2" res="B"/>">Edit...</a></td>
    </tr>
    </sql:forEachRow>
    </table>
    <sql:closeConnection id="A"/>
    </body>
    </html>
    if i change the form part to:
    <form name="addproperty" method="post" action="../servlet/PropertyServlet">
         <input type="text" name="property">
         <input type="submit" value="addprop">
    </form>
    it works fine the way it is suppose to

    In case you are running Tomcat 4.1 the java file and class file of your jsp is located in Tomcat 4.1/work/standalone/.. and your file should be named something like MyJspPage_jsp.java (try search for it).
    About your nullpointer, you should check your spelling when requesting parameters,
    request.getParameter("action") is not the same as request.getParameter("Action") etc.
    Good luck.
    Johan

  • Java File not Found Exceptions and other errors?

    Hello experts, an issue on our Portal has caught my attention. Every time the J2EE Engine is restarted, a large amount of errors are written on our Trace files. When looking at the trace files, I see that most errors are Java IO File not Found Exceptions. For example:
    [EXCEPTION]
    #1#java.io.FileNotFoundException: ./log/system/database.1.log (No such file or directory (errno:2))
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at java.io.FileInputStream.<init>(FileInputStream.java:66)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.archiveTask(ArchivingThread.java:77)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.run(ArchivingThread.java:40)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)
    #1.5 #0012799E98F6000F0000001800003A9E00044A5F2B9CCDEC#1207672520886#com.sap.engine.services.log_configurator.archive.ArchivingThread##com.sap.engine.services.log_configurator.archive.ArchivingThread######c3cfd920058911dd8ace0012799e98f6#SAPEngine_System_Thread[impl:5]_24##0#0#Error##Java###./log/system/server.1.log (No such file or directory (errno:2))
    [EXCEPTION]
    #1#java.io.FileNotFoundException: ./log/system/server.1.log (No such file or directory (errno:2))
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at java.io.FileInputStream.<init>(FileInputStream.java:66)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.archiveTask(ArchivingThread.java:77)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.run(ArchivingThread.java:40)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)
    #1.5 #0012799E98F6000F0000001900003A9E00044A5F2B9CE7BC#1207672520893#com.sap.engine.services.log_configurator.archive.ArchivingThread##com.sap.engine.services.log_configurator.archive.ArchivingThread######c3cfd920058911dd8ace0012799e98f6#SAPEngine_System_Thread[impl:5]_24##0#0#Error##Java###./log/system/security.1.log (No such file or directory (errno:2))
    [EXCEPTION]
    #1#java.io.FileNotFoundException: ./log/system/security.1.log (No such file or directory (errno:2))
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at java.io.FileInputStream.<init>(FileInputStream.java:66)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.archiveTask(ArchivingThread.java:77)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.run(ArchivingThread.java:40)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)
    #1.5 #0012799E98F6000F0000001D00003A9E00044A5F2BE5C172#1207672525667#com.sap.engine.services.log_configurator.archive.ArchivingThread##com.sap.engine.services.log_configurator.archive.ArchivingThread######c3cfd920058911dd8ace0012799e98f6#SAPEngine_System_Thread[impl:5]_24##0#0#Error##Java###./log/applications.1.log (No such file or directory (errno:2))
    [EXCEPTION]
    #1#java.io.FileNotFoundException: ./log/applications.1.log (No such file or directory (errno:2))
         at java.io.FileInputStream.open(Native Method)
         at java.io.FileInputStream.<init>(FileInputStream.java:106)
         at java.io.FileInputStream.<init>(FileInputStream.java:66)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.archiveTask(ArchivingThread.java:77)
         at com.sap.engine.services.log_configurator.archive.ArchivingThread.run(ArchivingThread.java:40)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)
    In summary, the system cannot find the files server.1.log, security.1.log, database.1.log and applications.1.log. I tried manually adding these files (I created them on my computer and left them empty) on the path written, but it did not work, for some reason they are deleted.
    Another error that is happening during restart of the engine is the following:
    #1.5 #0012799E98F6001B0000002000003A9E00044A5F2BCC28D7#1207672523990#com.sap.tc.logging##com.sap.tc.logging.APILogger.FileLog[setFormatter()]######c3c3f240058911dd9ed80012799e98f6#SAPEngine_System_Thread[impl:5]_10##0#0#Warning##Java###Attempting to change a formatter on active log ./log/system/httpaccess/responses.trc. reset() method must be called first.#1#java.lang.Exception: Attempting to change a formatter on active log ./log/system/httpaccess/responses.trc. reset() method must be called first.
         at com.sap.tc.logging.FileLog.setFormatter(FileLog.java:448)
         at com.sap.engine.services.log_configurator.admin.LogConfigurator.adjustConfiguration(LogConfigurator.java:795)
         at com.sap.engine.services.log_configurator.admin.LogConfigurator.applyConfiguration(LogConfigurator.java:1535)
         at com.sap.engine.services.log_configurator.LogConfiguratorContainer.prepareStart(LogConfiguratorContainer.java:545)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareCommon(StartTransaction.java:223)
         at com.sap.engine.services.deploy.server.application.StartTransaction.prepareLocal(StartTransaction.java:176)
         at com.sap.engine.services.deploy.server.application.ApplicationTransaction.makeAllPhasesLocal(ApplicationTransaction.java:365)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.runInTheSameThread(ParallelAdapter.java:132)
         at com.sap.engine.services.deploy.server.application.ParallelAdapter.makeAllPhasesLocalAndWait(ParallelAdapter.java:250)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationLocalAndWait(DeployServiceImpl.java:4450)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.startApplicationsInitially(DeployServiceImpl.java:2610)
         at com.sap.engine.services.deploy.server.DeployServiceImpl.clusterElementReady(DeployServiceImpl.java:2464)
         at com.sap.engine.services.deploy.server.ClusterServicesAdapter.containerStarted(ClusterServicesAdapter.java:42)
         at com.sap.engine.core.service630.container.ContainerEventListenerWrapper.processEvent(ContainerEventListenerWrapper.java:144)
         at com.sap.engine.core.service630.container.AdminContainerEventListenerWrapper.processEvent(AdminContainerEventListenerWrapper.java:19)
         at com.sap.engine.core.service630.container.ContainerEventListenerWrapper.run(ContainerEventListenerWrapper.java:102)
         at com.sap.engine.frame.core.thread.Task.run(Task.java:64)
         at com.sap.engine.core.thread.impl5.SingleThread.execute(SingleThread.java:79)
         at com.sap.engine.core.thread.impl5.SingleThread.run(SingleThread.java:150)
    Any ideas?

    Nothing really seemed to work when trying to solve this problem, just suddenly it stopped appearing. It might have been our installation of SPS 15, since it was around that time that the error went away.

  • Java files not compiling

    i have 3 java files that im trying to compile for my CS class:
    IntCalc.java
    IntCalcPanel.java
    IntCalcGUI.java
    the panel uses IntCalc for an object and the GUI uses the panel as an object.
    i cannot compile the panel or the GUI in the command prompt because it says
    IntegerCalculatorPanel.java:17: cannot find symbol
    symbol : class IntegerCalculator
    location: class IntegerCalculatorPanel
    IntegerCalculator calc = new IntegerCalculator();
    ^
    IntegerCalculatorPanel.java:17: cannot find symbol
    symbol : class IntegerCalculator
    location: class IntegerCalculatorPanel
    IntegerCalculator calc = new IntegerCalculator();
    ^
    2 errors
    even though all three files are in the same directory
    these files WILL compile if i use an IDE. i tried jGRASP and they compile and run fine.
    what do i do to fix this?
    (xp pro)

    For classpath, you can shorten the word to "-cp", I
    believe (it doesn't work on our Java at work, becauseNo, that will not work in this case!
    -cp only works on the java command (to execute Java programs), not on javac (the compiler). Stupid, isn't it?
    Make sure that your CLASSPATH environment variable is not set - that will make Java use the current directory as the default, and you won't have to type "-classpath ." every time.
    If you're starting a serious project with lots of source files, I suggest you have a look at Ant to manage your build process.

  • Files Not Refreshed

    Building a JSP which dynamically creates an HTML page with an included javascript file using
    &lt;script LANGUAGE="JavaScript" type="text/javascript" src="myFile.js"&gt;&lt;/script&gt;
    The problem is when I make changes in the file myFile.js, the changes are not refreshed when I run the project. I have attempted to rebuild, exit jDeveloper and everything else I can think of yet it continues to use the old version. What is going on and why are the changes not reflected when being run?
    jDeveloper 9.0.5.16.27 under Win2K.

    Just to add to the fine advice so far, sometimes just toggling the View to Column View or whatever it isn't the back will update it.
    Wonder if this works in Tiger...
    http://www.versiontracker.com/dyn/moreinfo/macosx/24356

  • PDF Files Not Opening Within Browser(s)

    All PDF files that I try to view within a browser (Firefox or Explorer) get sent (downloaded to) my download folder called, Downloads.  In the past, I was able to view these files from within the browser...what I prefer to have happen.  Can someone tell me how to have the PDF's open when I click on their link from within a browser?  I am using the latest version of Acrobat Readeron a Windows 7 system running the Home Edition (64 bit). 
    Thanks for any help - this has been frustrating

    Select a PDF you want to open, and right click on it.
    - Select Open with...
    - Select Chose default program
    - Select your browser (or expand the Other Programs and select your browser)
    - Make sure you check the "Always use the selected program to open this kind of file" option
    - Click OK
    - Double Click on your PDF.
    Tadaaaaaaaa!

  • .svg files not rendering in browser

    I've just uploaded my site (www.elcricdercas.com). None of the .svg files are rendering. This includes an Edge produced file in the front page animation. How come? I've checked the site on Safari and Firefox. The provider is Eclipse.net.uk

    Hi,
    Could you please check this thread, and see if get some hint
    Re: SVG files not rendering in Muse

  • JSP page not refreshing in browser

    Everytime I edit a JSP file, and try to refresh the JSP in the browser, I don't get an updated version... just the original page that I viewed first. Anyone got a solution?
    I tried deleting the work directory under the %tomcatHome% directory, and that seems to work until I view the page, and tomcat creates this work directory again. So when I try to refresh the page, because the work folder is still there, the page does not get refreshed. Weird... any solutions? Thanks again.

    I'm not sure if your using Tomcat or not but if you are give this a try:
    The ROOT context is the default Web application in Tomcat, and is convenient to use when you first learning about servlets and JSP (although you'll use your own Web applications once you're more experienced). The default Web application is already enabled in Tomcat 3, Tomcat 4.0.1-4.0.3, and Tomcat 4.1. But, in Tomcat 4.0.4 it is disabled by default. To enable it, uncomment the following line in install_dir/conf/server.xml:
    <Context path="" docBase="ROOT" debug="0"/>
    Taken from: http://www.moreservlets.com/Using-Tomcat-4.html#Enable-Root-Context
    This will make the server request a new page every time, not recommended for production apps but for development it will make life easier.

Maybe you are looking for

  • Animated gif moving to fast

    I am trying to display an animated gif in a JLabel. My problem is that for some reason the animated gif speeds through the frames, instead of moving at the speed it was created at. Any idea what might be causing it. Below is the code I'm using to dis

  • How to See Total line in Alv Table

    hi friends,          i write all code for totaling in WDDOINIT() Method of my View , but i can not see the total line .          pls help me

  • Mac Pro computer crashes then heavy fan activity

    My 2008 Mac pro has suddenly started to crash and then the fans come on very loudly.  I have been turning the computer off at this stage fearing possible trouble.  I have used Disk Warrior to write a new directory and thought after a day without a cr

  • OFFICE JET PRO 8500A PLUST WON'T PRINT COLOR

    My Officejet Pro 8500a Plus will not print in color. The color gradually faded then stopped. Ink was low. replaced all cartridges. Printhead status: Black/Yellow=good, Magenta/Cyan=fair no color on copying or printing

  • Error... trying to backup files from remote server

    I've tried to backup files from one server (client installed) to tape drive on the administrative server (administrative, media, client) but get an error. Backup of administrative server to the same media family was successful. What can be wrong? 201