-
1. Re: Naming.list(
starksm64 Nov 8, 2004 1:19 PM (in response to thoste)rmi: is not a valid jndi protocol for the jboss naming service. The string should be "jnp://localhost:1099"
-
2. Re: Naming.list("rmi://localhost:1099"); does not work
thoste Nov 9, 2004 7:16 AM (in response to thoste)Changing to "jnp" does NOT solve the problem.
I got now the following exception:
MyClient exception: invalid URL scheme: jnp://localhost:1099/
java.net.MalformedURLException: invalid URL scheme: jnp://localhost:1099/
at java.rmi.Naming.parseURL(Naming.java:233)
at java.rmi.Naming.list(Naming.java:181)
at test.rmi.simple.MyClient.main(MyClient.java:28)
Yes, I put %JBOSS_HOME%/client/jnp-client.jar in the CLASSPATH.
The full code is:
public static void main(String[] args ) {
// Create and install a security manager
/*
if (System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager()); }
*/
try {
String[] objlist = null;
objlist = Naming.list("jnp://localhost:1099/");
if (0 < objlist.length) {
System.out.println(" Available RMI objects (after rebind) using external Registry:");
int i = 0;
while(i < objlist.length) {
System.out.println(" - Object[" + i + "]="+ objlist);
i++; } }
} catch(......) { ... } -
3. Re: Naming.list(
darranl Nov 9, 2004 10:08 AM (in response to thoste)What are you trying to achieve? Why aren't you using JNDI? Are you still following a tutorial for a different application server?
-
4. Re: Naming.list(
starksm64 Nov 9, 2004 10:51 AM (in response to thoste)Oh, your using the rmi registry Naming.list, not the jndi Context.list as I thought. JBoss does not implement an rmi registry. Use jndi.