Java takes too long to load if java.policy has many grants to http URLs

I am facing a nasty issue with trying to secure the Java browser plugin using the java.policy file. Some jars cause the JVM to stall for a time that is directly proportional to the size of the java.policy file.
The entries inside our java.policy look like this:
*grant codeBase "http://some.site.local:port/-" { permission java.security.AllPermission; };*
The more entries I add to this file, the slower the performance gets (as of java loading time). Using -Djava.security.debug=all I found that the timeout is 4.5 seconds for every grant in the java.policy. The log output just before the delay looks like this:
policy: evaluate codesources:
Policy CodeSource: (http://some.site.local:port/- <no signer certificates>)
*Active CodeSource: (http://wassup/wassup.jar [*
The http://wassup/wassup.jar is a signed test jar I installed on a local web server.
This old thread suggests this is a DNS/Netbios lookup timeout. However, Wireshark does not show any such traffic. Our DNS server does reply quickly, both on failure and success. http://192.9.162.102/thread.jspa?threadID=5250986&messageID=10039588
When I use the remote http://mindprod.com/applet/wassup.html there is no delay. The only difference I can see is that the remote JAR is always loaded via http, while the local jar is cached. Remote jar:
*network: Cache entry not found [url: http://mindprod.com/applet/wassup.jar, version: null]*
network: Connecting http://mindprod.com/applet/wassup.jar with proxy=HTTP @ proxy.company.local/10.10.1.2:8080
network: Downloading resource: http://mindprod.com/applet/wassup.jar
Content-Length: 19.804
Content-Encoding: null
Local jar:
network: Connecting http://wassup/wassup.jar with proxy=DIRECT
network: Connecting http://wassup:80/ with proxy=DIRECT
network: ResponseCode for http://wassup/wassup.jar : 304
network: Encoding for http://wassup/wassup.jar : null
network: Disconnect connection to http://wassup/wassup.jar
cache: Reading Signers from 1218 http://wassup/wassup.jar | C:\Program Files\Java\JrejCache\6.0\53\bd564b5-14aba644.idx
cache:  Read manifest for http://wassup/wassup.jar: read=691 full=691
I am using 1.6.0u22 at the moment. Is there anything I can do to fix this?

>
Try putting the domain names in the Windows hosts files with their numeric addresses. That should bypass any DNS lookup. If you have central maintenance you can update all the hosts files when IP address change.
We have considered this option, but then we have the same problem described on c). IP maintentance. IPs change often and we cannot control it.
Malcolmmc, paul.miner, jschell,
I think the problem is Netbios resolution, rather than DNS one. The sites that figure on java.policy file, are not available in terms of Netbios (they are not LAN clients), so they are only visibles on DNS resolution. But Java still tries to resolve them with Netbios first, so I think there's a timeout on this resolution (not the DNS one) . This timeout causes the problem.
But, anyway .... Why is Java trying to resolve those names ??? In fact, Java will only have to match the site you are visiting with the site specified on java.policy (just a String comparison). Why does Java need to resolve (netbios & dns) the names on java.policy? I cannot figure out why.
Thank you all.
Marc

Similar Messages

  • Java takes too long to load if java.policy has many sites to grant acess to

    The problem is that we noticed that the time Java takes to load when it's invoked by any applet from the very first time on IE, is directly proportional to the size of the java.policy file.
    You can have many sites to grant access to inside your java.policy file. As you know, it's typically done like this:
    grant codeBase "http://<url>/<dir>/*" {
         permission java.security.AllPermission;
    The more entries I add to this file, the slower the performance gets (as of java loading time).
    We have more than 10 entries on our java.policy file, and we are getting a 40-seconds penalty time each time java is loading.
    Having gone further with this problem, we have discovered that time is being lost when Java is trying to resolve (netBios and DNS) ALL of the sites specified on the java.policy file, BEFORE running any applet of ANY site (when Java loads). We cannot understand why Java is trying to resolve those names, even though you are not trying to visit them....
    Is there a workaround for this issue ?
    We've tried to:
    a) Use IP's instead of names on the java.policy: this resolves the problem but it creates another one: IP maintenance. It's not applicable because IP's can change without notice.
    b) Use more patterns like "*", for example:
    grant codeBase "http://*mysit*/<dir>/*" {
    so that Java will not be able to "guess" the name, nor resolve it.
    But unfortunately, this didn't work :-(
    c) Include the java.policy file on each applet (inside the jar file), instead of an unique java.policy file on each Windows machine. This solution doesn't fit our requirements, because we cannot ask applications to manage their own permissions. We want to control them with an unique & protected & secured java.policy file.
    d) Sign applets: Same reason of c)
    Is there a workaround for this issue ?
    We need Java to load in few seconds, but mantain java.policy funcionality.
    Thank you.
    Marc.

    >
    Try putting the domain names in the Windows hosts files with their numeric addresses. That should bypass any DNS lookup. If you have central maintenance you can update all the hosts files when IP address change.
    We have considered this option, but then we have the same problem described on c). IP maintentance. IPs change often and we cannot control it.
    Malcolmmc, paul.miner, jschell,
    I think the problem is Netbios resolution, rather than DNS one. The sites that figure on java.policy file, are not available in terms of Netbios (they are not LAN clients), so they are only visibles on DNS resolution. But Java still tries to resolve them with Netbios first, so I think there's a timeout on this resolution (not the DNS one) . This timeout causes the problem.
    But, anyway .... Why is Java trying to resolve those names ??? In fact, Java will only have to match the site you are visiting with the site specified on java.policy (just a String comparison). Why does Java need to resolve (netbios & dns) the names on java.policy? I cannot figure out why.
    Thank you all.
    Marc

  • Page takes too long to load because of videos

    Hi. I have a website that I made, but the page takes too long to load because there are videos on it. Is there any way to stop the videos from auto-loading and instead only load when someone clicks on them to play?

    There are several ways to have videos on a page without having them load until they are selected to play. A couple are:
    1 - Opening Item in a New, Precisely Sized Window. This test site has 9 videos on the page: PhotoPresenter Animated Slideshow Themes.
    2 - QT Movies via Export for Web in QT Player. This method is more difficult to implement.
    OT

  • HT4352 apple tv takes too long to load photos

    I am running iTunes (11.1.5.5) on Windows 7 and have setup home sharing and accessing the Photo Library from Apple TV 3rd Generation.
    We have a lots of photos (approx 21000) organizaed in folders, eg:
    Main Photo Folder
    Folder 1 (5500 photos)
    F1-Sub 1
    F1-Sub 2
    F1-Sub 3
    Folder 2 (3500 photos)
    F1-Sub 1
    F1-Sub 2
    F1-Sub 3
    Folder 3 (12000 photos)
    F1-Sub 1
    F1-Sub 2
    F1-Sub 3
    Apple TV doesn't show the sub-folders beyond the first set of folders and as a result it takes too long to load our list of photos, is there anything that can be done to fix this?
    Thanks!

    I am having exactly the same issue. Moved house and now starting a movie takes minutes, not seconds... I've got both the Mac and ATV connected via ethernet to my Airport Extreme base station, but have no explanation for this bizarre slowdown. I also don't have internet currently, but I can't understand with content not purchased on iTunes, why that would make any difference...?

  • [SOLVED] initramfs takes too long to load

    Using systemd-analyze I found out that initramfs takes too long to load:
    463ms (kernel) + 11875ms (initramfs) + 6014ms (userspace) = 18353ms
    My HOOKS array in mkinitcpio.conf is the following:
    HOOKS="base udev autodetect modconf block encrypt lvm2 filesystems usbinput fsck"
    I suspect that the long loading time of initramfs is caused by partitions decryption (I am using dm-crypt / LUKS on top of LVM).
    Is there any tool that can report loading times of HOOKS seperately, just like systemd-analyze plot does for userspace?
    Last edited by nasosnik (2013-01-21 14:45:28)

    cfr wrote:
    In what sense is it "too long"?
    I'm just wondering: suppose that you find out that it is because you are using encryption. Would you then switch to a non-encrypted system? Would you make better use of the extra seconds you might save on those rare occasions when you reboot? Even if you reboot twice a day, you might save what? Suppose you would even save 5s per boot. That will give you a whole extra 1 minute and 10 seconds a week. Assuming you don't multitask. Obviously if you multitask, the gain will be less. Would that make it worth risking the security of your data?
    EDIT: I didn't mean this to sound as confrontational as it does now I read it back. It just always puzzles me that people are so concerned about shaving a few milliseconds here and there. I always hope that they put the time they save to good use but then I realise that the time they spent shaving the milliseconds off will obviously outstrip the time saved.
    I really don't care about the boot time because of the reasons you have already mentioned. I just want to figure out if there is any misconfiguration. I am just investigating why initramfs takes significant longer to load compared with my desktop Arch installation (non-encrypted) 1316ms for initramfs. My desktop has a Pentium 4 CPU and laptop has a quad-core i7.
    roentgen wrote:11875ms (initramfs)  means the time it takes you to type the password.
    systemd-analyze is not counting the time is spent to type the password.

  • Apple TV Gen 3 takes too long to load 15,000 photos. Do I need to go back to ATV Gen 1?

    I just purchased Apple TV (Gen 3) It takes too long to load my over 15,000 photos for viewing.   This was never a problem with my ATV (Gen 1).  Do I need to go back to ATV Gen 1?

    Do you have a technical question?
    What have you done to troubleshoot?
    Typically issues like this are related to the local network. First thing would be to try ethernet, if on wifi. Make sure router is up to date. Reboot ATV, router.
    You can go to istumbler (Mac) or netstumbler (PC) to get a report of the network.

  • What can I do when my iphone 4 take too long to restore? It only has 1 song on it

    What can I do when my iphone 4 take too long to restore? It only has 1 song on it and 1 additional app beside the standard apps.
    The circle in the middle of the phone has been spinning from after 4 yesterday afternoon until now. Please help me

    I'm having the same problem.  I got error message 21.  I went to apple store.  they are saying i have a hardware error.  Really, my phone was working before the update.  Asked me for $150 to get another one when I am due to get a new one and wanted to pass this one on to my child. 
    Help please,
    I will be glad to go back to the older software update

  • Keep gettng messages to update but it takes too long to load, why?

    Keeping getting messages to update FIREFOX. When the link is clicked it takes a very long time to load. Therefore, to date the updates have not happened.

    What is taking too long to load with respect to the page you linked?

  • Takes too long to load a ses file

    Why does it take so long to load a *.ses file? To me it seems that it takes waaaaaaaaaay too long.

    It just now took 3 minutes 55 seconds to load a 1.40 MB ses file. All files probably total 5-600 MBs. A whole lot of effects. I have an AMD Athlon 4200 64 X2 Dual Core. 4 GB ram.
    Waaaaaay too long. I hate to close the ses file when I'm through for the day cause I have to load it back in.
    I have pk files turned off. I guess I'll have to turn them back on. I hate all those little files cluttering up my drive. I guess it's a trade off, though. Damned if you do, damned if you don't. Thanks for the replies.

  • Interactive forms takes too long to load - sometimes crashes reader.

    Hi Gurus,
    I'm just wondering if anyone have this problem?
    I just configured ADS and created a sample WD program to display an interactive form, the form is not complex, only 2 text fields and an image.
    But when I deploy or run the program, the interactive form container hangs and take very long to process before displaying.
    After I save the PDF file to a local drive, when I try to open it, it will take very long and sometimes crash my system.
    Even when I click on "PDF Preview" to view the form in NWDS it take very long too.
    At first I thought it could be due to my system and I open downloaded PDF file on other PCs, but the problem occurs too in those PCs.
    Using Acrobat Reader 8.1.2, then downgraded to 8.1.1, still no avail.
    Everytime I open the PDF or WD loads the PDF, when I check the Task Manager the process of AcroRdr32 will hog the system processes and use up the memory. I have no problems with other PDF files, only those generated by the WD application gives problems.
    Someone hit the same problem? Any advise? Could it be the ACF or Adobe lifecycle issues?
    Please help. Thanks for all answers.
    Best Regards,
    Jansen

    Hi Jansen,
    If you are using Adobe Reader 8.1.* or above and activex controls in your form, you need to install the latest version of ACF and that will resolve the issue. And do remember to uninstall your old version of Adobe Reader first and then install Reader 8.1.* freshly and after installing it proceed with ACF installation. You have to follow the sequence.
    For ACF installation you may read  Note 766191 - Active Component Framework Installation.
    ACF Installable:
    https://sapmats-de.sap-ag.de/download/download.cgi?id=F9RUZ3Q7TERUBSMHSXWT3UMEM59IJYIPA931VQD32A1UNAKZ6B
    Do reward points if found helpful.
    Regards,
    Arafat

  • Flash takes too long to load online

    Hi All,
    I am creating a web page using flash and it takes a long time
    to load when you go to the webpage. it opens as if it is working,
    but then the links don't work properly...that is...until at the
    bottom of the browser window it says "done" instead of "waiting for
    http://www.blah blah blah..." once it
    says "done" it works just fine.
    two questions:
    1. is there a way to reduce the size of the flash file so
    that it loads quicker online?
    2. OR..does anyone know how to create that little "intro"
    screen when you go to a website that says "loading" and you see a
    little bar loading....and then only when it is COMPLETELY loaded,
    does the flash begin?
    thanks so much!

    Hi Meesh, I know exactly how you feel, I was there when i
    first started. Worry not!! Best and to keep your loading time down,
    is to keep your .SWF files separate, and load them into your site
    according.
    eg..
    Template ---=> make sure this ONLY consisits of the site's
    look, and navigation.
    BG pics -----=> make a separate SWF containing your pics
    if they are quite large in size.
    Each Page --=> make each page separate SWF, and load them
    separately via your navigation.
    Basically when planning your site, think how you can break it
    up into sections that you can load separately.
    Then use the pre-loading code that Michaeltowse gave you, at
    the beginning of each separate SWF you make, to make it all
    complete with a loading bar.
    Hope this helps. Good luck

  • Opening a sequence takes too long to load

    TestStand 3.1 sequence takes very long (4 minutes) to load. Same sequence takes a few seconds only at another PC.
    The delay is at a Thread.PostUIMessage ActiveX call.
    Any idea, what's wrong?
    Thanks!

    Hi,
    Do you have some network paths in you TestStand Search Directories, if so you might try removing them.
    Regards
    Ray
    Regards
    Ray Farmer

  • Program now takes too long to load...

    When I launch the program now there's a LOT of disk activity (assuming it's looking for associated files) then after that there's the normal load time for the project I'm opening. Any ideas? Does the program have an optimization scheme? Thanks

    It just now took 3 minutes 55 seconds to load a 1.40 MB ses file. All files probably total 5-600 MBs. A whole lot of effects. I have an AMD Athlon 4200 64 X2 Dual Core. 4 GB ram.
    Waaaaaay too long. I hate to close the ses file when I'm through for the day cause I have to load it back in.
    I have pk files turned off. I guess I'll have to turn them back on. I hate all those little files cluttering up my drive. I guess it's a trade off, though. Damned if you do, damned if you don't. Thanks for the replies.

  • Photos take too long to load

    I have had my website running for months now. I regularly add new photo pages, with up to 300 photos a time. the photo pages always take some time to load (a couple of minutes) but this is fine. then when you click a photo, it takes another minute to load all thumbnails and be ready to navigate to other photos (in the enlarged view).
    normally, at this stage, clicking the thumbnails, or next would load up the other images instantly. very quick. NOW, every time i click on a thumbnail, it takes over 5 seconds to load next photo.
    why has this changed??
    as i am writing this, i realise it only happens on windoze/IE7. as my dad and next door neighbour have both just got vista. that disgusting attempt at an os.
    grrr. i hate vista and i hate bill gates.
    anyway, could someone who's got access to a vista machine try downloading Firefox - if you haven't already, and see if it fixes the problem. photo pages - enlarged version - clicking from thumbnail to thumbnail - should be very quick.
    please try this. thanks a lot

    What format are you pictures? When you don't need them in a special format changing them to a .gif will reduce the file size a lot and the quality is still great.
    I mostly use .gif so i can guarantee a fast loading of the site.
    Tip: Don't name your pictures just like 1,2,3 etc.. By giving them a small description as a name (p.e. '30Tablet_MultivitaminBottle.gif') helps your google search ranking.

  • Coldfusion Page  takes too long, to Load.

    Hi All,
    I have just moved into Coldfusion technology. My expertise is
    predominantly on Oracle and PL/SQL development.
    In the application i am working on, we are currently facing,
    an issue. We have a requirement, that is handled by dynamic
    dropdowns. We use Javascript to control the values loaded in a
    dropdown. (By default, the Country, State, City, Facility and
    Facility Type for a user will be loaded. He can choose any of the
    values in the dropdown and that would control the other dropdown's.
    If a Country is chosen, the states corresponding to that country
    should be loaded in the next drop down .. and so on ... )
    We have drop downs like, Country, State, City, Facility and
    Facility Types. The backend, sends across, all the values as the
    combinations of Country,State,City, Facility and FacilityTypes that
    have been rolled out , to enable selection as a refcursor. The page
    load was surprisngly taking about 91 seconds!! We did check the
    record volumes and they are not more than 1500 rows. Also, the
    database queries, execute in 130 microseconds each. Thus, the code
    is indeed optimized from the database perspective.
    The Issue i am facing is the performance hit when the page
    loads. For just 1500 rows of the combinations i have mentioned, it
    takes 94 seconds. It takes only 24 seconds in my offshore. However,
    i have verfied machine configurations and i seem to have a better
    configuration that my offshore team. Yet, it takes more time to
    load here. Also, does the CF application server parse all the
    functions OnLoad, Onchange even before the Page is loaded? Anyone
    who has already encountered this issue?
    Cheers,
    J

    What version of CF (guessing 6.1 according to your username)?
    What database?
    What database driver?
    Is the database indexed correctly?
    Is the database local?
    Are you caching your queries, since a list of states is
    unlikely to change?
    What hardware on the server?
    Are your heap sizes optimized in the CF Administrator?

Maybe you are looking for

  • PF not getting deducted for the mid month joinees.

    Hi, The problem is coming in the PF deduction of the employees who have joined in the mid of the month. For ex if an employee's basic salary is 7000 and the emp joined in the mid of the month , the system is taking PF from RS 3500 , where PF deductio

  • How do I sync my Iphone with my MacBook Pro with a reformatted hard drive?

    My MacBook Pro hard drive crashed. I rebooted from the Mac OS X install DVD. Now, my itunes is empty. When I tried to sync my iPhone 4, it states that it will erase everything on my phone and replace it with the items in itunes (which is empty). What

  • Will I be able to upgrade to Lion ?

    I have this iMac will I be able to use Lion on my iMac, I don't know how to see the manufacturing date Thanks help Ferro

  • Stop Import if condition is not set

    Hi all, I would like to check if content of the file I want to import is similar to POV selection. To do thaht I created a BefImport script that read the first line of my file and check Period and Category POV with date and category values on my file

  • Edit page in web page composer

    Hi all! In Web Page Composer, I can create a new web page. However, I can't edit this page. It's a role problem. Somebody know what the role I need in order to edit page, and where the administrator can attribute this role? Thank you for your help! B