]
Tomas Lamr updated JBAS-9560:
-----------------------------
Summary: implemtentation of java.rmi.server.UnicastRemoteObject always sent as value
when remote jndi lookup (was: child of java.rmi.server.UnicastRemoteObject always sent as
value when remote jndi lookup)
JBEAP-52
implemtentation of java.rmi.server.UnicastRemoteObject always sent as
value when remote jndi lookup
---------------------------------------------------------------------------------------------------
Key: JBAS-9560
URL:
https://issues.jboss.org/browse/JBAS-9560
Project: Application Server 3 4 5 and 6
Issue Type: Bug
Security Level: Public(Everyone can see)
Components: Remoting
Affects Versions: 6.1.0
Environment: debian testing
Reporter: Tomas Lamr
Reproducible also on jboss eap 6.2 i.e. AS 7.3.
We have an legacy j2ee app that runs on many application servers. We are trying to port
it to AS 7.x, but found one issue.
We use java rmi. Our remote interface implementation (ImplClass) extends
java.rmi.server.UnicastRemoteObject. We have a singleton instance of this class in our app
that is initialized at the start of the application and then bound into the jndi tree.
For this, we use a context created with org.jboss.as.naming.InitialContextFactory as
java.naming.factory.initial
We bind to "java:jboss/exported/" prefix and it works for us for all the other
simple values but not for our ImplClass.
When doing lookup on the server, the jndi lookup returns correctly an instance that was
created on the server pointing to local connection, but when doing lookup on client with
this context
{code}
org.jboss.naming.remote.client.InitialContextFactory
remote://localhost:port/
{code}
we retrieve the same instance as on the server that point to local connection. Hence it
seems, that our object is always copied and sent as a value to the client instead of
sending the remote proxy which can be used on the client.
The same code works on jboss AS 5.1 (when using jnp) and also on netweaver, websphere and
weblogic when using their context implementations.
It would be great if this could be also fixed in jboss as 7.x.
Known workaround: Use a java.rmi.registry.Registry on the server for registering proxy
instead of jndi.
According to this site (and possibly some spec)
http://www.javaworld.com/article/2076234/soa/get-smart-with-proxies-and-r...
an object should be passed by value if and only if it is implementing Serializable
interface, but the current implementation in jboss as 7.x does not respect this and always
passes objects by value.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: