Multiple inheritance in remote interfaces for EJB 3.0 session beans on Webl

Hi All,
We started migration from EJB 2.1(WLS 8.1) to EJB 3.0(WLS 10.3.2) and identified few serious problems. One of them is related with multiple business interfaces inheritance. I wrote simple example that presents point of the problem.
we have session bean AImpl:
+@Stateless(name="A")+
+@Remote({A.class})+
+@TransactionAttribute(TransactionAttributeType.REQUIRED)+
+public class AImpl implements A {+
+@Override+
+public void writeA() {+
System.out.println("A");
+}+
+@Override+
+public void writeB() {+
System.out.println("B");
+}+
+@Override+
+public void writeC() {+
System.out.println("C");
+}+
+}+
with remote interface A:
+@Remote+
+@JNDIName(A.JNDI_NAME)+
+public interface A extends B, C {+
public static String JNDI_NAME = "A_JNDI_NAME";
void writeA();
+}+
As you can see A extends B, and C. Definition of both interfaces is very simple:
+public interface B {+
void writeB();
+}+
+public interface C {+
void writeC();
+}+
Everything looks nice until we want to invoke some method on AImpl bean. For above implementation code:
A a = ctx.lookup(A. JNDI_NAME);
a.writeA();
a.writeB();
a.writeC();
writes down ”A \n B” and throws exception:
caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeC()*
at java.lang.Class.getMethod(Class.java:1605)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
so.. in stub generated by WLS there is no method from interface C ! What more interesting after small change in interface A rely on change in interface implementation order from B, C to C, B (+public interface A extends C, B {+) server writes down only A and I have stack like below:
Caused by: java.lang.NoSuchMethodException: pl.gov.arimr.zszik.bazowe.slowniki.ejb.A_vt0zts_AImpl_1032_WLStub.*writeB()*
at java.lang.Class.getMethod(Class.java:1605)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.getTargetMethod(RemoteBusinessIntfProxy.java:165)
at weblogic.ejb.container.internal.RemoteBusinessIntfProxy.invoke(RemoteBusinessIntfProxy.java:57)
After this experience I came up with suspicion that Weblogic 10.3 does not support inheritance from multiple interfaces in one “generation”. Instead of that it takes only the first interface from the list.
Does anybody have some experience with such a situation? maybe someone have an idea how to work around this problem?

This is Not Supported in WebLogic that the Remote Interface extends other Interfaces. Because Annotation Processor just looks up inside the implemented interface methods. The actual interface which is Implemented by the Bean Class. So the Methods declared inside the Interface B and Interface C will be ignored and will not be available as part of the generated Stubs. Thats why u are getting NoSuchMethodError.
You can even contact Oracle Support on this...there are 3-4 Cases on it. And the Solution is Work As Designed.
Workaround is : edit your interface A as following
Declare all the Business Methods only in the Remote Interface and not inside it's Super Interfaces.
Example:
@Stateless(name="A")
@Remote({A.class})
@TransactionAttribute(TransactionAttributeType.REQUIRED)
public class AImpl implements A {
@Override
public void writeA() {
System.out.println("A");
@Override
public void writeB() {
System.out.println("B");
@Override
public void writeC() {
System.out.println("C");
@Remote
@JNDIName(A.JNDI_NAME)
public interface A extends B, C {
public static String JNDI_NAME = "A_JNDI_NAME";
void writeA();
void writeB();
void writeC();
Thanks
Jay SenSharma
http://jaysensharma.wordpress.com (WebLogic Wonders Are Here)

Similar Messages

  • A tough one for EJB experts - Stateless session bean spec question

    I am busy learning more about EJBs and came across something confusing regarding the legal operations in the various container callback methods for stateless session beans.
    Specifically, the EJB spec states that in the ejbCreate() method, the SessionContext can be used to obtain a reference to the EJB Object. Now this makes perfect sense with stateful session beans, since the ejbCreate() method isn't called until a client is creating a bean and the container has linked that bean to the client's EJB Object. However, it is my understanding that when it comes to stateless session beans, the container creates the beans and adds them to the bean pool at its leisure. It is not until a business method is called by a client that a stateless bean is actually linked to an EJB object. So, how is it that a stateless bean could ever obtain a reference to an EJB Object from within ejbCreate(). Which EJB Object would it be linked to? This operation just doesn't appear to make sense in that context.
    Can anyone clarify this for me?

    Interesting question. I have such questions all the time! Here's a link to a similar discussion
    http://saloon.javaranch.com/cgi-bin/ubb/ultimatebb.cgi?ubb=get_topic&f=70&t=000905
    Also, I tried this using Weblogic 8.1. Tried to access the EJBObject in ejbCreate before any business method was invoked. I did this by specifying a value for initial-beans-in-free-pool and found that the hash code for the EJBObject was the same for all the bean instances that were created on startup.
    I then invoked a business method and accessed the EJBObject in that method. Again the hash code for the object was the same as the one created on startup.
    Seemed to be that there is a 1:n relation between the EJBObject and bean instances.
    This may be container specific. The spec says the user should be able to invoke the getEJBObject() method in ejbCreate(), its upto the container to comply with it.

  • How create  EJB 2.1 Stateful Session Bean in a EJB 3.0 Session Bean

    Hi All,
    We have been developing on EJB 2.1. We are now adding a module on EJB 3.0.
    How can we "create" a stateful session bean with create method signature similar to create(String id)?
    We have tried
    // this is the remote interface
    @EJB AddressBean abean;
    But not working
    Any help will be appreciated.

    There is no explicit create() call for EJB 3.0 session beans. It doesn't really matter though
    since you can accomplish the same thing by defining your own business method to act
    as an initializer for whatever state you'd like. E.g.
    @Remote
    public interface FooInterface {
    public void initialize(String id);
    // ... other business methods
    @EJB FooInterface fooRef;
    fooRef.initialize("foo");
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • EJB3 - More than one remote interface for Session Bean?

    Hi,
    Is it possible in EJB3 to have more than one remote interface for a SessionBean?
    I have seen it posetd on here that it is possible but never been able to find any other information.
    Using JBoss as my App Server, I have deployed an App, where a SessionBean is defined as implementing 2 interfaces, both of which are annotated using @remote.
    However when I examine the JBoss JMX Console, Global JNDI Namespace only one remote interface is listed, and indeed it is the first one defined in the SessionBean.
    Considering I use a String similar to (MyApp/MyBean/remote) to do the JNDI lookup, this would indicate that it is not possible to have more than one remote interface.
    1. Is this a JBoss specific limitation?
    2. Is there another way of performing the JNDI lookup?
    Thanks,
    Alan.

    Hi,
    Thanks for prompt response! I tried the suggestion in my application, and the output from JBoss JMX Console was
    +- XXXBean (class: org.jnp.interfaces.NamingContext)
      |   |   +- remote (proxy: $Proxy291 implements No ClassLoaders found for: xxx.xxx.xxx.xxx.xxx.Remote1 (no security manager: RMI class loader disabled))Again only displaying the remote interface that is first in the @remote ({ Remote1.class , Remote2.class}) list. This would lead me to believe that JBoss does not support this.
    Can anyone confirm this?
    Alan.

  • How to lookup a EJB 3.0 session bean which is deployed in WebLogic 10.3

    Now Jdeveloper 11.1.1, is giving WebLogic server 10.3.
    With internal WebLogic server, when I created a Sample client, it generated code as:
    private static Context getInitialContext() throws NamingException {
        Hashtable env = new Hashtable();
        // WebLogic Server 10.x connection details
        env.put( Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory" );
        env.put(Context.PROVIDER_URL, "t3://127.0.0.1:7101");
        return new InitialContext( env );
    public static void main(String [] args) {
        try {
            final Context context = getInitialContext();
            DefaultSession defaultSession = (DefaultSession)context.lookup("property-DefaultSession#com.vs.property.model.session.DefaultSession");
        } catch (Exception ex) {
    }How to update the above code to lookup the EJB 3.0 session beans with an external WebLogic server 10.3?
    Is there any documentation available on how to install weblogic, troubleshoot, debug, WebLogic server 10.3?
    regds
    -raju

    Raju,
    Hi, to start, here is a tutorial on a quickstart web application using an EJB 3.0 stateless session bean that fronts a container managed EclipseLink JPA entity manager on WebLogic 10.3, you will find references there to other general WebLogic documentation.
    [http://wiki.eclipse.org/EclipseLink/Examples/JPA/WebLogic_Web_Tutorial]
    using @EJB injection on the client instead of a JNDI lookup as below
    [http://edocs.bea.com/wls/docs103/ejb30/annotations.html#wp1417411]
    1) in your second env.put I noticed that your t3 port is 7101, I usually use the default 7001 - but It looks like this port is valid for the JDeveloper embedded version of WebLogic server runs - just verify that it matches the port of your server.
    2) your name#qualified-name lookup looks ok. Verify that the jndi-name element is set in your weblogic-ejb-jar.xml for non injection clients like the following
    <weblogic-ejb-jar>
    <weblogic-enterprise-bean>
    <ejb-name>ApplicationService</ejb-name>
    <jndi-name>ApplicationService</jndi-name>
    3) as a test outside of your application - launch the WebLogic admin console and goto the testing tab of your bean in [Home > Summary of Deployments > "application" > "session bean name"
    thank you
    /michael : http://www.eclipselink.org                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • EJB 2.1 session bean calling EJB 3 session bean?

    I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
    It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse?

    I have a WL 10 (JDK 1.5/EE 5) server that has several EJB 3 stateless session beans deployed and working well. But now I need to allow a JBoss 3.2.3 (JDK 1.4) EJB 2.1 session bean make remote calls into these EJB 3 EJBs. Can this even work?
    It seems to me that EJB 3 calling EJB 2 would be fine, but not in the reverse?

  • Cannot deploy a EJB 3.0 Session bean to the OAS 10.1.3.4

    Hi All,
    I am unable to deploy a EJB 3.0 Session bean with no deployment descriptors to OAS 10.1.3.4 App server.This Session bean is also exposed as a web service using annotations. I am able to deploy this bean to a standalone oc4j 10.1.3.x containers and test it successfully.
    i have written a simple stateless session bean ( exposed as webservice) and every bean is having issues with deployment having the same exception stated below
    Can some one please help as i need to deploy this urgently.
    below is the session bean code:
    import javax.ejb.Stateless;
    @Stateless(name="SiebelQuoteEJB")
    public class SiebelQuoteEJBBean implements SiebelQuoteEJBLocal,
    SiebelQuoteEJBWebService {
    public SiebelQuoteEJBBean() {
    public String publishMessage(String message,String type) throws java.rmi.RemoteException {
    client.publishMessage(message,type);
    return "SUCCESS";
    Below is the error while deploying:
    11/01/06 15:03:49 WARNING: Application.setConfig Application: javasso is in failed state as initialization failed.
    java.lang.NullPointerException
    11/01/06 15:03:50 WARNING: Application.setConfig Application: SiebelQuoteEJB is in failed state as initialization failed.
    java.lang.InstantiationException: Error initializing ejb-modules: null Error parsing application-server config file: null
    11/01/06 15:03:50 java.lang.NullPointerException
    at com.evermind.server.ObjectReferenceCleaner.cleanupApplicationLogLevels(ObjectReferenceCleaner.java:166)
    at com.evermind.server.ObjectReferenceCleaner.loaderDestroyed(ObjectReferenceCleaner.java:88)
    at oracle.classloader.EventDispatcher.loaderDestroyed(EventDispatcher.java:248)
    at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1113)
    at oracle.classloader.PolicyClassLoader.close(PolicyClassLoader.java:1041)
    at com.evermind.server.ApplicationStateRunning.destroyClassLoaders(ApplicationStateRunning.java:1171)
    at com.evermind.server.Application.stateCleanUp(Application.java:3635)
    at com.evermind.server.Application.setConfig(Application.java:506)
    at com.evermind.server.Application.setConfig(Application.java:355)
    at com.evermind.server.ApplicationServer.addApplication(ApplicationServer.java:1895)
    at com.evermind.server.ApplicationServer.initializeDeployedApplications(ApplicationServer.java:1651)
    at com.evermind.server.ApplicationServer.setConfig(ApplicationServer.java:1034)
    at com.evermind.server.ApplicationServerLauncher.run(ApplicationServerLauncher.java:131)
    at java.lang.Thread.run(Thread.java:736)

    which jdk version? Had this with 1.6 and had to install an up-to-date jdbc.

  • Multiple inheritance in tagging interface? Is it possible?

    I saw a code somewhere that goes like this:
    public interface Node extends Serializable, Clonable
    ...Is it possible? I know that Java doesn't allow multiple inheritance and that Serializable and Clonable are tagging interfaces where no method must be implemented by the programmer.

    KamenRiderZX wrote:
    I know that Java doesn't allow multiple inheritanceMore exactly: Java doesn't allow multiple inheritance of implementations. Inheriting multiple interfaces ("implements" for classes, "extends" for interfaces) is fine 'though.

  • Role of Remote Interface in EJB 2.0

    Hi,
    Recently I was working upon a sample application for developing Entity Bean, the Home interface had a method which provided Business functionality. The implementation of the method was given in the Bean Class by preceeding the name of the method by ejbHome.
    This method was callable by just looking up the Entity Bean, thus not requiring the need for the Remote Interface.
    Now my question is why was this kind of work around required? This totally removes the need for the remote interface, if the Bean Writer decides so.
    The practices suggest that any functionality to the client should be provided via remote interface, and Home interface should contain only the methods related to life cycle of the EJB, then why to have business methods in the Home Interface.
    Please clarify.

    Bhushan!,
    I hope you getting the whole context wrong!.
    As I said earlier if you want to operate on your persistent data, then you must either find an entity bean through ejbFind() or create a new one using ejbCreate ().
    However ejbHome methods provide a functionality which is independent of the persistent data that the bean represents. For ex. Suppose you have an entity bean User that maps to a user database then in order to operate on user data you will always need a remote interface.
    However if you need some information from the bean which is independent of user data then, for ex. you want to say Hello to your clients, you need to implement this functionality using ejbHome () methods.
    I hope this helps.
    VJ

  • What is the remote JNDI for EJB 3.0 in Weblogic 10

    I search the whole site, cant find any stuff about the Remote Business interface for a EJB 3.0,
    I also try several string, only get a NameNotFoundException.
    this is the thing I tried.
    PackEARPack_jarEnterSvrBean_EnterSvr and EnterSvrBean#net.xxxx can get a object, but useless.
    package net.xxxx;
    import java.util.Hashtable;
    import java.util.ResourceBundle;
    import javax.naming.Context;
    import javax.naming.InitialContext;
    import javax.naming.NamingException;
    import org.junit.Before;
    import org.junit.Test;
    public class TestA{
         @Test
         public void test() {
              ResourceBundle rb = ResourceBundle.getBundle("jndi");
              Hashtable<String, String> table = new Hashtable<String, String>();
              table.put(Context.INITIAL_CONTEXT_FACTORY, "weblogic.jndi.WLInitialContextFactory");;
              table.put(Context.PROVIDER_URL, "t3://localhost:7001");
              table.put(Context.SECURITY_PRINCIPAL, "weblogic");
              table.put(Context.SECURITY_CREDENTIALS, "weblogic");
              Context context = null;
              try {
                   context = new InitialContext(table);
              } catch (NamingException e) {
                   e.printStackTrace();
              //print all result
              find(context, "net.xxxx.EnterSvrLocal");
              find(context, "net.xxxx.EnterSvr");
              find(context, "net.xxxx.EnterSvrBean");
              find(context, "net.xxxx.EnterSvrBean/remote");
              find(context, "net.xxxx.EnterSvrBean/local");
              find(context, "PackEAR/net.xxxx.EnterSvr");
              find(context, "PackEAR/net.xxxx.EnterSvrLocal");
              find(context, "PackEAR/net.xxxx.EnterSvrBean");
              find(context, "PackEAR/net.xxxx.EnterSvrBean/remote");
              find(context, "PackEAR/net.xxxx.EnterSvrBean/local");
              find(context, "PackEAR/Pack/net.xxxx.EnterSvr");
              find(context, "PackEAR/Pack/net.xxxx.EnterSvrLocal");
              find(context, "PackEAR/Pack/net.xxxx.EnterSvrBean");
              find(context, "PackEAR/Pack/net.xxxx.EnterSvrBean/remote");
              find(context, "PackEAR/Pack/net.xxxx.EnterSvrBean/local");
              find(context, "PackEAR/Pack.jar/net.xxxx.EnterSvr");
              find(context, "PackEAR/Pack.jar/net.xxxx.EnterSvrLocal");
              find(context, "PackEAR/Pack.jar/net.xxxx.EnterSvrBean");
              find(context, "PackEAR/Pack.jar/net.xxxx.EnterSvrBean/remote");
              find(context, "PackEAR/Pack.jar/net.xxxx.EnterSvrBean/local");
              find(context, "EnterSvr");
              find(context, "EnterSvrLocal");
              find(context, "EnterSvrBean");
              find(context, "EnterSvrBean/local");
              find(context, "EnterSvrBean/remote");
              find(context, "PackEAR/EnterSvr");
              find(context, "PackEAR/EnterSvrLocal");
              find(context, "PackEAR/EnterSvrBean");
              find(context, "PackEAR/EnterSvrBean/local");
              find(context, "PackEAR/EnterSvrBean/remote");
              find(context, "PackEAR/Pack/EnterSvr");
              find(context, "PackEAR/Pack/EnterSvrLocal");
              find(context, "PackEAR/Pack/EnterSvrBean");
              find(context, "PackEAR/Pack/EnterSvrBean/local");
              find(context, "PackEAR/Pack/EnterSvrBean/remote");
              find(context, "PackEAR/Pack.jar/EnterSvr");
              find(context, "PackEAR/Pack.jar/EnterSvrLocal");
              find(context, "PackEAR/Pack.jar/EnterSvrBean");
              find(context, "PackEAR/Pack.jar/EnterSvrBean/local");
              find(context, "PackEAR/Pack.jar/EnterSvrBean/remote");
              find(context, "EnterSvrBean#net.xxxx");
              find(context, "EnterSvrBean#net.xxxx.EnterSvr");
              find(context, "EnterSvrBean#net.xxxx.EnterSvrLocal");
              find(context, "EnterSvrBean#net.xxxx.EnterSvrBean");
              find(context, "EnterSvrBean#net.xxxx.EnterSvrBean/remote");
              find(context, "EnterSvrBean#net.xxxx.EnterSvrBean/local");
              find(context, "PackEARPack_jarEnterSvrBean_EnterSvr");
         private static void find(Context context, String str){
              try {
                   Object o = context.lookup(str);
                   System.out.println("success:"+str+", is class:"+o.getClass());
              } catch (NamingException e) {
                   System.out.println("failed:"+str);
    ##################################################

    I am having the same problem. Note what the API spec says
    about mappedName at http://java.sun.com/javaee/5/docs/api/
    If I take the default, which should be supported, and which seems to deploy normally, then there seems to be something missing from the JNDI tree (e.g. having the class: $Proxy126).
    Can't the deployment generate a default object for the lookup?

  • Using local interfaces for EJB (session bean)

    Hi,
    I�ve a question regarding when to use the Local interfaces(EJBLocal and EJBLocalHome) of a enterprise bean. I understand that calls to enterprise bean can be made locally if the client which is invoking is in the same JVM as that of EJB. I�ve written a web client (servlet) which is packaged in a EAR and this servlet is trying to invoke a session bean which is in a �different� EAR using local interfaces. Both the EARs have been deployed in a single server (websphere 6.0 server). It didn�t work for me this way�..If I package the servlet in the same EAR of session bean then it works fine.
    So is this to say that both EARs are not running on the same JVM? Or should it work even if the client and the session bean are in different EARs but in same server?
    Can anyone explain me the fundamentals behind this.
    Thanks in advance

    Local access is only portable within the same .ear. For example, the Java EE SDK and SUN's
    application servers have never supported local EJB access from a web/EJB component in a different
    .ear. One issue is that local access requires that both the caller and target EJB have the same
    classloader. By definition, different Java EE applications have distinct classloaders. In addition,
    in Java EE 5 persistence context propagation does not span applications, so it wouldn't work in the
    local case.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • EJB 3.0 Session Bean Remote Client

    Hi,
    I am planning to migrate my EJB 2.1 to EJB 3.0. My old session bean is accessed by a remote java client. I just have to include this piece of code:
    Hashtable props = new  Hashtable();
    props.put("java.naming.factory.initial", com.sun.jndi.cosnaming.CNCtxFactory");
    props.put("java.naming.provider.url", "iiop://" + host_ + ":" + port_);I also have to generate rmistubs for the ejb. I have deployed my EJB 3.0 in a Sun Appserver, checking the "Generate RMIStubs" box but I couldn't find the client jar file. In EJB 3.0, should I use the same approach as the 2.1? Or should I use the @EJB annotation? How will I access a remote EJB 3.0 using the @EJB annotation? Thanks in advance.
    Regards,
    Andrew
    Message was edited by:
    bashdrew

    EJB 3.0 remote business interfaces are do not have the same interoperability requirements as the EJB 2.x Home/Remote view. If you need access to your EJB 3.0 bean from a legacy client, you can add a 2.x-style Home/Remote view to your bean by either using the <home>/<remote> elements in ejb-jar.xml or the @RemoteHome annotation. Note that the 2.x-style Home/Remote interfaces are completely separate from the 3.0 Remote Business interface.
    Also, in SUN's implementation if your EJB 3.0 bean has both a 3.0 Remote business and a 2.x Home/Remote interface there is no default global JNDI name for the bean. You'll need to assign it explicitly using the @Stateless/@Stateful mappedName() attribute or sun-ejb-jar.xml.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                           

  • EJB 3.0 Session bean local interface NullPointerException

    I am trying a very simple test of a Stateless EJB 3.0 bean called from a servlet.
    The bean has a local interface, annotated with @Local. The bean implements that interface and is annotated with @Stateless.
    I have a servlet with a variable of the local interface type, annotated with @EJB. The servlet's doGet method invokes the bean's one method using that interface and it works fine.
    BUT if I put the same variable, annotated with @EJB into another class in the web container, it is not injected correctly and I get a NullPointerException on the variable. This class is in WEB-INF/classes with the servlet class, so I assume it is loaded by the same classloader.
    I don't understand why the servlet can instantiate the EJB local interface successfully but another class in the web container can't. I get the same result in OC4J standalone 10.1.3.1 and 10.1.3.3.

    Only managed classes like servlets, filters etc. will have context and EJB references injected into them, and only with servlet version 2.5. A work colleague found the answer in Debu Panda's blog:
    http://debupanda.blogspot.com/2006_10_01_archive.html#116184543992078773
    This behaviour appears to be part of the EJB 3.0 standard.
    The solution is to use JNDI lookup in the client class (POJO) and declare an ejb-local-ref in web.xml.

  • EJB 3.0 Session Bean Inheritence

    Hi all,
    Can one stateless session bean extend another? I get "no" for an answer during deployment of my EJB module. I'm using NetBeans 5.5 with Sun App Server 9.0.
    For example:
    @Stateless
    MySessionBean1 implements ...some remote interface {
    @Stateless
    MySubBean extends MySessionBean1 implements some more interfaces {
    }

    There is no support for "component" inheritance in EJB. You are free to use implementation
    inheritance to implement your bean class, but the fact that a super-class happens to be the
    bean class of a different EJB has no bearing on the processing of the sub-class. So, for example,
    the fact that MySessionBean1 has "some remote interface" will not automatically make
    "some remote interface" one of MySubBean's remote interfaces.
    --ken                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               

  • EJB 3.0 Session Bean question

    Hi there,
    How'd I expose a method of Stateless Session Bean in EJB 3.0? I don't seem to find any annotation for that.
    Thanks in advance.
    Saeed

    If you need to expose method implemented in Session bean, you can invoke the method call from within another method called in Client.
    This method has to be defined in the remote interface . The method you are trying to invoke can be defined somewhere else but called in your bean class from within the method definedin the remote interface.

Maybe you are looking for