Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EJB service interface compatibility in practice

Let's imagine there is this remote interface that is used to communicate between two Java EE 7 applications.

public interface BusinessService {

    void hello(String name);

    String echo(String echoValue);    
}

Now for some reason the server JEE 7 application gets redeployed with a new and incompatible version of that interface since the method echo has been removed and the client side still relies on the former version of BusinessService.

public interface BusinessService {

    void hello(String name);

    // no more echoing    
}

Will the client still be able to perform a remote call to BusinessService#hello as long it never calls BusinessService#echo?

like image 410
saw303 Avatar asked Dec 30 '25 19:12

saw303


1 Answers

Short answer - YES.

This would be a compatible change, if the client does not use this method. Otherwise, there will be an error on the client side:

javax.ejb.EJBException: No such method echo(java.lang.String) on EJB...

like image 61
dieter Avatar answered Jan 02 '26 07:01

dieter



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!