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

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

问题描述

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

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

我们的应用程序的几部分以一种不寻常的方式传递给客户端:在我们的应用程序内部查找jar,然后将其从servlet发送到客户端,客户端从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,该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?

我尝试尝试通过JBoss VFS API访问基础VFS软件包以打开文件,但是大多数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天全站免登陆