Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 9 of 9

Thread: Novice needs advice

  1. #1
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Novice needs advice

    Hi and thanks for reading my post. Let me start with the fact that I am not in any way a Java programmer. I am a systems admin running a large IT shop with no Java programmers on staff. I have tried to search for the answer to my question but apparently I don't know enough to properly formulate the question! If I knew how to ask the question I'm sure google could answer it. :-)

    Anyway, here goes. We have a new application that we purchased from a vendor. It is custom written for our needs. It runs in a web browser and uses Java Runtime. In short we are receiving lots of calls at our helpdesk from end users of the application complaining that the program wont start. The solution is usually to clear the Java Cache. On Java.com there is a page explaining how to clear the cache and it says: "clear your cache so you can load the latest versions of Web pages and programs". The program is currently under development and is being constantly tweaked and changed. It does seem that when the program is changed we get a larger volume of calls to the helpdesk where the solution is to clear the cache again. I view this as a customer service issue that we should seek a permanent solution to. Yes, we can train end users to clear the cache, but we really shouldn't have to. The software developer seems content with it as it is and thinks it is perfectly reasonable for end users to know to clear the cache. This seems wrong to me. I could easily script something to clear the cache at shutdown or logoff, but most of my customers (5000+) are not on my network so I have no admin access to the PC. Besides, i don't know what other Java apps they may use and I don't want to break those. Further, the cache improves performance. So I would hate to deliberately reduce performance on my own app...

    Is Java Runtime, a program used by literally billions of people and developed by one of the largest corporations in the world really so fragile? It seems there should be a way for the program to detect a new version of the application has been published and overwrite the version in the cache. Am I totally off base? I hope I am explaining myself properly.

    Programming is not my strength. I am a systems admin. I'm afraid I don't know enough to tell if the programmers are being honest with me or just pulling the wool over my eyes. Any insight would be appreciated. Thanks!


  2. #2
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Novice needs advice

    How is the program distributed? It sounds as though the issue may be out-of-step Java classes, which should only be possible if class files are being distributed independently of each other.

    We should probably clear up what you mean by 'Java Runtime'. There is a Runtime class in Java whose main use is to gain access to non-Java code. Is that what you mean?

    Is there any way we can see the problem for ourselves?

  3. #3
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Novice needs advice

    Just a thought - if this is a browser cache issue and you are in control of your own web pages, there is one good way to circumvent the perversities of browser caching and that is to add a 'query part' in your web markup at the point where your resources are downloaded. If you were - for example - embedding a resource in a webpage called "GrahamGen.jar", you could edit your page markup and change the reference to the file for which the URL is valid to "GrahamGen.jar?version=MondayEveningBetweenTeaAndS upper" and that would cause any client browser loading your page to consider the URL as a new one it had never seen before. Most HTTP servers are really just fancy file servers and will just serve the file as usual, but all the If-Modified-Since and cache logic that would work to prevent your clients seeing the updated file would all be fooled into thinking a different file was being requested.

    I'm not sure from what you say if this is the issue or not - but explicit cache resets can sometimes be avoided with this simple workaround.

  4. #4
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Novice needs advice

    I'm afraid access to the application is restricted to law enforcement officers only. It is part of a system that gains access to criminal history through the FBI...

    There is no local installation of the program. All we have to do is install Jave Runtime Environment on the PCs. We are currently using Version 6 update 23. Build 1.6.0_23-b05. We then launch the application from a website.

  5. #5
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Novice needs advice

    From what I know of IIS and Internet Explorer, that makes senes. However, we do not have to clear the browser cache. Just the Java cache. Are they related in some way that I don't understand? We go throught eh COntrol Panel, click on the Java icon, then select "Settings" under the Temporary Internet Files and click on "Delete Files". Are these stored in the web browsers cache?

  6. #6
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Novice needs advice

    Are these stored in the web browsers cache?
    No they're not. Thanks for the extra details.

  7. #7
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Novice needs advice

    That workaround may still work. It's going to be difficult for anyone to help you with a secret system... I recall on one of my sites once having to clear the Java cache (taking the same steps you mention) for an application of mine which was an Applet. Running an applet does require the user has the Java Runtime Environment (everybody here would know it as the JRE - allows you to run Java applications as distinct from the JDK which allows you to develop them) installed. I haven't received any complaints about out of date applets on my system, and I see in my page source a "?v=12" tacked on to the back of the applet URL. It is a kludge, but it does work. Is that something you can do?

    edit: I should say that cache handling - both browser and client Java cache - will mostly conform to the w3 standards, which do include some 'helpful' recommendations like downstream caches should 'guess' how old something is and how long to hang onto it before deciding it might be stale:
    http://www.w3.org/Protocols/rfc2616/...html#sec13.2.2
    Last edited by Sean4u; September 12th, 2011 at 03:01 PM.

  8. #8
    Junior Member
    Join Date
    Sep 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Re: Novice needs advice

    It does seem to me that there should be some way for the local workstation to determine if the version of a file on the website is newer than the one stored in Cache. I find that extremely hard to believe. It sounds like we are in agreement, there scan\should be something on the server end that indicates to the client that a new version of the page\program exists and should be copied to the cache.

    Mostly I was searching for confirmation that this is not a known isue with JRE that all web developers and programmers have to deal with which is basically what the vendor is saying. I find it hard to believe there is such a large flaw in such a widely used product.

    I'll see what they say when i ask them again...

  9. #9
    Super Moderator Sean4u's Avatar
    Join Date
    Jul 2011
    Location
    Tavistock, UK
    Posts
    637
    Thanks
    5
    Thanked 103 Times in 93 Posts

    Default Re: Novice needs advice

    Did you read down to 'Expiration calculations'? What w3 says *is* how the web works, or at least in that ballpark. There's a huge diversity of participants in the WWW and they've all been guilty at some time or another of 'making stuff up' to suit themselves. Heuristics abound to keep the 'lowest common denominator' - a user with a browser - having a reliably consistent experience. There is a lot of advice on the Internet of combinations of headers servers can send with their content, which are conjectured to cause browsers and caches to re-validate (check with the origin server) their caches, but in my experience none of it has ever worked reliably across two or more user-agents. Last time I looked the query-part kludge was the world's favourite way of tricking user-agents into reliably reloading a resource.

    This isn't a flaw in Java - or in any web-aware product. It's a feature in HTTP that usually protects servers from vast amounts of spurious cache validation queries and users from annoying lags while their browsers validate recently-loaded content which is almost always still valid. You'll see web devs crying about the same problem when they update their visual themes and clients get a mix of new look and old images and scripts. It's a 'feature' for most Web users and only a flaw for a few Web admins. Welcome to the club!

Similar Threads

  1. Need some serious advice
    By Rituparna in forum The Cafe
    Replies: 4
    Last Post: September 25th, 2013, 08:26 AM
  2. need for some advice
    By kasiopi in forum AWT / Java Swing
    Replies: 6
    Last Post: January 26th, 2011, 10:34 AM
  3. A little advice please:
    By SDKC in forum Java Theory & Questions
    Replies: 1
    Last Post: December 8th, 2010, 08:15 PM
  4. Novice with java methods, please help!
    By raidcomputer in forum What's Wrong With My Code?
    Replies: 1
    Last Post: October 14th, 2009, 04:23 AM
  5. i need some advice ....
    By mdstrauss in forum Java Theory & Questions
    Replies: 8
    Last Post: July 24th, 2009, 02:29 PM