java.net.MalformedURLException:未知协议:rsrc
我明白了;
java.net.MalformedURLException: unknown protocol: rsrc
我不完全确定如何处理这个未知的协议。我正在使用简单的 RMI 在两个 JVM 之间进行通信。我是否缺少一个包含该协议的罐子,如果是,是哪一个?我还没有发现谷歌搜索对于这个问题有那么大的帮助。
任何帮助将不胜感激。谢谢。
EDIT2:澄清一下,我的 RMI 代码在从 Eclipse 运行时可以工作。当我导出并使用可运行的 jar 文件时,它就会崩溃。
编辑:这是一个代码片段:
registry=LocateRegistry.getRegistry(
rmiServerAddress,
(new Integer(rmiServerPort)).intValue());
I get this;
java.net.MalformedURLException: unknown protocol: rsrc
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: 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.
EDIT: Here's a code snippet:
registry=LocateRegistry.getRegistry(
rmiServerAddress,
(new Integer(rmiServerPort)).intValue());
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我终于想通了。使用 Eclipse 并导出可运行的 jar 文件时,请确保在“库处理”下进行选择:
这将解决此特定问题以及可能的许多其他问题。
I finally figured it out. When using Eclipse and exporting a runnable jar file, make sure to choose under Library Handling:
That will fix this particular issue and probably many others.
抱歉,在地球的这一边已经太晚了,我错过了你的短语! :-)
这个问题怎么样?基本上,服务器是否从文件系统中路径名中带有空格的路径运行?
Sorry, it's already too late on this side of the globe and I missed the your phrase! :-)
What about this issue? Basically, is the server running from a path in the filesystem with spaces in the pathname?
这个选项肯定有效:
Export >可运行的 Jar 文件 >将所需的库复制到子文件夹中
this option definitely works:
Export > Runnable Jar File > Copy required libraries into a sub-folder