路径不对了
我现在也在做aglet的东西,我的代码如下。
package examples.talk;
talkSlave.class 在CLASSPATH\examples\talk目录下。
AgletProxy proxy = context.createAglet(null, "examples.talk.TalkSlave", getProxy());
第三个参数是getProxy().
下面是aglet文档里的原文,希望对你有帮助。
createAglet
public AgletProxy createAglet(java.net.URL codeBase,
                              java.lang.String code,
                              java.lang.Object init)
                       throws java.io.IOException,
                              AgletException,
                              java.lang.ClassNotFoundException,
                              java.lang.InstantiationExceptionCreates an instance of the specified aglet class. The aglet's class code file can be located on the local file system as well as on a remote server. If the codeBase is null, the context will search for the code in the local system's aglet search path (AGLET_PATH). The createAglet method takes three arguments: codeBase, code, and init:
Parameters:
codeBase - codeBase specifies the base URL of the aglet class file, in other words, the (possibly remote) directory that contains the aglet's code. If this argument is null, then the directories specified in the local host's aglet search path are searched. The aglet search path works in a similar way to Java's class path. It is typically an environment variable that specifies a list of directories to be searched for aglet code files.
code - code gives the name of the file that contains the aglet's compiled class code. This file is relative to the base URL of the aglet, and cannot be absolute.
init - init is an object passed on to the aglet's onCreation method.
Returns:
the proxy of the new aglet.
Throws:
AgletException - if the aglets can not be created.
UnknownHostException - if the given host could not be found.
ServerNotFoundException - if the server could not be found.
java.lang.InstantiationException - if the instantiation failed.
java.lang.ClassNotFoundException - if the class not found.