java.net.MalformedURLException:未知协议:rsrc [英] java.net.MalformedURLException: unknown protocol: rsrc

查看:876
本文介绍了java.net.MalformedURLException:未知协议:rsrc的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我得到了这个;

java.net.MalformedURLException: unknown protocol: rsrc

我不完全确定如何处理这个未知协议。我使用简单的RMI在两个JVM之间进行通信。它是一个我缺少的包含这个协议的jar,如果是的话,哪一个?我没有发现谷歌搜索对于这个问题非常好。

I'm not entirely sure what to do about this unknown protocol. I am using simple RMI to communicate between two JVMs. Is it a jar that I am missing that contains this protocol and, if so, which one? I haven't found Google searches to be all that great for this issue.

任何帮助都将不胜感激。谢谢。

Any help would be appreciated. Thanks.

EDIT2:为了澄清,我的RMI代码在从Eclipse运行时有效。当我导出并使用runnable jar文件并且它会中断时。

To clarify, my RMI code works when running from Eclipse. It's when I export and use runnable jar files and such that it breaks.

编辑:这是一个代码片段:

Here's a code snippet:

registry=LocateRegistry.getRegistry(
                rmiServerAddress,
            (new Integer(rmiServerPort)).intValue());


推荐答案

我终于明白了。使用Eclipse并导出runnable jar文件时,请确保在Library Handling下选择:

I finally figured it out. When using Eclipse and exporting a runnable jar file, make sure to choose under Library Handling:

Extract required libraries into generated JAR

这将解决这一特定问题,可能还有很多其他问题。

That will fix this particular issue and probably many others.

这篇关于java.net.MalformedURLException:未知协议:rsrc的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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