Applet RMI Error

I have a very simplet Applet that is getting an error in the Init method:

public void init() {

print("Starting Init Method");

print("Server Hostname = " + hostname);

try {

String objectName = "//" + hostname + "/EMSL Test RMI Server";

print("Looking up RMI Object : " + objectName);

Object object = Naming.lookup(objectName);

print("Result = " + object);

ServerInterface server = (ServerInterface)object;

print("Using Remote Object to get Remote Object Hostname");

print("... " + server.getHostname());

}catch(Throwable e) {

print("");

print("Error :");

print(e.toString());

print("");

print("Stack Trace :");

StringWriter stringWriter = new StringWriter();

PrintWriter printWriter = new PrintWriter(stringWriter);

e.printStackTrace(printWriter);

print(stringWriter.toString());

}

}

Error:

java.lang.ExceptionInInitializerError

Stack Trace:

java.lang.ExceptionInInitializerError

at java.rmi.Naming.getRegistry(bytecode 12)

at java.rmi.Naming.lookup(bytecode 6)

at AppletClient.init(bytecode 41)

at com.insignia.applet.AppletPanel.run(bytecode 167)

at java.lang.Thread.run (bytecode 11)

Any thoughts? This works as an appliction under WinCE using insignia EVM, but not as an applet.

Regards,

Bill

[1431 byte] By [billwimsatt] at [2007-9-26 9:56:42]
# 1

> Error:

> java.lang.ExceptionInInitializerError

>

> Stack Trace:

> java.lang.ExceptionInInitializerError

> at java.rmi.Naming.getRegistry(bytecode 12)

> at java.rmi.Naming.lookup(bytecode 6)

> at AppletClient.init(bytecode 41)

> at com.insignia.applet.AppletPanel.run(bytecode

> ode 167)

> at java.lang.Thread.run (bytecode 11)

>

> Any thoughts? This works as an appliction under WinCE

> using insignia EVM, but not as an applet.

Looks like it cant find the registry.

Make sure that the registry deamon is started and accessible from within your applet.

Verify that host and port are correct and that the applet is running in an environment where the registry deamon can be reached, eg inside the same subnet.

This advice sounds like a simple truth, but it is always the simple things stopping software from working.

Oliver

ofels at 2007-7-1 21:42:48 > top of Java-index,Java Mobility Forums,Java ME Technologies...
# 2

Thanks for the insight. The applet runs standalone in WinCE under the Insignia EVM. The issue is actually one that I believe is easy to solve, and is simply a 'security configuration' issue. I have tested with a desktop VM using the Opera browser and 1.1.8.

The server is the same machine as the web server, thus alleviating any typical security concerns that an Applet may throw us.

Thanks for the help so far.

Regards,

Bill

bwimsatt at 2007-7-1 21:42:48 > top of Java-index,Java Mobility Forums,Java ME Technologies...