F
F C
Good Morning
I have a RMI related question:
Our system:
a web application is running in Tomcat 5,
a RMI registry is started by a shell script
Wa have a fire wall so the remote service object use a particular
supplied port (no anonymous port).
Due to the security architecture,
the service/remote object can not be created
outside of the Tomcat Java Virtual Machines.
So, a servlet in the web application is creating and binding the
remote object:
public void jspInit()
{
service = new ServiceImpl();
Naming.rebind(bindUrl, service);
}
public void jspDestroy()
{
Naming.unbind(bindUrl);
service = null;
System.gc();
}
private Service service;
The problem is the following,
when the servlet is destroyed then reinitialized:
the service instance is unbinded (see method jspDestroy)
but still alive
so when the servlet is reinitialized (see method jspInit)
the new service instance is not binded
because it induces an exception because
it compete for the same non anonymous port with the previous unbinded
service instance.
Port already in use: 13000; nested exception is:
java.net.BindException: Address already in use
java.rmi.server.ExportException: Port already in use: ; nested
exception is:
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:
Thank you for any idea
PS:
please reply on the newsgroup
I have a RMI related question:
Our system:
a web application is running in Tomcat 5,
a RMI registry is started by a shell script
Wa have a fire wall so the remote service object use a particular
supplied port (no anonymous port).
Due to the security architecture,
the service/remote object can not be created
outside of the Tomcat Java Virtual Machines.
So, a servlet in the web application is creating and binding the
remote object:
public void jspInit()
{
service = new ServiceImpl();
Naming.rebind(bindUrl, service);
}
public void jspDestroy()
{
Naming.unbind(bindUrl);
service = null;
System.gc();
}
private Service service;
The problem is the following,
when the servlet is destroyed then reinitialized:
the service instance is unbinded (see method jspDestroy)
but still alive
so when the servlet is reinitialized (see method jspInit)
the new service instance is not binded
because it induces an exception because
it compete for the same non anonymous port with the previous unbinded
service instance.
Port already in use: 13000; nested exception is:
java.net.BindException: Address already in use
java.rmi.server.ExportException: Port already in use: ; nested
exception is:
java.net.BindException: Address already in use
at sun.rmi.transport.tcp.TCPTransport.listen(TCPTransport.java:243)
at sun.rmi.transport.tcp.TCPTransport.exportObject(TCPTransport.java:
Thank you for any idea
PS:
please reply on the newsgroup