EJB; Drawbacks of local interfaces?

Hi,
Would be appreciated if some body could tell me what are the drawbacks of local interfaces?
Thanks

There is nothing said as to whether or not the local interfaces are available to Servlets if the web container is running in the same JVM as the EJB container, or at least nothing I could find in the EJB 2.0 or J2EE 1.3 specifications.
I haven't taken the opportunity to find out, but my guess is that as long as the EJB local home entries are findable by the client code and the client code use the objects stored there, then it will work.
ANyone have any direct experience with this or better yet, additional insight into this question from a standards perspective.
Chuck

Similar Messages

  • EJB 3.0 local interface JNDI

    Hello
    I found some information that will probably help a lot of people having trouble with local interface not referenced in JNDI.
    You need to delacre each local interface in the web.xml.
         <ejb-local-ref>
              <ejb-ref-name>MappedNameInYourEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
    <local> yourLocalInterface
              </local>
         </ejb-local-ref>
    The weird thing about this is you don't need to do it when you use remote interface!! I would have thought Weblogic was smart enough to put your EJB in the JNDI when you declare @local on your interface!!
    Am I wrong with something here?
    When I read the EJB spec, it says you don't need to declare your EJB anywhere when you use annotation....
    If someone have an explanation I would be very happy to read about it!!!!
    Tanx

    Hi,
    In our current impl, we don't bind local business interface impl onto global jndi, this is because adding global JNDI binding for local EJB means every local business interface object must be bound into global JNDI, which will give rise to strange errors when accessing remotely or in different application context.
    On the other hand, you needn't add each local interface in the web.xml, you can use annotation through EJB link, which is the suggested way to use EJB local reference, for example:
    @Stateful(name="AccountManagementBean")
    public class AccountManagementBean
    @EJB(
    name="PersonBeanRef",
    beanName="PersonBean"
    Person person;
    @Stateless(name="PersonBean")
    public class PersonBean implements Person {
    In this example, AccountManagementBean has a local reference of PersonBean, the key is you should use beanName in @EJB, whose value is the ejb name of referenced EJB.

  • Accessing Local Interface EJB from Web Container Oracle App Server 9.0.4

    Hi,
    I am developing a struts based small application, which calls a EJB which uses Local Interface from Struts ActionClass.
    I am getting NameNotFoundException. The exact exception is s mentioned below.
    05/03/29 16:15:49 javax.naming.NameNotFoundException: LoginRSL not found
    The deployment descriptors are as mentioned below.
    =============
    ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/dtd/ejb-jar_2_0.dtd">
    <ejb-jar>
    <enterprise-beans>
    <session>
    <description>Session Bean ( Stateless )</description>
    <display-name>LoginRSL</display-name>
    <ejb-name>LoginRSL</ejb-name>
    <local-home>loginApp.model.LoginRHome</local-home>
    <local>loginApp.model.LoginL</local>
    <ejb-class>loginApp.model.LoginRSL</ejb-class>
    <session-type>Stateless</session-type>
    <transaction-type>Container</transaction-type>
    </session>
    </enterprise-beans>
    <relationships/>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>LoginRSL</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    orion-ejb-jar.xml
    <?xml version = '1.0' encoding = 'windows-1252'?>
    <!DOCTYPE orion-ejb-jar PUBLIC "-//Evermind//DTD Enterprise JavaBeans 1.1 runtime//EN" "http://xmlns.oracle.com/ias/dtds/orion-ejb-jar.dtd">
    <orion-ejb-jar>
    <enterprise-beans>
    <session-deployment name="LoginRSL"/>
    </enterprise-beans>
    </orion-ejb-jar>
    I also tried adding following code to web.xml
    web.xml
    <ejb-local-ref>
    <ejb-ref-name>LoginRSL</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>LoginRHome</local-home>
    <local>LoginL</local>
    <ejb-link>LoginRSL</ejb-link>
    </ejb-local-ref>
    It is quite evident that it is not able to lookup the JNDI name.
    Can someone throw light on this? If someone has working sample of this, can you mail it to [email protected]?

    Nipun,
    WebLogic and OC4J are not the same thing. That's like saying Oracle and SQL Server are the same thing -- or C++ and Java are the same thing.
    I recall a posting to a forum (don't remember if it was this one), where the poster was complaining that some feature of the application server he had previously used, was not supported by OC4J. Turned out that the feature he was referring to, contradicted the J2EE specification -- which is why it wasn't available in OC4J. In other words, he didn't like the fact that OC4J was more compliant with the J2EE specification than his "other" application server. Go figure!
    So, if you haven't already done so, I suggest you verify that this feature of WebLogic is something that complies with the J2EE specifications -- before expecting OC4J to support the same feature.
    And if it's not clear, from the specifications, then every vendor is free to implement this feature (or not).
    So if it turns out that WebLogic is a more appropriate application server for you -- then why not just stick with it (and forget the others)?
    Good Luck,
    Avi.

  • Local Interfaces in WebLogic 7.0 Not Faster Than Remote Interfaces?

    I was curious how much faster calling business methods in
    a stateless session EJB in WebLogic 7.0 would be through
    a local interface than calling the same business methods
    through a remote interface. I timed both ways of calling
    the same methods and much to my surprise the times were
    nearly identical. I double-checked that in one case I really
    used the local interface (using ejb-local-ref, local-jndi-name,
    local interfaces in source code). Does anybody (perhaps from
    BEA) have an explanation for this? By the way, I ran the
    same experiment with other J2EE application servers such
    as IBM's WebSphere 5 (Beta) and there was a tremendous
    performance difference between local and remote interface
    usage.
    Thanks,
    Reinhard

    "Reinhard Klemm" <[email protected]> wrote in message
    news:[email protected]...
    I appreciate your response and, at the same time, I am somewhat
    surprised about it. Here are the reasons for my surprise:
    1. Your response indicates that WebLogic uses RMI for
    EJB local method calls, i.e., even if the client is on the same VM.
    I would have assumed that WebLogic would bypass RMI in such
    a situation.That is not what I said. Local interfaces wont use rmi.
    But remote interfaces do better if the call is from the same VM. This is
    weblogic rmi optimization. Please see Rob's posting also.
    2. Other J2EE application servers fare a lot better. In one
    experiment, I timed WebLogic against WebSphere 5.0 Technology
    for Developers (i.e., WebSphere 5.0 Beta, which is expressly
    NOT for performance testing) and against the Sun Reference
    Implementation. Here are the numbers for calling business
    methods in a stateless session EJB through its local interface:
    WebLogic: 5.15 ms on the average
    WebSphere: 0.41 ms on the average
    Sun Reference Implementation: 0.11 ms on the average
    This indicates to me that both WebSphere and the Sun Reference
    Implementation are better optimized than WebLogic by excluding
    RMI when making local EJB calls.
    Reinhard
    "Maruthi Nuthikattu" <[email protected]> wrote in message
    news:<[email protected]>...
    Can you post some numbers so that we can visualize the difference.
    Please add the numbers with other J2EE appserver also.
    Otherwise top of my head, the reason is:
    Weblogic rmi is well optimized for the calls with in the same JVM andsame
    J2EE application.
    This could be the reason you are not seeing much difference.
    ..maruthi
    "Reinhard Klemm" <[email protected]> wrote in message
    news:[email protected]...
    I was curious how much faster calling business methods in
    a stateless session EJB in WebLogic 7.0 would be through
    a local interface than calling the same business methods
    through a remote interface. I timed both ways of calling
    the same methods and much to my surprise the times were
    nearly identical. I double-checked that in one case I really
    used the local interface (using ejb-local-ref, local-jndi-name,
    local interfaces in source code). Does anybody (perhaps from
    BEA) have an explanation for this? By the way, I ran the
    same experiment with other J2EE application servers such
    as IBM's WebSphere 5 (Beta) and there was a tremendous
    performance difference between local and remote interface
    usage.
    Thanks,
    Reinhard

  • Local interfaces and WLS 7

    Hi *,
    does anybody know if localinterfaces work in WLS7 SP1?
    thanx,
    Yauheni

    Yes. my classes were inclueded in system CLASSPATH. but Sun spec says nothing about
    that local interfaces could work only in the application context. it says that restriction
    is that it could work only on the same JVM. so it looks very strange, isn't it? i
    will try to pack everything in ear and try it again.
    Thanx,
    Yauheni
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Yes, it looks like this is a problem. Your application used to work on 6
    because you
    added all your classes to the system classpath, right? And it sounds like
    in 7, local
    calls also depend on the application environment being set.
    Yauheni Prykhodzka <[email protected]> wrote:
    actually, may be that is the problem, we have no ear. we have a set ofjars with
    ejbs and a set of web applications, whci are not packed in war. couldit be a problem,
    when i use local interfaces?
    but spec says that local interface could be used inside a JVM. i thinkit should
    not play a role, if classloadres of ejb and component that use ejb aredifferent.
    is it true?
    Yauheni
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Do you mean that servlet, which is a part of a .war which is deployed
    in
    the
    same .ear with the EJB components fails to invoke EJB's using local interfaces?
    Yauheni Prykhodzka <[email protected]> wrote:
    "Dimitri I. Rakitine" <[email protected]> wrote:
    Interesting. I guess that the problem will go away if you stop using
    startup
    classes
    (for example, use load-on-startup servlet instead to perform initialization
    steps).
    No. I get the same problem after weblogic started. If i try to use localinterfaces
    from another bean o servlet i get the same exception.
    Yauheni
    Yauheni Prykhodzka <[email protected]> wrote:
    Here is the exception, which i'm getting:
    <10.07.2002 11:43:55 CEST> <Emergency> <WebLogicServer> <000342> <Unableto init
    ialize the server: Fatal initialization exception
    Throwable: weblogic.t3.srvr.FatalStartupException: Can't start serverdue to sta
    rtup class failure IdGeneratorStartUp - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundExcept
    ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home];
    Link Remaining Name: 'java:app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-ho
    me']
    javax.naming.LinkException: . Root exception is javax.naming.NameNotFoundExcept
    ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home
    <<no stack trace available>>
    --------------- nested within: ------------------
    weblogic.t3.srvr.FatalStartupException: Can't start server due to
    startup
    class
    failure IdGeneratorStartUp - with nested exception:
    [javax.naming.LinkException:  [Root exception is javax.naming.NameNotFoundExcept
    ion: remaining name: /app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-home];
    Link Remaining Name: 'java:app/ejb/dox.comp.IdGenerator.jar#IdGenerator/local-ho
    me']
    at weblogic.t3.srvr.StartupClassRunner$1.run(StartupClassRunner.java:95)
    at weblogic.security.service.SecurityServiceManager.runAs(SecurityServic
    eManager.java:721)
    at weblogic.t3.srvr.StartupClassRunner.run(StartupClassRunner.java:71)
    at java.lang.Thread.run(Thread.java:484)
    >
    The WebLogic Server did not start up properly.
    the JNDI name for local interface is IdGeneratorLocalHome. i use thisname for lookup.
    Thanx,
    Yauheni--
    Dimitri--
    Dimitri
    Dimitri

  • Remote and local interface on same ejb 3.0 bean instance

    Hi,
    Is it posible to get remote and local interface on same ejb 3.0 bean instance.
    For example get local interface of a bean and than pass it as remote to client.
    Both interfaces must operate on same bean instance.
    Thanks
    Zlaja

    yes. You can implement multiple interfaces on a single class, so you can add a local and a remote interface. One trick to avoid duplicate code is to simply make the remote interface extend the local interface; then you only have to add the @Remote annotation and you're done.
    For example get local interface of a bean and than pass it as remote to client.You don't pass an instances to a client, a client looks up a remote instance of the bean through JNDI.

  • How can I get a reference to the Local interface of a EJB 3 session?

    Hi,
    How can I get a reference to the Local interface of a EJB 3 session?
    My session implements both the local and remote interfaces, so in my client, when I look up the remote interface using the following code, I did get a reference
              processor = (IItemProcessorRemote)initialContext.lookup(IItemProcessorRemote.class.getName());but if I also look up the local interface in th eclient using this:
    processorLocal =(IItemProcessor)initialContext.lookup(IItemProcessor.class.getName());I got errors like the following, do you know why? Thanks a lot!
    Exception in thread "main" javax.naming.NameNotFoundException: sessions.IItemProcessor not found
         at com.sun.enterprise.naming.TransientContext.doLookup(TransientContext.java:203)
         at com.sun.enterprise.naming.TransientContext.lookup(TransientContext.java:175)
         at com.sun.enterprise.naming.SerialContextProviderImpl.lookup(SerialContextProviderImpl.java:61)
         at com.sun.enterprise.naming.RemoteSerialContextProviderImpl.lookup(RemoteSerialContextProviderImpl.java:116)
         at sun.reflect.GeneratedMethodAccessor114.invoke(Unknown Source)
         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
         at java.lang.reflect.Method.invoke(Method.java:597)
         at com.sun.corba.ee.impl.presentation.rmi.ReflectiveTie._invoke(ReflectiveTie.java:121)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatchToServant(CorbaServerRequestDispatcherImpl.java:650)
         at com.sun.corba.ee.impl.protocol.CorbaServerRequestDispatcherImpl.dispatch(CorbaServerRequestDispatcherImpl.java:193)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequestRequest(CorbaMessageMediatorImpl.java:1705)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:1565)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleInput(CorbaMessageMediatorImpl.java:947)
         at com.sun.corba.ee.impl.protocol.giopmsgheaders.RequestMessage_1_2.callback(RequestMessage_1_2.java:178)
         at com.sun.corba.ee.impl.protocol.CorbaMessageMediatorImpl.handleRequest(CorbaMessageMediatorImpl.java:717)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.dispatch(SocketOrChannelConnectionImpl.java:473)
         at com.sun.corba.ee.impl.transport.SocketOrChannelConnectionImpl.doWork(SocketOrChannelConnectionImpl.java:1270)
         at com.sun.corba.ee.impl.orbutil.threadpool.ThreadPoolImpl$WorkerThread.run(ThreadPoolImpl.java:479)

    BTW, findItemByTitle(String title) is a business method in my ItemProcessor session bean.
    public String findItemByTitle(String title) {
              AuctionItem item;
              String result = null;
              try {
                   Query query = entityManager
                             .createNativeQuery("SELECT i from AuctionItem i WHERE i.title LIKE : aTitle");
                   query.setParameter("aTitle", title);
                   item = (AuctionItem) query.getSingleResult();
                   result = item.toString();
              } catch (EntityNotFoundException notFound) {
              } catch (NonUniqueResultException nonUnique) {
              return result;
         }

  • 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  Stateless Local Interface not found

    Using Jdeveloper 1.3 it looked that EJB 3.0 local stateless session EJB bean cannot be found using ejection or lookup. It works with a remote interface.
    Context context =new InitialContext();
    SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJB");
    Is it a bug ?
    Thank You

    Using Jdeveloper 1.3 it looked that EJB 3.0 local stateless session EJB bean cannot be found using ejection or lookup. It works with a remote interface.
    Context context =new InitialContext();
    SessionEJB sessionEJB = (SessionEJB)context.lookup("SessionEJB");
    Is it a bug ?
    Thank You

  • Deploying EJB with Local Interfaces.

    HI everybody
    I am trying example on EJB with LocalInterfaces with BMP.
    My bean without Local interface is deployed and working fine.
    Then i have changed Home & Remote interface code. Again i have deployed it . It is deployed but i am unable to Look Up.
    I am using J2SDKEE1.3 server & JDK1.3.
    I have changed both interface files as follow:-
    I have made my Home interface as :
    public interface RetrieveConditionHome extends javax.ejb.EJBLocalHome {
         public RetrieveCondition create(String SQL_WHERE_ID, String SQL_WHERE_NAME,
              String FROM_TABLE , String WHERE_CLAUSE , String LAST_UPD_USER_ID ,
              Date LAST_UPD_TMSTMP, int ROW_VERSION)
              throws CreateException;
    I have made my Remote interface as :
    public interface RetrieveCondition extends javax.ejb.EJBLocalObject {
         public String getSQLWHERENAME() ;
    -Viren

    In JMS tutorial : They have stated ejbCreateLocal method.
    I am not using this method in my Bean class. I am using general ejbCreate method as we normally do .
    I am really confused about these methods : ejbCreate & ejbCreateLocal.
    JMS Tutorial site (where they have used ejbCreateLocal):
    A J2EETM Application that Uses the JMS API with an Entity Bean
    java.sun.com/products/jms/tutorial/1_3-fcs/doc/j2eeapp3.html
    Viren

  • 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                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Questions about EJB local interfaces - 9iAS 9.03

    Intro: I am new in developing EJB, and I am trying to build an example to verify that a stateless session bean with local interfaces is quite efficient.
    Q1: I have read that an application trying to access local interfaces of an EJB must run into the same JVM. Does it means that it should be deployed into the same OC4J instance as the servlet?
    Q2: I am using JDev 10g to build the EJB, with local and remote interfaces. Using the internal OC4J container, I can use the remote interfaces but not the internal one: an object of class "_Proxy1" is returned after the lookup (with the same name as given for the remote interface related call). Is it possible to access the local interface?
    Q3: My application architecture is already defined to split the business logic in two EJBs: one stateless session bean for volatile data and one entity bean for a global user list cache. Where can I find a working example (with source code, please) to be deployed on 9iAS that can validate my design?
    Q4: In many places, I read that CMP entity bean are easier to develop than BMP one. Is there any special consideration I should be aware of before implementing a CMP for my global user list cache?
    Thanks a lot, Dom.

    I have just read:
    I think the problem is that local interfaces can only by
    accessed through the same container, and JSP/Servlet's
    one is different from EJB's one, regardless of you many
    application server's instances do you have... Hope this
    is the answer...Is there anyone who know if it applies too to 9iAS?
    A+, Dom

  • EJB Local Interfaces / javax.naming.NamingException

    Hi!
    I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
    Opening the JSP i get the following error message:
    javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
    Here's my ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <display-name>oc4jJAR</display-name>
         <enterprise-beans>
              <session>
                   <display-name>TesterEJB</display-name>
                   <ejb-name>TesterEJB</ejb-name>
                   <local-home>oc4jtest.TesterHome</local-home>
                   <local>oc4jtest.Tester</local>
                   <ejb-class>oc4jtest.TesterBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <security-identity>
                        <description/>
                        <use-caller-identity/>
                   </security-identity>
              </session>
         </enterprise-beans>
         <assembly-descriptor>
              <method-permission>
                   <unchecked/>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getPrimaryKey</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getEJBLocalHome</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>remove</method-name>
                        <method-params>
                             <method-param>java.lang.Object</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>remove</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>isIdentical</method-name>
                        <method-params>
                             <method-param>javax.ejb.EJBLocalObject</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>create</method-name>
                        <method-params/>
                   </method>
              </method-permission>
              <container-transaction>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    And here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
         <display-name>oc4jWAR</display-name>
         <filter>
              <filter-name>TestFilter</filter-name>
              <display-name>TestFilter</display-name>
              <description/>
              <filter-class>oc4jtest.TestFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>TestFilter</filter-name>
              <url-pattern>*.jsp</url-pattern>
         </filter-mapping>
         <servlet>
              <servlet-name>test</servlet-name>
              <display-name>test</display-name>
              <jsp-file>/test.jsp</jsp-file>
         </servlet>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>/test.jsp</welcome-file>
         </welcome-file-list>
         <ejb-local-ref>
              <ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>oc4jtest.TesterHome</local-home>
              <local>oc4jtest.Tester</local>
              <ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
         </ejb-local-ref>
    </web-app>
    What's wrong?
    Comments would be appreciated!
    Thanks!
    Peter
    PS: The application runs fine on Sun's Reference Implementation!

    Hi!
    I have tried to deploy a very simple (Hello World like)EJB-Application. It contains a simple stateless SessionBean (with local interfaces) and a JSP which is using the EJB.
    Opening the JSP i get the following error message:
    javax.naming.NamingException: Error instantiating web-app JNDI-context: No location specified and no suitable instance found for the ejb-local-ref 'ejb/TesterEJB', an EJB matching it's ejb-link 'ejb-jar-ic.jar#TesterEJB' was found, but it contained an Entity, not a Session
    Here's my ejb-jar.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE ejb-jar PUBLIC '-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN' 'http://java.sun.com/dtd/ejb-jar_2_0.dtd'>
    <ejb-jar>
         <display-name>oc4jJAR</display-name>
         <enterprise-beans>
              <session>
                   <display-name>TesterEJB</display-name>
                   <ejb-name>TesterEJB</ejb-name>
                   <local-home>oc4jtest.TesterHome</local-home>
                   <local>oc4jtest.Tester</local>
                   <ejb-class>oc4jtest.TesterBean</ejb-class>
                   <session-type>Stateless</session-type>
                   <transaction-type>Container</transaction-type>
                   <security-identity>
                        <description/>
                        <use-caller-identity/>
                   </security-identity>
              </session>
         </enterprise-beans>
         <assembly-descriptor>
              <method-permission>
                   <unchecked/>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getPrimaryKey</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getEJBLocalHome</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>remove</method-name>
                        <method-params>
                             <method-param>java.lang.Object</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>remove</method-name>
                        <method-params/>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>isIdentical</method-name>
                        <method-params>
                             <method-param>javax.ejb.EJBLocalObject</method-param>
                        </method-params>
                   </method>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>LocalHome</method-intf>
                        <method-name>create</method-name>
                        <method-params/>
                   </method>
              </method-permission>
              <container-transaction>
                   <method>
                        <ejb-name>TesterEJB</ejb-name>
                        <method-intf>Local</method-intf>
                        <method-name>getMessage</method-name>
                        <method-params/>
                   </method>
                   <trans-attribute>Required</trans-attribute>
              </container-transaction>
         </assembly-descriptor>
    </ejb-jar>
    And here's my web.xml:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE web-app PUBLIC '-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN' 'http://java.sun.com/dtd/web-app_2_3.dtd'>
    <web-app>
         <display-name>oc4jWAR</display-name>
         <filter>
              <filter-name>TestFilter</filter-name>
              <display-name>TestFilter</display-name>
              <description/>
              <filter-class>oc4jtest.TestFilter</filter-class>
         </filter>
         <filter-mapping>
              <filter-name>TestFilter</filter-name>
              <url-pattern>*.jsp</url-pattern>
         </filter-mapping>
         <servlet>
              <servlet-name>test</servlet-name>
              <display-name>test</display-name>
              <jsp-file>/test.jsp</jsp-file>
         </servlet>
         <session-config>
              <session-timeout>30</session-timeout>
         </session-config>
         <welcome-file-list>
              <welcome-file>/test.jsp</welcome-file>
         </welcome-file-list>
         <ejb-local-ref>
              <ejb-ref-name>ejb/TesterEJB</ejb-ref-name>
              <ejb-ref-type>Session</ejb-ref-type>
              <local-home>oc4jtest.TesterHome</local-home>
              <local>oc4jtest.Tester</local>
              <ejb-link>ejb-jar-ic.jar#TesterEJB</ejb-link>
         </ejb-local-ref>
    </web-app>
    What's wrong?
    Comments would be appreciated!
    Thanks!
    Peter
    PS: The application runs fine on Sun's Reference Implementation!

  • EJB Local Interfaces

    My understanding is that the concept of local interfaces (i.e.
    direct invocation in lieu of an IPC) exist in EJB 2.0. Does
    OC4J support this today? If not, will there be support for it
    in 9i AS 2.0?
    Thanks.

    oc4j/orion supports ejb 2.0 as it stood in the second draft.
    There have been many changes since then, including dropping DO's
    and using Local Interfaces instead.
    OC4J/Orion will have a new version by the end of this year or
    early next year which will implement ejb 2.0.
    Until then, if you want the speed you would get with local
    interfaces in oc4j/orion, you can modify your orion-ejb-jar.xml
    to use copy-by-value="false". This will give you the same
    performance gain as using local interfaces. Its a hack, but what
    the heck, it works.
    Regards,
    the elephantwalker
    www.elephantwalker.com

  • How local interfaces work in EJBs

    How exactly local interfaces work in EJBs and how should I use them ?
    Thank you.

    They are simply non-RMI interface implementations that directly delgate to the EJB's implementation. They are called and in turn call the EJB just as you would call any normal class.
    As such, there is no RMI or serialization overhead and the interfaces can include methods that update their arguments, something not possible in remote interfaces.
    Generally speaking, you should define local interfaces for all entities as one seldom if ever would access entities remotely. You might even consider defining ONLY local interfaces for entities, but that is a tougher call.
    You would define local interfaces for session EJB's that are invoked by other session EJB's within the same container. I would normally always define both local and remote interfaces unless there is some reason why I can eliminate one or the other.
    Chuck

Maybe you are looking for

  • How settlement rule will be created for Sales order with cost object

    Dear Experts, We are using product cost by sales order with valuated stock. In addition we are not using COPA We also consume some materials at sales order level and at the end of month we want to do the result analysis and settlement for the same am

  • User Authentication in ADF BC

    Hi, I am trying to understand "how to authenticate the database(or application) user and retain the connection for later pages in ADF BC application". I downloaded the famous SRDEMO from oracle and now working on it. As I understand : It runs the ind

  • CF9 and Verity indexing error - Linux 64

    I am running CF 9.0.1 Standard Edition on an openSUSE 11.3 64-bit server, with Apache 2.2.15. I am trying to create a verity collection on the server.  The service is running as the collection is created without a problem, but when I attempt to creat

  • Supplier balance

    hello! how can i query supplier balance in AP? what are the involved tables? there is a procedure in oracle database but i cannot access the script: Procedure AP_GET_SUPPLIER_BALANCE

  • Remote Policy Initiation for DMZ Workgroup Servers

    Hi, I could successfully see the client as Active for a DMZ workgroup server. When forced run any policy from client properties on the server, it runs fine. However when trying to run the same from the SCCM console, it gives an error as below. The ar