Webstart 应用程序未向所有用户启动

发布于 2024-11-06 08:38:41 字数 1764 浏览 6 评论 0原文

我们有一个 webstart 应用程序,启动后使用 EJB 连接到 jboss 服务器。我们最近将此服务器迁移到 jboss5 并更新了连接到它的 webstart 应用程序。现在我们遇到了一个问题。在我们的开发人员机器上,运行 webstarts 应用程序没有问题。它的启动和连接也没有问题。但在 QA 测试人员的机器上,它们根本无法运行,只是说无法启动(或类似的内容)。 在详细信息部分,异常在未找到 jboss-main-client.jar 和 jnlp 之间有所不同。但包装的异常表明了这一点:

java.io.IOException
            at com.sun.deploy.cache.CacheEntry$9.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
            at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
            at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
            at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
            at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
            at java.util.concurrent.FutureTask.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

我们首先认为这可能是签名问题,但随后它无法在我们的本地开发计算机上运行。然后是人员的访问权限问题(这是我的理论),但是为什么以前的版本有效?我们混合运行 1.6 B18 到 B24 和 XP、Vista 和 Windows 7。我完全被难住了,有什么想法吗?

We have a webstart application that after startup uses EJB's to connect to a jboss server. We recently migrated this server to jboss5 and have update the webstart application that connects to it. Now we have run into a problem. On our developer machines, running the webstarts app there is no problems. Its starts up and connects nor problem. But on the QA testers machines they wont run at all, it just says unable to launch (or something like that).
In the details part the exceptin varies between not finding jboss-main-client.jar and the jnlp. But the wrapped exception shows this:

java.io.IOException
            at com.sun.deploy.cache.CacheEntry$9.run(Unknown Source)
            at java.security.AccessController.doPrivileged(Native Method)
            at com.sun.deploy.cache.CacheEntry.writeFileToDisk(Unknown Source)
            at com.sun.deploy.cache.Cache.downloadResourceToTempFile(Unknown Source)
            at com.sun.deploy.cache.Cache.downloadResourceToCache(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.actionDownload(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResourceCacheEntry(Unknown Source)
            at com.sun.deploy.net.DownloadEngine.getResource(Unknown Source)
            at com.sun.javaws.LaunchDownload$DownloadTask.call(Unknown Source)
            at java.util.concurrent.FutureTask$Sync.innerRun(Unknown Source)
            at java.util.concurrent.FutureTask.run(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)
            at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
            at java.lang.Thread.run(Unknown Source)

We first thought it might have been a signing issue, but then it would not have worked on our local dev machines. Then there was the question of access rights of the person (which is the theory I have) but then why did th previous version work? We run a mixture of 1.6 B18 to B24 and XP,Vista and Windows 7. Im completely stumped, any ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

审判长 2024-11-13 08:38:41

您可以尝试在 Java 控制台中启用跟踪级别,您将在其中找到详细的异常。大概是土生土长的东西吧。

You can try to enable the Trace level in Java Console and there you will find your detailed exception. Probably it's something native.

扮仙女 2024-11-13 08:38:41

我在JDK源码中找到了它。

CacheEntry.java,第9个PrivilegedExceptionAction.run:

            public Object run() throws IOException {
                JarFile jar = null;
                RandomAccessFile raf = null;

                //reset lengths as they will be updated
                //and they could be stale (e.g. if we are upgrading from old index file)
                section2Length = 0;
                section3Length = 0;
                section4Length = 0;
        section4Pre15Length = 0;
            section4CertsLength = 0;
            section4SignersLength = 0;
                section5Length = 0;
                reducedManifestLength = 0;
                reducedManifest2Length = 0;

                try {
                    raf = openLockIndexFile("rw", false);
                    // output index file contents to disk

                    //mandatory header first (will write it again later on)
                    byte header[] = prepareHeader();
                    raf.write(header);

                    ByteArrayOutputStream bout = new ByteArrayOutputStream(1000);
                    DataOutputStream out = new DataOutputStream(bout);

                    out.writeUTF(getVersion() != null ? getVersion() : "");
                    out.writeUTF(getURL());
                    out.writeUTF(getNamespaceID());

                    // write out resource codebase ip address if available
                    InetAddress ina = null;

                    // get the ip address of the resource codebase
                    String codebase = "";
                    if (url != null && url.equals("") == false) {
                        URL u = new URL(url);
                        String host = u.getHost();
                        ina = Cache.getHostIP(host);
                        if (ina != null) {
                            codebase = ina.getHostAddress();
                        }
                    }
                    out.writeUTF(codebase);

                    // write out HTTP/HTTPS header if available
                    writeHeaders(out);

                    out.close();
                    bout.close();
                    section2Length = bout.size();
                    raf.write(bout.toByteArray());

                    if (incomplete == 0) {
                        // save sections 3 and 4 (JAR only)
                        if (isJarFile(url)) {
                            jar = new JarFile(new File(filename));
                            CachedManifest manifest = new CachedManifest(jar);
                            //will update section3Length and section4Length internally
                            writeManifest(raf, jar, manifest, contentType, dd);
                            manifest.postprocess(); //need to do this explicilty
                            updateManifestRefs(manifest);
                            jar.close();
                        }
                        // this entry just got downloaded, so mark it as update check done
                        DownloadEngine.addToUpdateCheckDoneList(url);

                        // add this entry to the cleanup thread loaded resource list
                        Cache.addToCleanupThreadLoadedResourceList(url);

                        setBusy(0);
                        setIncomplete(0);
                        updateBlacklistValidation();
                        updateTrustedLibrariesValidation();
                        doUpdateHeader(raf);

                        //whenether this is jar or not we do not need to try read
                        //manifest or certificates again
                        doneReadManifest = true;
                        doneReadCerts = true;
                        doneReadSigners = true;
                    }
                } catch (Exception e) {
                    Trace.ignoredException(e);
                    // close file before trying to delete them
                    // set raf/jar to null after closing, so they won't be closed
                    // again in the finally block
                    if (raf != null) {
                        raf.close();
                        raf = null;
                    }
                    if (jar != null) {
                        jar.close();
                        jar = null;
                    }

                    Cache.removeCacheEntry(CacheEntry.this);
                    if (e instanceof JARSigningException) {
                        throw (JARSigningException) e;
                    }
                    if (e instanceof java.util.zip.ZipException) {
                        throw new JARSigningException(new URL(url), version,
                                JARSigningException.BAD_SIGNING, e);
                    }
                    throw new IOException(e.getMessage());
                } finally {
                    if (raf != null) {
                        raf.close();
                    }
                    if (jar != null) {
                        jar.close();
                    }
                    Cache.cleanup();
                }
                return null;
            }
        }

我以为你没有看到真正的错误,因为IOException没有包装它。
原因异常记录在 Java 控制台中,我想它是可见的。
但如果不是这样,我建议您从 http://download.java 获取 OpenJDK 源代码。 net/openjdk/jdk6/ 并尝试调试此类(CacheEntry.java:1681)。不幸的是,JDK 是在没有调试信息的情况下构建的,但您可以在方法处设置断点并使用调试器查看对象属性。

I found it at the JDK source.

CacheEntry.java, the 9th PrivilegedExceptionAction.run:

            public Object run() throws IOException {
                JarFile jar = null;
                RandomAccessFile raf = null;

                //reset lengths as they will be updated
                //and they could be stale (e.g. if we are upgrading from old index file)
                section2Length = 0;
                section3Length = 0;
                section4Length = 0;
        section4Pre15Length = 0;
            section4CertsLength = 0;
            section4SignersLength = 0;
                section5Length = 0;
                reducedManifestLength = 0;
                reducedManifest2Length = 0;

                try {
                    raf = openLockIndexFile("rw", false);
                    // output index file contents to disk

                    //mandatory header first (will write it again later on)
                    byte header[] = prepareHeader();
                    raf.write(header);

                    ByteArrayOutputStream bout = new ByteArrayOutputStream(1000);
                    DataOutputStream out = new DataOutputStream(bout);

                    out.writeUTF(getVersion() != null ? getVersion() : "");
                    out.writeUTF(getURL());
                    out.writeUTF(getNamespaceID());

                    // write out resource codebase ip address if available
                    InetAddress ina = null;

                    // get the ip address of the resource codebase
                    String codebase = "";
                    if (url != null && url.equals("") == false) {
                        URL u = new URL(url);
                        String host = u.getHost();
                        ina = Cache.getHostIP(host);
                        if (ina != null) {
                            codebase = ina.getHostAddress();
                        }
                    }
                    out.writeUTF(codebase);

                    // write out HTTP/HTTPS header if available
                    writeHeaders(out);

                    out.close();
                    bout.close();
                    section2Length = bout.size();
                    raf.write(bout.toByteArray());

                    if (incomplete == 0) {
                        // save sections 3 and 4 (JAR only)
                        if (isJarFile(url)) {
                            jar = new JarFile(new File(filename));
                            CachedManifest manifest = new CachedManifest(jar);
                            //will update section3Length and section4Length internally
                            writeManifest(raf, jar, manifest, contentType, dd);
                            manifest.postprocess(); //need to do this explicilty
                            updateManifestRefs(manifest);
                            jar.close();
                        }
                        // this entry just got downloaded, so mark it as update check done
                        DownloadEngine.addToUpdateCheckDoneList(url);

                        // add this entry to the cleanup thread loaded resource list
                        Cache.addToCleanupThreadLoadedResourceList(url);

                        setBusy(0);
                        setIncomplete(0);
                        updateBlacklistValidation();
                        updateTrustedLibrariesValidation();
                        doUpdateHeader(raf);

                        //whenether this is jar or not we do not need to try read
                        //manifest or certificates again
                        doneReadManifest = true;
                        doneReadCerts = true;
                        doneReadSigners = true;
                    }
                } catch (Exception e) {
                    Trace.ignoredException(e);
                    // close file before trying to delete them
                    // set raf/jar to null after closing, so they won't be closed
                    // again in the finally block
                    if (raf != null) {
                        raf.close();
                        raf = null;
                    }
                    if (jar != null) {
                        jar.close();
                        jar = null;
                    }

                    Cache.removeCacheEntry(CacheEntry.this);
                    if (e instanceof JARSigningException) {
                        throw (JARSigningException) e;
                    }
                    if (e instanceof java.util.zip.ZipException) {
                        throw new JARSigningException(new URL(url), version,
                                JARSigningException.BAD_SIGNING, e);
                    }
                    throw new IOException(e.getMessage());
                } finally {
                    if (raf != null) {
                        raf.close();
                    }
                    if (jar != null) {
                        jar.close();
                    }
                    Cache.cleanup();
                }
                return null;
            }
        }

I thought you didn't see the real error because IOException didn't wrap it.
The cause exception is logged in Java Console, and i suppose that it would be visible.
But if it isn't so I would advise you to get OpenJDK sources from http://download.java.net/openjdk/jdk6/ and try to debug this class (CacheEntry.java:1681). Unfortunately JDK was built without debug info, but you can set breakpoints at methods and see the object properties with the debugger.

留一抹残留的笑 2024-11-13 08:38:41

它本身并不是一个真正的答案,但我发现它是 Java 的缓存问题。一旦你进入并删除缓存,问题就解决了。由于某种原因还要等到第二天才能提供帮助。

Its not really an answer as such, but I found its a caching issue with Java. Once you have gone in and delete the Cache, the problems is solved. Also waiting til the next day help for some reason.

春风十里 2024-11-13 08:38:41

该问题可能是由于用户在不同的 Windows 机器上工作时引起的
用户配置文件存储在服务器上 - 用户缓存驻留在本地计算机上;如果他
转到不同的计算机,webstart 应用程序可能安装在不同的缓存文件夹中。使用 javaws 的 -system 标志可能会有所帮助

The problem is probably caused by users working on different windows machines when the
user profile is stored at the server - the user cache resides at the local machine; if he
goes to a different machine, the webstart app is probably installed in a different cache folder. using the -system flag of javaws might help

毁虫ゝ 2024-11-13 08:38:41

好吧...Java 1.7r51 推出后,我们遇到了同样的问题。
我让用户通过 Java 控制台清除缓存。
我还让他们将网站地址“https://...”添加到“安全”选项卡下的“例外”部分。
用户启动了一个新的浏览器会话并毫无问题地连接到该网站。

Ok... we ran into the same problem, once Java 1.7r51 was introduced.
I had the user clear their cache via the Java Console.
I also had them add the site address "https://...." to the "Exceptions" section under the "Security" tab.
User started a new browser session and connected to the site without a problem.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文