java.net.MalformedURLException: unknown protocol: rsrc
Asked Answered
O

3

5

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());
Outdoors answered 21/9, 2011 at 21:54 Comment(5)
Ummm... you will need to give us more info before we can help you. What about some code snippet and no only the last line of the exception? :-) Have you also googled already for this error? forums.oracle.com/forums/thread.jspa?threadID=1176215Context
Yes I have, that's why I mentioned that Google searches haven't been great.Outdoors
By any change you are using Eclipse' export feature?Tova
I am using Eclipse's export feature. I know it may have something to do with that. But I have not been able to figure out which of its jars I need if that is the case.Outdoors
I believe eclipse used a customized classloader implementation which reads bundled jars and add them to class path. Try not to use "bundled jars" option to see if it helps. i.e. Copy libraries into sub folder option.Tova
O
14

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.

Outdoors answered 22/9, 2011 at 9:13 Comment(1)
Perfect. You saved meDrying
C
0

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?

Context answered 21/9, 2011 at 22:28 Comment(0)
S
0

this option definitely works: Export > Runnable Jar File > Copy required libraries into a sub-folder

Shane answered 12/12, 2014 at 7:2 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.