NullPointer Exception ,web start Static class loading in sun JRE with JNLP

I have a netbenas based application and using with jre 1.6.0_22.
i am getting NPE as
java.lang.NullPointerException
at com.sun.deploy.security.CPCallbackHandler.isAuthenticated(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler.access$1300(Unknown Source)
at com.sun.deploy.security.CPCallbackHandler$ChildElement.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.checkResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath$JarLoader.getResource(Unknown Source)
at com.sun.deploy.security.DeployURLClassPath.getResource(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 com.sun.jnlp.JNLPClassLoader.findClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at java.lang.ClassLoader.loadClass(Unknown Source)
at com.osi.solutions.platform.classbuilder.view.ClassExplorerTopComponent.<init>(ClassExplorerTopComponent.java:89)
at com.osi.solutions.platform.classbuilder.view.ClassExplorerTopComponent.getDefault(ClassExplorerTopComponent.java:143)
at com.osi.solutions.platform.classbuilder.view.ClassExplorerTopComponent$ResolvableHelper.readResolve(ClassExplorerTopComponent.java:198)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at java.io.ObjectStreamClass.invokeReadResolve(Unknown Source)
at java.io.ObjectInputStream.readOrdinaryObject(Unknown Source)
at java.io.ObjectInputStream.readObject0(Unknown Source)
at java.io.ObjectInputStream.readObject(Unknown Source)
at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.readSerial(XMLSettingsSupport.java:544)
at org.netbeans.modules.settings.convertors.XMLSettingsSupport$SettingsRecognizer.instanceCreate(XMLSettingsSupport.java:576)
at org.netbeans.modules.settings.convertors.SerialDataConvertor$SettingsInstance.instanceCreate(SerialDataConvertor.java:420)
at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentPersistentForID(PersistenceManager.java:531)
at org.netbeans.core.windows.persistence.PersistenceManager.getTopComponentForID(PersistenceManager.java:641)
at org.netbeans.core.windows.PersistenceHandler.getTopComponentForID(PersistenceHandler.java:422)
at org.netbeans.core.windows.PersistenceHandler.load(PersistenceHandler.java:147)
at org.netbeans.core.windows.WindowSystemImpl.load(WindowSystemImpl.java:69)
[catch] at org.netbeans.core.NonGui$2.run(NonGui.java:178)
at java.awt.event.InvocationEvent.dispatch(Unknown Source)
at java.awt.EventQueue.dispatchEvent(Unknown Source)
at org.netbeans.core.TimableEventQueue.dispatchEvent(TimableEventQueue.java:104)
at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
at java.awt.EventDispatchThread.run(Unknown Source)
This issue comes very occassionaly .
Does someone have any idea what is wrong. Is this related to any jre bug.
Thanks,
totaram

Hi I'm the one who posted those findings... though further investigation found that increasing your heap size can help, but at best it only reduces the occurances of the problem.
The real cause of the issue is that the Signer's info for a CachedJarFile is held onto by softreferences and is not "rebuilt" if it has been garbage collected. the Reason that increasing your initial heap size works, is that it helps to delay the conditions on which these softreferences are garbage collected. (SoftReferences become eligible for garbage collection when the heap needs to be expanded)
I've put together a hack that traverses all of the jars in a webstart application, finds their corresponding CachedJarFile instance and sticks all of the relevant SoftReferences into a static list, so that they become "hard references" and are never garbage collected.
Below is my JarSignersHardLinker.java hack To use it, just call JarSignersHardLinker.go() it will then
* Check that you are running on webstart and you are on java 1.6 update 19 or higher.
* If the above is true then it will spawn a new thread and create hard links to all the jarsigners for each jar on the classpath.
If you need more info email me on my gmail account. My user name is squaat. I've also posted this code at Re: Error with Java WebStart Signed Jars on 1.6.0_19's new Mixed  Code
If you find this helpful and it solves your problems, please leave a positive comment and/or vote for the bug at:
http://bugs.sun.com/view_bug.do?bug_id=6967414
If any oracle/sun webstart engineers are reading this, please contact me... we'd really like this bug fixed.
import java.io.IOException;
import java.lang.ref.SoftReference;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.net.JarURLConnection;
import java.net.URL;
import java.net.URLConnection;
import java.util.ArrayList;
import java.util.Enumeration;
import java.util.LinkedHashSet;
import java.util.List;
import java.util.Set;
import java.util.jar.JarFile;
* A utility class for working around the java webstart jar signing/security bug
* see http://bugs.sun.com/view_bug.do?bug_id=6967414 and http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6805618
* @author Scott Chan
public class JarSignersHardLinker {
    private static final String JRE_1_6_0 = "1.6.0_";
     * the 1.6.0 update where this problem first occurred
    private static final int PROBLEM_JRE_UPDATE = 19;
    public static final List sm_hardRefs = new ArrayList();
    protected static void makeHardSignersRef(JarFile jar) throws java.io.IOException {
        System.out.println("Making hard refs for: " + jar );
        if(jar != null && jar.getClass().getName().equals("com.sun.deploy.cache.CachedJarFile")) {
             //lets attempt to get at the each of the soft links.
             //first neet to call the relevant no-arg method to ensure that the soft ref is populated
             //then we access the private member, resolve the softlink and throw it in a static list.
            callNoArgMethod("getSigners", jar);
            makeHardLink("signersRef", jar);
            callNoArgMethod("getSignerMap", jar);
            makeHardLink("signerMapRef", jar);
//            callNoArgMethod("getCodeSources", jar);
//            makeHardLink("codeSourcesRef", jar);
            callNoArgMethod("getCodeSourceCache", jar);
            makeHardLink("codeSourceCacheRef", jar);
     * if the specified field for the given instance is a Softreference
     * That soft reference is resolved and the returned ref is stored in a static list,
     * making it a hard link that should never be garbage collected
     * @param fieldName
     * @param instance
    private static void makeHardLink(String fieldName, Object instance) {
        System.out.println("attempting hard ref to " + instance.getClass().getName() + "." + fieldName);
        try {
            Field signersRef = instance.getClass().getDeclaredField(fieldName);
            signersRef.setAccessible(true);
            Object o = signersRef.get(instance);
            if(o instanceof SoftReference) {
                SoftReference r = (SoftReference) o;
                Object o2 = r.get();
                sm_hardRefs.add(o2);
            } else {
                System.out.println("noooo!");
        } catch (NoSuchFieldException e) {
            e.printStackTrace();
            return;
        } catch (IllegalAccessException e) {
            e.printStackTrace();
     * Call the given no-arg method on the given instance
     * @param methodName
     * @param instance
    private static void callNoArgMethod(String methodName, Object instance) {
        System.out.println("calling noarg method hard ref to " + instance.getClass().getName() + "." + methodName + "()");
        try {
            Method m = instance.getClass().getDeclaredMethod(methodName);
            m.setAccessible(true);
            m.invoke(instance);
        } catch (SecurityException e1) {
            e1.printStackTrace();
        } catch (NoSuchMethodException e1) {
            e1.printStackTrace();
        } catch (IllegalArgumentException e) {
            e.printStackTrace();
        } catch (IllegalAccessException e) {
            e.printStackTrace();
        } catch (InvocationTargetException e) {
            e.printStackTrace();
     * is the preloader enabled. ie: will the preloader run in the current environment
     * @return
    public static boolean isHardLinkerEnabled() {
         boolean isHardLinkerDisabled = false;  //change this to use whatever mechanism you use to enable or disable the preloader
        return !isHardLinkerDisabled && isRunningOnJre1_6_0_19OrHigher() && isRunningOnWebstart();
     * is the application currently running on webstart
     * detect the presence of a JNLPclassloader
     * @return
    public static boolean isRunningOnWebstart() {
        ClassLoader cl = Thread.currentThread().getContextClassLoader();
        while(cl != null) {
            if(cl.getClass().getName().equals("com.sun.jnlp.JNLPClassLoader")) {
                return true;
            cl = cl.getParent();
        return false;
     * Is the JRE 1.6.0_19 or higher?
     * @return
    public static boolean isRunningOnJre1_6_0_19OrHigher() {
        String javaVersion = System.getProperty("java.version");
        if(javaVersion.startsWith(JRE_1_6_0)) {
            //then lets figure out what update we are on
            String updateStr = javaVersion.substring(JRE_1_6_0.length());
            try {
                return Integer.parseInt(updateStr) >= PROBLEM_JRE_UPDATE;
            } catch (NumberFormatException e) {
                //then unable to determine updatedate level
                return false;
        //all other cases
        return false;
      * get all the JarFile objects for all of the jars in the classpath
      * @return
     public static Set<JarFile> getAllJarsFilesInClassPath() {
          Set<JarFile> jars = new LinkedHashSet<JarFile> ();
         for (URL url : getAllJarUrls()) {
             try {
                 jars.add(getJarFile(url));
             } catch(IOException e) {
                  System.out.println("unable to retrieve jar at URL: " + url);
         return jars;
     * Returns set of URLS for the jars in the classpath.
     * URLS will have the protocol of jar eg: jar:http://HOST/PATH/JARNAME.jar!/META-INF/MANIFEST.MF
    static Set<URL> getAllJarUrls() {
        try {
            Set<URL> urls = new LinkedHashSet<URL>();
            Enumeration<URL> mfUrls = Thread.currentThread().getContextClassLoader().getResources("META-INF/MANIFEST.MF");
            while(mfUrls.hasMoreElements()) {
                URL jarUrl = mfUrls.nextElement();
//                System.out.println(jarUrl);
                if(!jarUrl.getProtocol().equals("jar")) continue;
                urls.add(jarUrl);
            return urls;
        } catch(IOException e) {
            throw new RuntimeException(e);
     * get the jarFile object for the given url
     * @param jarUrl
     * @return
     * @throws IOException
    public static JarFile getJarFile(URL jarUrl) throws IOException {
        URLConnection urlConnnection = jarUrl.openConnection();
        if(urlConnnection instanceof JarURLConnection) {
            // Using a JarURLConnection will load the JAR from the cache when using Webstart 1.6
            // In Webstart 1.5, the URL will point to the cached JAR on the local filesystem
            JarURLConnection jcon = (JarURLConnection) urlConnnection;
            return jcon.getJarFile();
        } else {
            throw new AssertionError("Expected JarURLConnection");
     * Spawn a new thread to run through each jar in the classpath and create a hardlink
     * to the jars softly referenced signers infomation.
    public static void go() {
        if(!isHardLinkerEnabled()) {
            return;
        System.out.println("Starting Resource Preloader Hardlinker");
        Thread t = new Thread(new Runnable() {
            public void run() {
                try {
                    Set<JarFile> jars = getAllJarsFilesInClassPath();
                    for (JarFile jar : jars) {
                        makeHardSignersRef(jar);
                } catch (Exception e) {
                    System.out.println("Problem preloading resources");
                    e.printStackTrace();
                } catch (Error e) {
                     System.out.println("Error preloading resources");
                     e.printStackTrace();
        t.start();
}Edited by: 855200 on 04-Jul-2011 17:31

Similar Messages

  • Java web start will not load on my computer

    When I try and start the IR (PI version 7.1) I get the download of Java Web Start aborting as it complains that the client.jar file is corrupt.
    I just got a colleague to do the same thing on her computer and the dowload worked perfectly!
    I have JRE 1.5.0.18 on my computer, my colleague has 1.6 on her machine.
    HELP!
    Ross Goodman

    Hi Ross,
    Perform the below step:
    Integration Builder> Administration-> JAVA Web Start Administration--> Re-initialization and force signing.
    This function will cause the above re-collection and additionally a re-signing of ALL resources with a dummy certificate. The original SAP signatures of the jarfiles will be lost. It is recommended to use this function only in test systems. To get back the original SAP signatures the application has to be deployed again.
    Thanks,

  • Web Start Application fails after upgrade to JRE 1.6.0_u33

    I have a production application that uses java web start for deployment. All has gone well, but we are experiencing problems when testing upgrading to the latest JRE update 1.6.0_u33.
    The application is composed of several jar files, all of which are signed with a code signing certificate. However, after updating the JRE, I receive the error :
    #### Java Web Start Error:
    #### Unsigned application requesting unrestricted access to system
    Unsigned resource: the first jar file in my jnlp
    This is a pretty odd error, since the jar is definitely signed. I can find it in the webstart cache and run jarsigner -verify against it and it verifies successfully.
    If I remove the application and reinstall it, everything works fine, but this is a pretty unacceptable solution for thousands of users, many of which are not very technical.
    Does anyone have any solutions or has anyone encountered the same problem? It is currently a showstopper for us to taking this new JRE update which contains some critical security updates we would like to have implemented.
    Thanks in advance for any help.

    Hi
    I have seen this post a little bit late, but... We have also encountered such issue.
    There is another workaround than ask people to empty the java web start cache.
    In order to force the end user's computer to download again you application entirely, we have signed again ALL the jar files and uploaded them to our server.
    That works well but... if somebody download the "new" files and upgrades java to 1.6_0_33 afterwards... same issue will appear again.
    Please observe that the traffic in this forum has started to decrease strongly. That's not amazing when you see that you cannot count on this product.
    Java web start has never worked correctly and that for a long time. This one suffers of numerous bugs and regressions. We should rather call it Java Nightmare Neverstart
    It's a shame.
    Sun has been acquired by Oracle but that does not seem change anything.
    Java RIP
    Claude

  • When does Web Start try and connect to Sun

    How can I make it so web start doesn't try to connect to sun ever? I want it to check for updates only to our application and I don't want it to try and access the Internet. Thanks.

    I've heard the JWS installer looks in the Windows Registry for already installed Java Runtime
    Environments (JREs), version 1.2.2 and higher, and automatically configures Java Web
    Start to use them and that it also installs version 1.3.0_03 if it is not there. Does this mean that if I already have that version installed it won't go out to Sun's website? It seems to me that after JWS is installed it tries to access the internet each time it is run. Anyone know?

  • How to force web start to use a specific private JRE without searching reg

    I am trying to make webstart start using a private JRE independent of what JREs are installed on the System. I am installing a private JRE in the users home directory, eg
    C:\Documents and Settings\USER\Application Data\APP\jreThen starting webstart by calling:
    C:\Documents...APP\jre\bin\javaws.exe http://....jnlpThe problem is javaws.exe always scans the regsitry in builds its own list of installed JREs.
    I have tried to solve this by setting USER_JPI_PROFILE env var with my own custom cache location and building a custom "deployment.properties" file with just my private JRE in it, but web start always searchs the registry and find and uses a system JRE over mine.
    Any Ideas?
    Thanks, Jasper

    Did you also place a deployment.config file , to point to your deployment.properties file?
    In the deployment.properties, specify the location of your custom jre:
    deployment.javaws.jre.0.platform=1.5
    deployment.javaws.jre.0.registered=true
    deployment.javaws.jre.0.osname=Windows
    deployment.javaws.jre.0.path=jre\\bin\\javaw.exe
    deployment.javaws.jre.0.product=1.5.0_05
    deployment.javaws.jre.0.location=http\://myjre.download.location
    deployment.javaws.jre.0.enabled=true
    deployment.javaws.jre.0.osarch=x86The above properties tag your custom jre, as been downloaded from http://mrjre.download.loaction - This location doesnt have to exist.
    In your .jnlp file, specify this download location in the jre tag.

  • Uncaught error java nullpoint exception, email icons disappeared, application loader unable to back up data, desktop manager unable to connect

    Model:  Curve 8900
    Provider: At&t
    Platform: 4.2.0.108
    I'm ready to throw this phone in the blender.... if I could only back up my data first. A couple of months ago the What's App application required an update. I updated it and ever since my phone has steadily had more and more issues. First, I kept getting this uncaught error message, shortly thereafter the 2 email accounts (both gmail) that I have linked to the account disappeared. The message icon shows that I have messages, but icons not there (I have tried the show all option). At one point the message icon started exponentially adding the number of messages until it got up to over 86,000. When I reboot the phone it goes back down and then steadily increases again... usually though it's more to 400 - 500 rather then tens of thousands. I have been trying to install updates and do a wipe of the BB so that I can start from scratch, unfortunately the application loader is unable to back up data. The desktop manager is unable to connect to the blackberry and indicates that an upgrade is required. I have tried doing the upgrade both directly from the phone and connected to the desktop manager, but nothing seems to work. If I try to upgrade the software directly from the BB, I get to the start download button and when I click, nothing happens. I have removed all applications except bberry app world and one game that I play, Pixelated Plus. Still nothing. Any ideas?

    Do you want to save the messages?
    If not (and I think they are the problem) open the Desktop Software > Device > Delete Data and click the "select Data" option. Select the Messages to remove. Complete the prompts and finish.
    Then, return to backup the entire device, and see if that is possible to complete this time with no messages.
    Now, once the back up is done and you have your data, you can disconnect the device.
    Now, use BBSAK to wipe the device and subsequently load the new operating system.
    **If you cannot complete the backup again above, you might have to do without it, OR you can use the Desktop Software to sync your Address book, calendar, memos and tasks to Outlook. OR, you can easily install and use BlackBerry Protect to backup your device over the air to RIM servers, then once wiped and the new OS reloaded, you can use Protect to restore the data back to the 8900. << This you should do regardless.
    Good luck, post back here as you have questions.
    1. If any post helps you please click the below the post(s) that helped you.
    2. Please resolve your thread by marking the post "Solution?" which solved it for you!
    3. Install free BlackBerry Protect today for backups of contacts and data.
    4. Guide to Unlocking your BlackBerry & Unlock Codes
    Join our BBM Channels (Beta)
    BlackBerry Support Forums Channel
    PIN: C0001B7B4   Display/Scan Bar Code
    Knowledge Base Updates
    PIN: C0005A9AA   Display/Scan Bar Code

  • Error in trying dynamic class loading in sun rmi tutorila

    Hi,
    I am trying the sun rmi tutorial http://java.sun.com/docs/books/tutorial/rmi/. I am not able to download the stub class from the codebase to client. The server is running in a linux box while the client in a w2k box.
    Linux box (server)
    ==================
    web server setting
    Alias /rmi_codebase /home/wing/try/java/rmi
    rmiregistry setting
    unset CLASSPATH
    rmiregistry
    rmi server
    classses
    /home/wing/try/java/rmi/client/ComputePi.class
    /home/wing/try/java/rmi/client/Pi.class
    /home/wing/try/java/rmi/compute/Compute.class
    /home/wing/try/java/rmi/compute/Task.class
    /home/wing/try/java/rmi/compute/ComputeEngine.class
    /home/wing/try/java/rmi/compute/ComputeEngine_Skel.class
    /home/wing/try/java/rmi/compute/ComputeEngine_Stub.class
    java.policy
    grant {
    permission java.security.AllPermission;
    startup with script as follows
    java -cp /home/wing/try/java/rmi -Djava.rmi.server.codebase=http://localhost/rmi_codebase/ -Djava.rmi.server.hostname=man82.air.com.hk -Djava.security.policy=/home/wing/try/java/rmi/java.policy
    engine.ComputeEngine
    (the server is started happyily)
    W2k box (client)
    ================
    class the same as server except removing the stub (ComputeEngine_Stub).
    java.policy
    grant {
    permission java.security.AllPermission;
    startup script
    java -Djava.rmi.server.codebase=http://man82/rmi_codebase/ -Djava.security.policy=java.policy clientComputePi man82 20
    The error encounter is
    ComputePi exception: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    java.rmi.UnmarshalException: error unmarshalling return; nested exception is:
    java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    at sun.rmi.registry.RegistryImpl_Stub.lookup(Unknown Source)
    at java.rmi.Naming.lookup(Naming.java:83)
    at client.ComputePi.main(ComputePi.java:14)
    Caused by: java.lang.ClassNotFoundException: engine.ComputeEngine_Stub
    at java.net.URLClassLoader$1.run(URLClassLoader.java:198)
    at java.security.AccessController.doPrivileged(Native Method)
    Is this problem related to codebase setting or security?
    BTW, I have tried to put the stub to the client as well, it works.
    Thanks in advance of any ideas or input.
    Wing

    Based on my previous post, I have performed some more testings of the tutorial code and find that the java.rmi.server.codebase could not be specified in the client side.
    Instead, the client follows the codebase set in the server, and thus, the localhost could not used in the server when the client is in separate machine.
    This is a bit different from the tutorial, please enlighten me if you have any comments.
    To make the dynamic download works,
    server side
    change the codebase property from http://localhost/rmi-codebase/ to http://man82/rmi_codebase/
    client side
    remove the codebase property http://man82/rmi_codebase/
    It is funny that if I add the codebase property when start up the client, it won't work.
    Thanks in advance for any ideas and input.
    Wing

  • Some web sites do not load as they did with full html and so on.

    AS of yesterday certain web sites I regularly visit stopped having full html, at least I think that is how to describe it--no video screens, no web page designs. Those affected are buffalostate.edu and democracynow.org. No such problem in Explorer. Other web sites seem OK.

    '''To Jasper:'''
    When you posted a reply to this thread recently, you were replying to a question that was asked over a year ago.
    This thread was locked because of a new feature just added to the Support Forum, that automatically locks a thread if it was originally created over 180 days in the past.
    If you still need help with Firefox you should ask a new question on the support forum. You can use this link as a starting point: https://support.mozilla.org/en-US/questions/new

  • Web Start Hangs on "Java loading..."

    Hello everyone,
    This is my first post, and although I am a long time Java developer, I do not have much experience with Web Start. I'm trying to launch a JNLP from the command line using the javaws command. However, all I get is a message that pops up and says "Java(tm) loading...". Then, the message vanishes and that's it. I don't see javaws running in my process list. Has anyone seen this? Is there a javaws log I can see somewhere to figure out what is going on? Thanks very much!
    -Matt

    Start webstart itself - go to the advanced tab and set "show java console" - exit.
    Now start your application and you may see the errors appear in the console.
    rykk

  • Java3D via Web Start

    Is there a way to specify in the jnlp the requirements of the java3D installation to be able to run this application?

    I got most of this information from a combination of searching these forums, the Web Start Developer's Guide, at http://java.sun.com/products/javawebstart/docs/developersguide.html, and the Unofficial JNLP/Web Start FAQ, which is at http://lopica.sourceforge.net/faq.html. Any mistakes or misconceptions in this explanation are my own, but if it leaves you confused or if I have failed to answer any questions, those are the documents that allowed me to get a Java3D application running via Web Start.
    First important point: you WILL NEED to sign all the .jars you distribute, so if you don't know how to do that, go read a tutorial on security and jarsigner/keystores FIRST. You can create your own cert to sign against, so long as your users trust you enough to click 'Yes' when Web Start asks them if they trust you. :)
    So, now you've gotten yourself set up with a signing cert, either your own or a $400 one from Verisign or similar. Now, you're going to need to sign copies of your application .jar, any other .jars you distribute (log4j.jar, the java3d jarfiles from the java3d distribution, in my case I have a data .jar that's separate from the application code .jar, etc.) Note that, to make Web Start transparently distribute the Java3D jars along with your application, you do in fact have to unpack them from the installer, sign them, and include them in the way I outline below. The approach I take is to copy all the files to some directory as unsigned.<original jar name>. Then, the jarsigner command line looks like this:
    jarsigner -keystore /path/to/keystore/file -storepass <password> -keypass <other password> -signedjar <original jar name> unsigned.<original jar name> keyAlias This applies equally for any other .jars you distribute (log4j is a popular example), including your own application .jar.
    If you use ant, the <signjar> task will do all the above for you! Have a look at the Ant manual.
    Put all these signed jarfiles in some directory where your web server can serve them up, e.g., /var/www/<yourapp>/lib on the Web Start server. Now all the pieces needed are in place and securely signed so that Web Start will trust your application to use them; you just have to tell Web Start to make them available to the runtime classpath. Below are my .jnlp file and main() method from my java3d application. Note especially the <security> stanza of the JNLP file, which is what both requires the signing of all the .jars, and allows Java3D to talk to the DirectX or OpenGL layer, access files stored on disk (the .jars in the Web Start cache, for example), and
    just generally behave as a native app might.
    First the JNLP file:
    <?xml version="1.0" encoding="utf-8"?>
    <!-- JNLP File for Your Application -->
    <jnlp
      spec="1.0+"
      codebase="http://your.webstart.server/yourapp"
      href="http://your.webstart.server/yourapp/yourapp.jnlp">
      <information>
        <title>Your Application</title>
        <vendor>Some Company</vendor>
        <!--<homepage href="docs/help.html"/> -->
        <description>This is your application</description>
        <description kind="short">A longer application description</description>
        <!-- <icon href="images/swingset2.jpg"/> -->
        <offline-allowed/>
      </information>
      <security>
          <all-permissions/>
      </security>
      <resources>
           <j2se version="1.4.2" href="http://java.sun.com/products/autodl/j2se" initial-heap-size="64m" />
           <jar href="http://your.webstart.server/yourapp/lib/yourApplication.jar"/>
           <jar href="http://your.webstart.server/yourapp/lib/some3rdPartyLibrary.jar"/>
      </resources>
      <resources os="Windows">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/windows/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/heartcad/lib/core/Java3D/jars/j3d/windows/j3dDLL.jar"/>
      </resources>
      <!-- Linux IBM J2RE 1.3.0 -->
      <resources os="Linux" arch="x86">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3d.so.jar"/>
      </resources>
      <!-- Linux SUN JRE1.3.1 -->
      <resources os="Linux" arch="i386">
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3daudio.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dcore.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3dutils.jar"/>
        <jar href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/vecmath.jar"/>
        <nativelib href="http://your.webstart.server/yourapp/lib/core/Java3D/jars/j3d/linux/i386/j3d.so.jar"/>
      </resources>
      <application-desc main-class="com.some.company.yourapp.YourApp"/>
    </jnlp> And then the main() method:
         public static void main(String[] args) throws Exception {
              if(System.getProperty("javawebstart.version") != null) {
                   // for Web Start it is necessary to "manually" load in native libs
                   String os = System.getProperty("os.name");
                   log.debug("loading " + os + " native libraries ..");
                   if (os.startsWith("Windows")){
                        // order matters here!
                        // load those libs that are required by other libs first!
                        log.debug("j3daudio.dll .. ");
                        // drop ".dll" suffix here
                        System.loadLibrary("j3daudio");
                        log.debug("OK");
                        log.debug("J3D.dll .. ");
                        System.loadLibrary("J3D");
                        log.debug("OK");
                   } else if (os.equals("Linux")){
                        log.debug("libj3daudio.so .. ");
                        // drop "lib" prefix and ".so" suffix
                        System.loadLibrary("j3daudio");
                        log.debug("OK");
                        log.debug("libJ3D.so .. ");
                        System.loadLibrary("J3D");
                        log.debug("OK");
                   } else {
                        throw new Exception("OS '" + os + "' not yet supported.");
              // and then launch the app
              new MainFrame(new yourApp(), width, height);
         }

  • Java web start application runs too slow...

    Hello,
    I am new to Java Web Start. I have created a java web start application and when i enable web start from local Execution, then it works perfectly well. But when i upload it on server and then download the application, then it is too too slow...i mean it takes minutes to get the output on clicking some button....my jnlp file is as under:
    <?xml version="1.0" encoding="UTF-8" standalone="no"?>
    <jnlp codebase="http://(web server code base)" href="launch.jnlp" spec="1.0+">
    <information>
    <title>ERD</title>
    <vendor>Deepika Gohil</vendor>
    <homepage href="http://appframework.dev.java.net"/>
    <description>A simple java desktop application based on Swing Application Framework</description>
    <description kind="short">ER Deign Tools</description>
    </information>
    <update check="always"/>
    <security>
    <all-permissions/>
    </security>
    <resources>
    <j2se version="1.5+"/>
    <jar href="ERD_1_2.jar" main="true"/>
    <jar href="lib/appframework-1.0.3.jar"/>
    <jar href="lib/swing-worker-1.1.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/jaxb1-impl.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    <jar href="lib/ant-contrib-1.0b3.jar"/>
    <jar href="lib/jaxb-impl.jar"/>
    <jar href="lib/jaxb-xjc.jar"/>
    <jar href="lib/FastInfoset.jar"/>
    <jar href="lib/gmbal-api-only.jar"/>
    <jar href="lib/http.jar"/>
    <jar href="lib/jaxws-rt.jar"/>
    <jar href="lib/jaxws-tools.jar"/>
    <jar href="lib/management-api.jar"/>
    <jar href="lib/mimepull.jar"/>
    <jar href="lib/policy.jar"/>
    <jar href="lib/saaj-impl.jar"/>
    <jar href="lib/stax-ex.jar"/>
    <jar href="lib/streambuffer.jar"/>
    <jar href="lib/woodstox.jar"/>
    <jar href="lib/jaxws-api.jar"/>
    <jar href="lib/jsr181-api.jar"/>
    <jar href="lib/jsr250-api.jar"/>
    <jar href="lib/saaj-api.jar"/>
    <jar href="lib/activation.jar"/>
    <jar href="lib/jaxb-api.jar"/>
    <jar href="lib/jsr173_api.jar"/>
    </resources>
    <application-desc main-class="erd.screen1">
    </application-desc>
    </jnlp>
    I dont understand the reason. Could you please help me out.
    Thank you,
    Deepika Gohil.

    Check your web server's access logs to see how many requests web start is sending for each jar. After you've loaded the application the first time, for each subsequent launch, if you've got everything configured right, you should only see requests for the JNLP file and maybe some gifs because web start should load everything else out of the cache (if you're using the version-based download protocol). Or if you're using the basic download protocol, then you might see requests for each jar file, but even in this case, if your web server is prepared to evaluate the last-updated attribute for each jar request and for jars that have not changed, respond with no actual payload and a header value of Not-Modified, then that should run almost as fast.
    You might also want to consider changing the "check" attribute of the "update" element from "always" to "background" for a couple of reasons. It should allow your app to start sooner (but this means that you might have to launch once or twice after an update is applied to the web server before the update shows up on the workstation). Also, my impression is that "always" is broken and prevents web start from ever checking to see if your jnlp file has been updated if you launch your app from a web start shortcut - launching from a browser is less likely to have this problem, depending on how often your browser is configured to check for updated resources.

  • Java web start in Windows vista

    Hi,
    1)
    When i tried to launch my Java Web start application in Windows Vista (32bit) With Jre 1.6_06 the java web start did not loaded. the process terminates at certain points.
    By Remote debugging got to know,: It was exiting the application at different points at different time
    At some points it says ClassNotFoundException. No logs at cache location also.
    Is it due to the jars are not loaded properly?? Jnlp is pasted bellow
    2) another problem here is the system did not have the jre installed earlier. how does system identified the jnlp file format if no jre available first time??
    So rather auto download I have installed jre manually and was launching the application
    thanks a lot,
    <?xml version="1.0" encoding="utf-8"?>
    <jnlp
      spec="1.0+"
      codebase="$$codebase" href="main.jnlp">
      <information>
        <title>Panel</title>
        <vendor>nc.</vendor>
        <homepage href="/index.html"/>
        <description>Panel</description>
        <description kind="short"></description>
         <icon href="$$context/images/Logo.gif" width="64" height="64" kind="default"/>
         <icon href="$$context/images/topLogo.jpg" kind="splash"/>
        <shortcut online='true'>
          <desktop/>
          <menu submenu="Panel"/>
        </shortcut>
        <related-content href="jar:app.jar!/conf/readme.pdf">
         <title>Readme</title>
         <icon href="images/Logo.gif"/>
      </related-content> 
      </information>
         <security>
          <all-permissions/>
       </security>
      <update check="always" policy="always"/>
      <resources>
            <java version="1.6.0._05+"  href="http://java.sun.com/products/autodl/j2se"/>
         <jar href="app.jar" version="1.0+" main="true"/>
         <jar href="common.jar" version="1.0+" download="lazy" main="false"/>
         <jar href="ext.jar" download="lazy" version="1.0+" download="lazy" main="false"/>
         <property name="jnlp.url" value="$$context/url"/>
      </resources>
      <application-desc main-class="com.app.MainPanel"/>       
    </jnlp>

    >
    2) another problem here is the system did not have the jre installed earlier. how does system identified the jnlp file format if no jre available first time??>See the latest [deployment advice|https://jdk6.dev.java.net/deployment_advice.html#JavaScript_used_for_deploying_Ja].
    Edited by: AndrewThompson64 on Jun 22, 2008 1:20 AM

  • Java Web Start and JAAS

    Has anybody tried to use JAAS in an application launched via Java Web Start?
    I'm experiencing problems with it. (The application works fine when being launched directly on the client.)
    If somebody already successfully tried, please let me know.
    Do I need to modify tags in the JNLP file? Do I need to re-configure my webserver or servlet engine?

    OK I got a response from the Java Web Start engineering folks. It sounds like using JAAS directly, to login to an ejb app server or whatever, is out of the question with Java Web Start on JDK1.3:
    << begin Sun's email >>
    The problem you got is due to JAAS 1.0 (jaas.jar) uses systemClassLoader to load
    classes that are defined in the JNLP application jar files, which should be
    loaded by the contextClassLoader instead. For more information on classLoading
    with JWS, look at:
    http://java.sun.com/products/javawebstart/faq.html#54
    http://java.sun.com/products/javawebstart/docs/developersguide.html#dev
    The new JAAS that comes with JDK 1.4 fixed this problem, which uses
    contextClassLoader in their class.
    Thanks for your interest in Java Web Start.
    << end of Sun's email >>
    FYI our workaround: We use a SOAP servlet as a proxy for the app server and we've defined a SOAP xmlrpc api between our client and the application server. This has the advantage of being able to get thru firewalls, as our variant of SOAP is transported on HTTP. Java Web Start installs and starts the SOAP client.
    I would hope the JWS folks would search the Sun provided services and see which ones ignore the current thread's class loader and fix them.
    David Harvey
    Siemens Energy and Automation, Inc.
    Gardner Systems Business Unit

  • NullPointer Exception in  SetCharacterEncodingFilter

    Hi All..!
    Can any one help me out in Fixing the Nullpointer Exception raised from SetCharacterEncodingFilter class which was taken by me from the Tomact ServletExamples. What should be the reason for this exception ? and how to fix this problem. Thanks in Advance to all the Gurus..!
    Please find the Stacktrace of the generated Exception
    java.lang.NullPointerException
    at org.apache.jsp.welcome_jsp._jspService(welcome_jsp.java:65)
    at org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:94)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:324)
    at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
    at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:237)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at MalikJspPackages.SetCharacterEncodingFilter.doFilter(SetCharacterEncodingFilter.java:81)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.netbeans.modules.web.monitor.server.MonitorFilter.doFilter(MonitorFilter.java:362)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:186)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:157)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:214)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:198)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:152)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:137)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:118)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:102)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
    at org.apache.catalina.core.StandardValveContext.invokeNext(StandardValveContext.java:104)
    at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:520)
    at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:929)
    at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:160)
    at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:799)
    at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.processConnection(Http11Protocol.java:705)
    at org.apache.tomcat.util.net.TcpWorkerThread.runIt(PoolTcpEndpoint.java:577)
    at org.apache.tomcat.util.threads.ThreadPool$ControlRunnable.run(ThreadPool.java:683)
    at java.lang.Thread.run(Thread.java:595)
    NotifyUtil::java.net.SocketException: Software caused connection abort: recv failed
    at java.net.SocketInputStream.socketRead0(Native Method)
    at java.net.SocketInputStream.read(SocketInputStream.java:129)
    at java.io.BufferedInputStream.fill(BufferedInputStream.java:218)
    at java.io.BufferedInputStream.read1(BufferedInputStream.java:256)
    at java.io.BufferedInputStream.read(BufferedInputStream.java:313)
    at sun.net.www.http.HttpClient.parseHTTPHeader(HttpClient.java:606)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:554)
    at sun.net.www.http.HttpClient.parseHTTP(HttpClient.java:571)
    at sun.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:928)
    at org.netbeans.modules.web.monitor.server.NotifyUtil$RecordSender.run(NotifyUtil.java:248)

    Look up the createImage(int width, int height) method in the Component api abd follow the link to its description in the Method Detail section. Note that this method will return null if the component is not displayable. Try placing your inspection code after the call to setVisible.

  • Firefox asks me everytime on JNLP files rather than its set 'Java Web Start'

    See I have classes with a 'Java Web Start' program which every week I download different JNLP files to start the Java program.
    I have set fire fox to use 'Java Web Start Launcher' for JNLP files but every time it ignores my setting and still asks every time. What can I do to make not ask and open the JNLP files?
    This Happened: Firefox does this all the time.
    I have Firefox 5.0 Installed.

    Hi,
    You mention that "I've downloaded "jcert.jar", "jnet.jar" and "jsse.jar" and put them in "..jre/lib/ext" used by JWS in client". Did you manually move these jar files into ..jre/lib/ext or using jnlp extension. I been trying to use jnlp extension (wanted to make it unnoticable to our client) to do this for a while now without luck. Can you tell me how you going about do this?
    thanks.

Maybe you are looking for

  • Can a Security Banner / Disclaimer be displayed when the system boots?

    We have a number of OS 9.x Macs in the company and we have now been requested to display a security banner on every PC/Mac (basically along the lines of "...to continue using this computer, you must abide by the rules laid down in the company's secur

  • DBMS_XMLDOM.WRITETOFILE errors

    C'mon then chaps (and chapesses)... I've had DBMS_XMLDOM.WRITETOFILE working before but for some reason I just can't seem to get it to work again. (Using Oracle 10g R2) What am I doing wrong. It's bound to be something right in front of me, but I jus

  • Essbase Error - 1270040 Data load buffer [2] does not exist

    When building dimension for ASO cube, it keeps giving me this error message. Do I need to activate or increase the Data Load Buffer when building dimenions manually (not using MaxL)? It allows me to build part of the dimensions using about 100 record

  • My cd drive won't accept any cd

    My cd drive won't accept any CDs or DVDs it's like there's something blocking it from entering, and it does these funny nose everytime I turn on my Mac book pro......... This problem started today after I was trying to insert a disk in, at first it w

  • Exporting to VCR

    1) I'm trying to export my DV-PAL iMovie project to my VCR via a Miglia Director's Cut analogue/DV converter. I can't find an 'EXPORT' option in any menu. Online assistance suggests choosing 'Export Movie' from the iMovie File menu and then, in the r