Hello,
  I have written a FTP server on top of Avalon. I am
planning to go for Apache way. Initially it didn't
have a remote admin. So I have written a RMI based
remote admin. When I am running the server in
stand-alone mode (not based on Avalon), it is running
perfectly. But inside Avalon it is throwing exception.

My server configuration method is like:
/**
 * Configure the server.
 *
 * @param conf the XML configuration block
 */
public void configure(Configuration conf) throws
ConfigurationException {
  try {
      mConfig = new FtpConfig(conf);
      UnicastRemoteObject.exportObject(this);
      if(mConfig.isRemoteAdminSupported()) {
          mConfig.getRmiRegistry().rebind(BIND_NAME,
this);
      }
  }
  catch(Exception ex) {
       ex.printStackTrace();
       throw new
ConfigurationException(ex.getMessage(), ex);
  }
}

Inside FtpConfig constructor, I am creating RMI
registry (if necessary) and exporting the object. 

My problems are:

1. I am not able to use default RMI port (1099). So I
am using some other port.

2. I am not able to export. The stack trace:
java.rmi.server.ExportException: internal error: ObjID
already in use
        at
sun.rmi.transport.ObjectTable.putTarget(ObjectTable.java:164)
        at
sun.rmi.transport.Transport.exportObject(Transport.java:71)
        at
sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:184)
        at
sun.rmi.transport.tcp.TCPEndpoint.exportObject(TCPEndpoint.java:319)
        at
sun.rmi.transport.LiveRef.exportObject(LiveRef.java:119)
        at
sun.rmi.server.UnicastServerRef.exportObject(UnicastServerRef.java:125)
        at
sun.rmi.registry.RegistryImpl.setup(RegistryImpl.java:95)
        at
sun.rmi.registry.RegistryImpl.<init>(RegistryImpl.java:81)
        at
java.rmi.registry.LocateRegistry.createRegistry(LocateRegistry.java:167)
        at
ftpserver.FtpConfig.<init>(FtpConfig.java:124)
        at
ftpserver.FtpServerImpl.configure(FtpServerImpl.java:91)
        at
org.apache.avalon.phoenix.engine.phases.StartupPhase.visitBlock(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.blocks.BlockDAG.visitBlock(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.blocks.BlockDAG.walkGraph(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.DefaultServerApplication.runPhase(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.DefaultServerApplication.start(Unknown
Source)
        at
org.apache.avalon.framework.atlantis.AbstractKernel.startEntry(Unknown
Source)
        at
org.apache.avalon.framework.atlantis.AbstractKernel.start(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.PhoenixEmbeddor.start(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.Main.execute(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.Main$1.run(Unknown
Source)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.avalon.phoenix.engine.Main.execute(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.Main.main(Unknown
Source)
        at java.lang.reflect.Method.invoke(Native
Method)
        at
org.apache.avalon.phoenix.engine.loader.PhoenixLoader$1.run(Unknown
Source)
        at
java.security.AccessController.doPrivileged(Native
Method)
        at
org.apache.avalon.phoenix.engine.loader.PhoenixLoader.runSystem(Unknown
Source)
        at
org.apache.avalon.phoenix.engine.loader.PhoenixLoader.main(Unknown
Source)

Thanks,
Rana.


__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to