How to configure ejb both local and remote on Websphere

I have a stateless EJB session block, with bith @local and @remote annotations. The code runs fine on the weblogic server. However, when deployed to Websphere, it gives the following exception.

bm.ejs.container.EJBConfigurationException: BUSINESS_INTERFACE_DESIGNATED_AS_BOTH_REMOTE_AND_LOCAL: 'oracle.odc.session.ODCSession'

The oracle.odc.session.ODCSession business interface class cannot be either remote or local.

Is there any workaround that allows it to work without writing separate EJBs for remote and local calling?

+3
source share
3 answers

, , , , .

public interface MyEJBBase {
    public void foo();
    public void bar();
}

@Local
public interface MyEJBLocal extends MyEJBBase {}

@Remote
public interface MyEJBRemote extends MyEJBBase {}
+2

AFAIK , .

+1

4.9.7 EJB 3.2:

- , - bean.

:

public interface MyInterface { /* all the methods */ }
public interface MyRemoteInterface extends MyInterface { /* empty */ }

@Stateless
@Remote(MyRemoteInterface.class)
@Local(MyInterface.class)
public class MyBean { /* ... */ }

, , .

+1

Source: https://habr.com/ru/post/1771503/


All Articles