Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

An Error when Using rmic command

0 views
Skip to first unread message

ZPAN

unread,
Jul 9, 2000, 3:00:00 AM7/9/00
to

The following compiler error occurred when I compiled the example in the
Essentials of the Java-Programming Language: A Hans-On Guide (part one, lesson
8), which is anvn mn fr43v online book on SUN website.

The Java program is as follows,


import java.awt.Font;
import java.awt.Color;
import java.awt.BorderLayout;
import java.awt.event.*;1
import javax.swing.*;

import java.io.*;
import java.net.*;

import java.rmi.*;
import java.rmi.server.*;

class RemoteServer extends UnicastRemoteObject
implements Send {

private String text;

public RemoteServer() throws RemoteException {
super();
}

public void sendData(String gotText){
text = gotText;
}

public String getData(){
return text;
}

public static void main(String[] args){
if(System.getSecurityManager() == null) {
System.setSecurityManager(new RMISecurityManager());
}

String name = "//kq6py.eng.sun.com/Send";
try {
Send remoteServer = new RemoteServer();
Naming.rebind(name, remoteServer);
System.out.println("RemoteServer bound");
} catch (java.rmi.RemoteException e) {
System.out.println("Cannot create remote server object");
} catch (java.net.MalformedURLException e) {
System.out.println("Cannot look up server object");
}
}
}


After I compiled this program and issued the command

rmic RemoteServer

then I got an error as follows,

java.lang.NoClassDefFoundError: com/sun/corba/se/internal/util/Utility
at sun.rmi.rmic.RMIGenerator.sourceFileForClass(RMIGenerator.java:186)
at sun.rmi.rmic.RMIGenerator.<init>(RMIGenerator.java:267)
at sun.rmi.rmic.RMIGenerator.generate(RMIGenerator.java:105)
at sun.rmi.rmic.Main.doCompile(Main.java:526)
at sun.rmi.rmic.Main.compile(Main.java:133)
at sun.rmi.rmic.Main.main(Main.java:761)
error: An error has occurred in the compiler; please file a bug report
(http://j
ava.sun.com/cgi-bin/bugreport.cgi).
1 error


Probably one more class should be imported, but I do not know where I can find
it. I am using JDK 1.3. Thanks for your help in advance.

Also could you give me a little explanation about the following Java code.
String name = "//kq6py.eng.sun.com/Send";

zpan


0 new messages