The impact of java.ext.dirs and XMX settings to a JVM

Hello,
I've been using a XMX setting of 3800M for a particular JVM running a particular task.
However, if I pass the -Djava.ext.dirs option, and point it to some directories, the JVM fails for the same task I've been running in my first run.
truss output appears to show the failure occurring during mmap() resulting in ENOMEM.
The question is, under what condition would java.ext.dirs change the behavior of my XMX setting? If it take it out, it runs fine.
Java version: 1.4.1, SunOS Sparc

This sounds like a problem I had a while ago that stumped me for several days.
If your class with the "main" method is loaded from the extensions directory (java.ext.dirs), it appears that a special classloader is used to do that, not the standard classloader that looks in the classpath. This special classloader appears to ignore the classpath and look only in the extensions directory. Also, the JVM appears to try this classloader before the standard classloader.
Now, when one class wants to load another class, it always uses the classloader that loaded it to load that other class (unless you specifically write your program to use some other classloader). So what is happening to you is this: The "extensions classloader" loads your class with the "main" method, because it can. Then your "main" method tries to load another class, but it uses the "extensions classloader" to do that. And the "extensions classloader" doesn't look in the classpath, and what you saw is what you got.
At least the answer to your problem is clear: Don't do that.

Similar Messages

  • Changing java.ext.dirs property

    Hi,
    I am having trouble with the system property java.ext.dirs. I want to change its location. The name suggests (dirs) that it will accept multiple directories. The reason I want multiple directories is to be able to use the jars in the default location as well. But it doesn't work and gives the following error:
    java.lang.NoClassDefFoundError: somepath/some_application
         at java.lang.ClassLoader.defineClass0(Native Method)
         at java.lang.ClassLoader.defineClass(Unknown Source)
         at java.security.SecureClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.defineClass(Unknown Source)
         at java.net.URLClassLoader.access$100(Unknown Source)
         at java.net.URLClassLoader$1.run(Unknown Source)
         at java.security.AccessController.doPrivileged(Native Method)
         at java.net.URLClassLoader.findClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at java.lang.ClassLoader.loadClass(Unknown Source)
         at sun.misc.Launcher$AppClassLoader.loadClass(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)
         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)
    Is there any way I could add another directory instead of replacing the default one.
    Also, I have to manually create a directory if I want lib/ext to point at another location. Is there any way to tell jre to create the directory if it doesn't already exist.
    Thanks.
    -jas

    Hi There,
    Linux Red Hat 5 EL
    JVM 1.5
    Anyone knows of an optional to define environment variable to override / append to the ext path? I'm asking because I have an installation that include a whole bundle of 3rd party jar's. I would like to have this available to all components of the system without me having to add the "-D" flag to each JVM launched.
    I already have a script that defines JAVA_HOME and alike on system startup using /etc/profile.d and I would like to add to that my custom ext definition, something like export JAVA_EXT_PATH="/opt/MyProduct/java-ext"
    Reference article : http://today.java.net/pub/a/today/2005/04/26/extending.html
    Thank you,
    Maxim.
    // I know this is a historical post, but perhaps some one found a solution

  • Does java.ext.dirs have any influence on the heap XMX setting?

    Hello,
    I've been using a XMX setting of 3800M for a particular JVM running a particular task.
    However, if I pass the -Djava.ext.dirs option, and point it to some directories, the JVM fails for the same task I've been running in my first run.
    truss output appears to show the failure occurring during mmap() resulting in ENOMEM.
    The question is, under what condition would java.ext.dirs change the behavior of my XMX setting? If it take it out, it runs fine.
    Java version: 1.4.1, SunOS Sparc

    If it causes things to be loaded that wouldn't otherwise be loaded.
    I assume the fairure you're getting is related to memory? you didn't say.

  • Setting java.ext.dirs property at start-up vs. runtime

    I've been trying to invoke an input method (based on Java IMF). I'd like to place a lang_im.jar file, packaged as installed extensions, at an arbitrary directory, say, C:/foo, other than lib/ext to bypass system security/privilege issues that prevent one from copying lang_im.jar into lib/ext. I found that setting "java.ext.dirs" system property at start-up time, e.g.,java -Djava.ext.dirs=C:/foo -jar myprogram.jarallowed me to activate the input method, but setting it at runtime by placingSystem.setProperty("java.ext.dirs", "C:/foo");at the top of main() changed the extension directory but did not load the installed extension at the specified directory. Apparently, the extension mechanism behavior varies in the cases of before and after classloading, I guess.
    How can I make it so that setting the property at runtime will work the same as at start-up? Thanks.
    Quan

    Can anyone help?

  • Can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    can someone pls help me with java on my macbook pro because after i download the mountain lion java has died and i need java to see streaming quotes from stock market

    Java is no longer included in Mac OS X by default. If you want Java, you will have to install it.
    However, note that you should think twice before installing Java for such a trivial need as looking at stock market quotes. There are other ways to get that information that don't involve Java, and using Java in your web browser is a HUGE security risk right now. Java has been vulnerable to attack almost constantly for the last year, and has become a very popular, frequently used method for getting malware installed via "drive-by downloads." You really, truly don't want to be using it. See:
    Java is vulnerable… Again?!
    http://java-0day.com

  • I have a MacBookPro6,2 and would like to connect an older Dell flatscreen, model L17BNS. I would welcome any information about the type of cable I need and any settings I might need to change, etc. Thank you for your time.

    I have a MacBookPro6,2 and would like to connect an older Dell flatscreen, model L17BNS. I would welcome any information about the type of cable I need and any settings I might need to change, etc. Thank you for your time! I really appreciate the assistance. Kathy

    According to:
    http://en.community.dell.com/support-forums/desktop/f/3515/p/19351107/19767627.a spx#19767627
    It has DVI ports.  This means you are best to use an adapter that supports DVI.  Note there is no audio that carries over DVI.  What you need is a mini-Displayport to DVI adapter, and the proper DVI cable. Since Dell doesn't have the specs, you'll need to tell us if you have pins or holes, and how many are grouped.

  • The Creative Cloud application becomes inoperable continually on both my Windows 7 and 8.1 operating systems. I'm tired of re installing the application after deleting the OOBE file to get updates and syn settings between computers for Photoshop. Is this

    The Creative Cloud application becomes inoperable continually on both my Windows 7 and 8.1 operating systems. I'm tired of re installing the application after deleting the OOBE file to get updates and syn settings between computers for Photoshop. Is this an endemic problem with others? I'm using Google Chrome as my browser. Is this an issue with the problem?

    Similar problem just happened to me with the Creative Cloud Update 1.7.1.418—slightly different so I thought I'd share. I have multiple Adobe Creative Cloud programs installed on my computer, all working just fine. I updated the Cloud App to the latest version and then it shows me that I have only one program installed! All my previously installed programs (Photoshop and the like) still work but show as "install" instead of "Up to date". Initially I thought I'd have to re-install the Cloud app or recreate the OPM data base but then I noticed that some of the Cloud app preferences (Apps > Settings > App Language) were different to what I had set previously. I use English (International) language, the update had reverted the app back to English (North American). I flicked back to my previous language and bam, all my apps now show as being installed correctly.

  • Why don't the options to not check if Firefox is the default browser, set the homepage to a blank page, and password settings hold?

    Why don't the options to not check if Firefox is the default browser, set the homepage to a blank page, and password settings hold? It opens to a firefox page and asks if I want to make firefox the default and has the checkbox checked to check for default with every launching.
    Just updated to Firefox ESR 24.6.0

    This article lists a number of possible reasons that Firefox might be unable to save your preference changes during your session, or that they might be overridden at startup: [[How to fix preferences that won't save]].
    Another common issue is a feature of security or utility software that protects you from unwanted browser settings changes by reverting them back to an earlier state. For example, Advanced SystemCare's Surfing Protection feature can do this. You may need to turn off such features, if you have them, in order to keep your changes.

  • Help needed in learning the basics of Java Smart Card and implementation?

    Hello every body,
    I am trying to develop the applications on java contactless smart cards technology.
    Can any body give me the details like how to start?
    What are the required softwares and installation procedure and path settings and etc.?
    I am the beginner in java smart card application development.
    plz help me out

    Dear Friend,
    I would advice to divide learning into two main parts: JavaCard technology and contactless RFID cards. For JavaCard technology you can find useful articles on Sun web-site (developers.sun.com/mobility/javacard/articles/javacard1/). For contactless RFID you can find few useful books at Amazon. Regarding software you need JC development kit. How to install it there is an instrunction in JCDK user guide.
    If it is not a secret what a javacard contactless card you are going to use in your work?
    Yours
    Dmitri

  • The impact of accrue at receipt and accrue at period end on project costing

    What is the impact of checking the accrue on receipt flag on the PO shipment on the PRC: Interface Supplier Costs behavior?

    Hi
    The system should be setup with Accrual Method on Receipt (not on period end).
    On PO shipments of Goods line type you may enable the check box - Accrue on Receipt. This is mandatory for Inventory destination and a default for Expense destination.
    When goods arrived from the supplier you enter a receipt transaction. That receipt transaction will get accounted and sent to SLA and GL.
    The process PRC: Interface Supplier Cost have several parameters. You can select to interface PO Receipts transactions into Projects Costing. You would select to interface invoices as well. The system will check if the receipt transaction has been interfaced to PJC. If so, only AP variances will be imported from AP to PJC. If the receipt transaction has not been interfaced to Projects, then the entire AP invoice will be imported.
    Another option is to always interface receipt transactions to Projects, and from AP to always interface only the variances, regardless if the receipt transaction has been already imported or not.
    Dina

  • JAVA ENVIRONMENTAL VARIABLE AND PATH SETTINGS

    Hi all,
    I am having a pecuilar problem with java environment variables and setting the path.
    I am trying to install and check the instalation using some pre-provided batch commands from Open GTS.
    The error log is as below .
    ** Found 2 Error(s)!
    1) The 'PATH' environment variable points to the JRE, rather than the JDK.
       [Reason: The 'PATH' environment variable points to the JRE (Java Runtime
         Environment), rather than the JDK (Java Developer Kit).  The JDK already
         contains the JRE, so a separate JRE insallation  is not necessary.]
       [Fix: Set the 'PATH' environment variable to point to the JDK installation bi
    n
         directory.]
    2) 'JAVA_HOME' does not match the Java installation 'PATH' directory 'C:\Program
    Files\Java\jre6'.
       [Reason: The version of Java referenced in the executable 'PATH' environment
         variable does not match 'JAVA_HOME'.]
       [Fix: Make sure both the 'JAVA_HOME' and 'PATH' environment variables point t
    o the
         same installed JDK.]
    No warnings reported
    Further more these may help understand better
    C:\Dush\Workspaces\JavaWorkspace\OpenGTS>echo %JAVA_HOME%
    C:\Program Files\Java\jdk1.6.0_03
    C:\Dush\Workspaces\JavaWorkspace\OpenGTS>path
    PATH=C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C
    :\WINDOWS\System32\Wbem;C:\Program Files\apache-ant-1.7.0\bin;C:\Program Files\J
    ava\jdk1.6.0_03\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Dush\Workspac
    es\JavaWorkspace\OpenGTS\bin;
    C:\Dush\Workspaces\JavaWorkspace\OpenGTS>The resolution suggests that the path point to the same instance of jdk installation but that has already been done,
    I do not understand from where does the
    C:\Program Files\Java\jre6 path get set.
    Please suggest..

    dushdushyant wrote:
    ** Found 2 Error(s)!
    1) The 'PATH' environment variable points to the JRE, rather than the JDK.
    [Reason: The 'PATH' environment variable points to the JRE (Java Runtime
    Environment), rather than the JDK (Java Developer Kit).  The JDK already
    contains the JRE, so a separate JRE insallation  is not necessary.]
    [Fix: Set the 'PATH' environment variable to point to the JDK installation bi
    n
    directory.]
    2) 'JAVA_HOME' does not match the Java installation 'PATH' directory 'C:\Program
    Files\Java\jre6'.
    [Reason: The version of Java referenced in the executable 'PATH' environment
    variable does not match 'JAVA_HOME'.]
    [Fix: Make sure both the 'JAVA_HOME' and 'PATH' environment variables point t
    o the
    same installed JDK.]
    No warnings reported
    C:\Dush\Workspaces\JavaWorkspace\OpenGTS>echo %JAVA_HOME%
    C:\Program Files\Java\jdk1.6.0_03
    C:\Dush\Workspaces\JavaWorkspace\OpenGTS>path
    PATH=C:\Program Files\PC Connectivity Solution\;C:\WINDOWS\system32;C:\WINDOWS;C
    :\WINDOWS\System32\Wbem;C:\Program Files\apache-ant-1.7.0\bin;C:\Program Files\J
    ava\jdk1.6.0_03\bin;C:\Program Files\MySQL\MySQL Server 5.0\bin;C:\Dush\Workspac
    es\JavaWorkspace\OpenGTS\bin;
    Put the java home bin folder on the path before %SYSTEMROOT%\system32
    set JAVA_HOME=C:\Program Files\Java\jdk1.6.0_03
    set PATH=%JAVA_HOME%\bin;%PATH%

  • Proper use of JVM XMs and XMx settings

    I've configured Tomcat to run with -XMs1024m -XMx1024m, and am interested to know GC performs when the -XMs and XMx are the same value.
    Would it generally be better to have a lower -xms value?

    The -XMs only tells the VM how much memory to initially allocate, and doesn't have any correlation with normal operation of GC. I've used -XMs in the past when I know my memory requirements are pretty large, and that way will keep the VM from continuing to dynamically allocate more and more memory up to the XMx setting.

  • What is the best way to match clip and sequence settings for real-time editing?

    I am a long time FCP user and trying to make the After Effects workflow a little smoother by utilizing the Adobe suite.
    One of the most valuable things I miss about FCP is that when I drop a clip in a blank sequence (no matter what the settings of the seq) it will ask if I want to match the settings of the clip. This ensures that no rendering is required to quickly edit the video in real-time.
    Is there a plugin or function in Premiere CS4 that I am missing that will afford me this feature? Currently i am doing everything I can to match the clip settings when creating a sequence, but sadly i'm still having to render the timeline to preview the edit.
    lh

    And in CS4, if there is not a matching Preset, you can choose the Desktop Preset, which will allow you to customize nearly every attribute to match your source footage. The name is a bit of a misnomer, but has been around for a long time. I would have called it the "Custom Preset," but Adobe never called.
    Good luck,
    Hunt
    PS - I just learned something new about CS5 from Curt, because of your question - thanks!

  • What are the latest versions of EAX Console and Speaker Settings Conso

    Hi, I've been updating my Audigy ZS software and was wondering about these 2. Have there been any updates since last year?

    You do not have the latest firmware. The latest firmware is version 1.5.
    You should upgrade. Make sure you have a current backup and then select "update firmware" from within RAID admin. It will then ask you for the location of the firmware update -- it should be in /Application/Utilities/Xserve RAID Update.

  • My friend should be able to sync her iPad and iPod so that she can stream information between the two devices and her computer. Her brothers were right next to her and did the same thing with there devices and same settings and it worked for them.

    What would have went wrong because she should have been able to sync all three together at the same time? Her I pad is new so  restoring may be an option to make sure her settings are correct for this process. She doesn't use iCloud so she backs her information up to her computer.

    There are mobile device management solutions that can do this, including in Apple's OS X Server system, but most parents generally find that setting this up is more work than it's worth. If you're interested, though, there are a couple that at least purport to be free (I don't know if there are any hidden "gotchas"):
    http://www.unwireddevicelink.com/features/
    https://meraki.cisco.com/products/systems-manager
    and Apple's system:
    http://www.apple.com/osx/server/features/#profile-manager
    I don't think any, however, allow you to see current activity or browser history. iOS doesn't expose those to access from MDM solutions, to the best of my knowledge.
    Regards.

Maybe you are looking for