How to preload jar classes?

Discussion in 'Java' started by Marcus Leon, Oct 3, 2005.

  1. Marcus Leon

    Marcus Leon Guest

    The first request of a jsp page using a tag library (Display Tag
    Library) is slow. I believe it is due to the JVM having to load a
    whole bunch of classes. Is there a way to get the JVM to preload these
    classes?

    We're running Weblogic 8.1.

    Thanks.
     
    Marcus Leon, Oct 3, 2005
    #1
    1. Advertising

  2. "Marcus Leon" <> writes:

    > The first request of a jsp page using a tag library (Display Tag
    > Library) is slow. I believe it is due to the JVM having to load a
    > whole bunch of classes. Is there a way to get the JVM to preload these
    > classes?


    Add the JSP as a servlet in web.xml and declare its load-on-startup
    element.
     
    Tor Iver Wilhelmsen, Oct 3, 2005
    #2
    1. Advertising

  3. Marcus Leon

    Marcus Leon Guest

    Thanks Tor. But it doesn't seem to work. Looks like that calls some
    basic init method but it doesn't actually do the processing of the JSP
    page where the vast majority of the classes are loaded.
     
    Marcus Leon, Oct 3, 2005
    #3
  4. Marcus Leon

    Roedy Green Guest

    On 3 Oct 2005 07:56:53 -0700, "Marcus Leon" <>
    wrote or quoted :

    > Is there a way to get the JVM to preload these
    >classes?


    Running a piece of code that called some static method in each class
    you wanted to preload would do it. Or you could look at a public
    static field, e.g. serialVersionUID.
    --
    Canadian Mind Products, Roedy Green.
    http://mindprod.com Again taking new Java programming contracts.
     
    Roedy Green, Oct 3, 2005
    #4
  5. Marcus Leon

    Marcus Leon Guest

    Thanks Roedy.. that did the trick!
     
    Marcus Leon, Oct 4, 2005
    #5
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Arnold Peters
    Replies:
    0
    Views:
    590
    Arnold Peters
    Jan 5, 2005
  2. muttley
    Replies:
    0
    Views:
    2,736
    muttley
    Oct 20, 2005
  3. cyberco
    Replies:
    4
    Views:
    3,783
    Roedy Green
    Feb 14, 2006
  4. Arnold Peters
    Replies:
    0
    Views:
    672
    Arnold Peters
    Jan 5, 2005
  5. pcouas

    preload jar applet problem?

    pcouas, Aug 10, 2007, in forum: Java
    Replies:
    6
    Views:
    666
    Andrew Thompson
    Aug 11, 2007
Loading...

Share This Page