Deprecate remoting technologies support

Because of security and broader industry support, support for several
remoting technologies is now deprecated and scheduled for removal in
Spring Framework 6.0.

This commit deprecates the following remoting technologies:

* HTTPInvoker
* RMI
* Hessian
* JMS remoting

Other remoting technologies like EJB or JAXWS might be deprecated in the
future depending on industry support.

Closes gh-25379
This commit is contained in:
Brian Clozel
2020-07-10 12:04:24 +02:00
parent 92cdf526fb
commit d9ccd618ea
32 changed files with 858 additions and 791 deletions

View File

@@ -29,7 +29,6 @@ import org.aopalliance.intercept.MethodInvocation;
import org.springframework.lang.Nullable;
import org.springframework.remoting.RemoteConnectFailureException;
import org.springframework.remoting.RemoteLookupFailureException;
import org.springframework.remoting.rmi.RmiClientInterceptorUtils;
/**
* Base class for interceptors proxying remote Stateless Session Beans.
@@ -121,8 +120,9 @@ public abstract class AbstractRemoteSlsbInvokerInterceptor extends AbstractSlsbI
* @return whether the exception should be treated as connect failure
* @see org.springframework.remoting.rmi.RmiClientInterceptorUtils#isConnectFailure
*/
@SuppressWarnings("deprecation")
protected boolean isConnectFailure(RemoteException ex) {
return RmiClientInterceptorUtils.isConnectFailure(ex);
return org.springframework.remoting.rmi.RmiClientInterceptorUtils.isConnectFailure(ex);
}
@Nullable

View File

@@ -28,7 +28,6 @@ import org.aopalliance.intercept.MethodInvocation;
import org.springframework.beans.factory.DisposableBean;
import org.springframework.lang.Nullable;
import org.springframework.remoting.RemoteLookupFailureException;
import org.springframework.remoting.rmi.RmiClientInterceptorUtils;
/**
* Basic invoker for a remote Stateless Session Bean.
@@ -95,11 +94,12 @@ public class SimpleRemoteSlsbInvokerInterceptor extends AbstractRemoteSlsbInvoke
*/
@Override
@Nullable
@SuppressWarnings("deprecation")
protected Object doInvoke(MethodInvocation invocation) throws Throwable {
Object ejb = null;
try {
ejb = getSessionBeanInstance();
return RmiClientInterceptorUtils.invokeRemoteMethod(invocation, ejb);
return org.springframework.remoting.rmi.RmiClientInterceptorUtils.invokeRemoteMethod(invocation, ejb);
}
catch (NamingException ex) {
throw new RemoteLookupFailureException("Failed to locate remote EJB [" + getJndiName() + "]", ex);
@@ -108,12 +108,12 @@ public class SimpleRemoteSlsbInvokerInterceptor extends AbstractRemoteSlsbInvoke
Throwable targetEx = ex.getTargetException();
if (targetEx instanceof RemoteException) {
RemoteException rex = (RemoteException) targetEx;
throw RmiClientInterceptorUtils.convertRmiAccessException(
invocation.getMethod(), rex, isConnectFailure(rex), getJndiName());
throw org.springframework.remoting.rmi.RmiClientInterceptorUtils.convertRmiAccessException(
invocation.getMethod(), rex, isConnectFailure(rex), getJndiName());
}
else if (targetEx instanceof CreateException) {
throw RmiClientInterceptorUtils.convertRmiAccessException(
invocation.getMethod(), targetEx, "Could not create remote EJB [" + getJndiName() + "]");
throw org.springframework.remoting.rmi.RmiClientInterceptorUtils.convertRmiAccessException(
invocation.getMethod(), targetEx, "Could not create remote EJB [" + getJndiName() + "]");
}
throw targetEx;
}

View File

@@ -50,7 +50,9 @@ import org.springframework.lang.Nullable;
* @see java.rmi.server.RMIClassLoader
* @see RemoteInvocationSerializingExporter#createObjectInputStream
* @see org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor#setCodebaseUrl
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class CodebaseAwareObjectInputStream extends ConfigurableObjectInputStream {
private final String codebaseUrl;

View File

@@ -72,7 +72,9 @@ import org.springframework.util.Assert;
* @see org.springframework.remoting.RemoteAccessException
* @see java.rmi.RemoteException
* @see java.rmi.Remote
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class JndiRmiClientInterceptor extends JndiObjectLocator implements MethodInterceptor, InitializingBean {
private Class<?> serviceInterface;

View File

@@ -61,7 +61,9 @@ import org.springframework.util.ClassUtils;
* @see java.rmi.RemoteException
* @see java.rmi.Remote
* @see javax.rmi.PortableRemoteObject#narrow
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class JndiRmiProxyFactoryBean extends JndiRmiClientInterceptor
implements FactoryBean<Object>, BeanClassLoaderAware {

View File

@@ -67,7 +67,9 @@ import org.springframework.util.ReflectionUtils;
* @see JndiRmiClientInterceptor
* @see JndiRmiProxyFactoryBean
* @see javax.rmi.PortableRemoteObject#exportObject
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class JndiRmiServiceExporter extends RmiBasedExporter implements InitializingBean, DisposableBean {
@Nullable

View File

@@ -45,7 +45,9 @@ import org.springframework.util.ClassUtils;
* @see java.io.ObjectOutputStream
* @see #doReadRemoteInvocation
* @see #doWriteRemoteInvocationResult
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public abstract class RemoteInvocationSerializingExporter extends RemoteInvocationBasedExporter
implements InitializingBean {

View File

@@ -36,7 +36,9 @@ import org.springframework.remoting.support.RemoteInvocationBasedExporter;
* @since 1.2.5
* @see RmiServiceExporter
* @see JndiRmiServiceExporter
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public abstract class RmiBasedExporter extends RemoteInvocationBasedExporter {
/**

View File

@@ -67,7 +67,9 @@ import org.springframework.remoting.support.RemoteInvocationUtils;
* @see org.springframework.remoting.RemoteAccessException
* @see java.rmi.RemoteException
* @see java.rmi.Remote
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class RmiClientInterceptor extends RemoteInvocationBasedAccessor
implements MethodInterceptor {

View File

@@ -44,7 +44,9 @@ import org.springframework.util.ReflectionUtils;
*
* @author Juergen Hoeller
* @since 1.1
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public abstract class RmiClientInterceptorUtils {
private static final Log logger = LogFactory.getLog(RmiClientInterceptorUtils.class);

View File

@@ -32,7 +32,9 @@ import org.springframework.remoting.support.RemoteInvocation;
*
* @author Juergen Hoeller
* @since 14.05.2003
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public interface RmiInvocationHandler extends Remote {
/**

View File

@@ -34,6 +34,7 @@ import org.springframework.util.Assert;
* @since 14.05.2003
* @see RmiServiceExporter
*/
@Deprecated
class RmiInvocationWrapper implements RmiInvocationHandler {
private final Object wrappedObject;

View File

@@ -57,7 +57,9 @@ import org.springframework.util.Assert;
* @see org.springframework.remoting.RemoteAccessException
* @see org.springframework.remoting.caucho.HessianProxyFactoryBean
* @see org.springframework.remoting.httpinvoker.HttpInvokerProxyFactoryBean
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class RmiProxyFactoryBean extends RmiClientInterceptor implements FactoryBean<Object>, BeanClassLoaderAware {
private Object serviceProxy;

View File

@@ -60,7 +60,9 @@ import org.springframework.lang.Nullable;
* @see org.springframework.jmx.support.ConnectorServerFactoryBean
* @see java.rmi.registry.Registry
* @see java.rmi.registry.LocateRegistry
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class RmiRegistryFactoryBean implements FactoryBean<Registry>, InitializingBean, DisposableBean {
protected final Log logger = LogFactory.getLog(getClass());

View File

@@ -65,7 +65,9 @@ import org.springframework.lang.Nullable;
* @see java.rmi.RemoteException
* @see org.springframework.remoting.caucho.HessianServiceExporter
* @see org.springframework.remoting.httpinvoker.HttpInvokerServiceExporter
* @deprecated as of 5.3.0 with no replacement.
*/
@Deprecated
public class RmiServiceExporter extends RmiBasedExporter implements InitializingBean, DisposableBean {
private String serviceName;