为什么我无法打开 JBoss vfs:/URL? [英] Why can't I open a JBoss vfs:/ URL?

查看:35
本文介绍了为什么我无法打开 JBoss vfs:/URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们正在将应用程序从 JBoss 4 升级到 JBoss 6.

We are upgrading our application from JBoss 4 to JBoss 6.

我们的应用程序的几个部分以一种不寻常的方式交付给客户端:在我们的应用程序内部查找 jars 并从 servlet 发送到客户端,客户端在那里提取它们以运行某些支持功能.

A couple of pieces of our application get delivered to the client in an unusual way: jars are looked up inside of our application and sent to the client from a servlet, where the client extracts them in order to run certain support functions.

在 JBoss 4 中,我们将使用类加载器查找这些 jar,并找到一个 jar://URL,用于读取 jar 并将其内容发送到客户端.

In JBoss 4 we would look these jars up with the classloader and find a jar:// URL which would be used to read the jar and send its contents to the client.

在 JBoss 6 中,当我们执行查找时,我们会得到一个 vfs:/URL.我知道这是来自 org.jboss.vfs 包.不幸的是,当我在这个 URL 上调用 openStream() 并从流中读取时,我立即得到一个 EOF(read() 返回 -1).

In JBoss 6 when we perform the lookup we get a vfs:/ URL. I understand that this is from the org.jboss.vfs package. Unfortunately when I call openStream() on this URL and read from the stream, I immediately get an EOF (read() returns -1).

什么给?为什么我无法读取此 URL 引用的资源?

What gives? Why can't I read the resource this URL refers to?

我尝试访问底层 VFS 包以通过 JBoss VFS API 打开文件,但大多数 API 似乎是私有的,我找不到从 vfs:/URL 转换的例程到 VFS VirtualFile 对象,所以我无处可去.

I've tried trying to access the underlying VFS packages to open the file through the JBoss VFS API, but most of the API appears to be private, and I couldn't find a routine to translate from a vfs:/ URL to a VFS VirtualFile object, so I couldn't get anywhere.

我可以尝试在 JBoss 中找到磁盘上的文件,但这种方法在升级时听起来很容易失败.

I can try to find the file on disk within JBoss, but that approach sounds very failure prone on upgrade.

我们的旧方法是使用 Java Web Start 将 jar 分发给客户端,然后在 Java Web Start 的缓存中查找它们以提取它们.但是,由于缓存的布局发生了变化,因此在 Java 的每次小升级中都会中断.

Our old approach was to use Java Web Start to distribute the jars to the client and then look them up within Java Web Start's cache to extract them. But that broke on every minor upgrade of Java because the layout of the cache changed.

推荐答案

问题 JBVFS-147 不能从 vfs 读取:协议 URL 仍未解析,也许您想投票并观看此问题.

The issue JBVFS-147 Cannot read from vfs: protocol URL is still unresolved, maybe you want to vote and watch this issue.

这篇关于为什么我无法打开 JBoss vfs:/URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆