EJB 3.0 Local References

I have an EJB module that contains a session bean, MasterBean, with a local interface MasterLocal, packaged in an EAR file. I am trying to look up a reference to MasterLocal in a regular Java class in the same EAR file. I am able to look up the MasterLocal in my WAR file using the following code
web.xml:
    <ejb-local-ref>
        <ejb-ref-name>ejb/MasterLocal</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local>facade.MasterLocal</local>
        <ejb-link>MasterBean</ejb-link>
    </ejb-local-ref> Lookup:
MasterLocal masterLocal = null;
        try {
            InitialContext ic = new InitialContext();
            masterLocal = (MasterLocal) ic.lookup("java:comp/env/ejb/MasterLocal");
        } catch (NamingException ex) {
            logger.severe("Error getting MasterLocal: " + ex.getMessage());
        }How can I use similar code to look up a reference to MasterLocal in the EAR module?
Luke Mauldin

[#|2007-02-01T12:09:04.263-0600|INFO|sun-appserver-pe9.0|javax.enterprise.system.container.ejb|_ThreadID=15;_ThreadName=httpWorkerThread-8080-0;|
javax.ejb.EJBException
     at com.sun.ejb.containers.BaseContainer.processSystemException(BaseContainer.java:3730)
     at com.sun.ejb.containers.BaseContainer.completeNewTx(BaseContainer.java:3630)
     at com.sun.ejb.containers.BaseContainer.postInvokeTx(BaseContainer.java:3431)
     at com.sun.ejb.containers.BaseContainer.postInvoke(BaseContainer.java:1247)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:192)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandlerDelegate.invoke(EJBLocalObjectInvocationHandlerDelegate.java:71)
     at $Proxy93.searchVisitorBadge(Unknown Source)
     at securitylog.login.SelectVisitors.search_action(SelectVisitors.java:752)
     at securitylog.login.SelectVisitors.init(SelectVisitors.java:712)
     at com.sun.rave.web.ui.appbase.servlet.LifecycleListener.fireInit(LifecycleListener.java:555)
     at com.sun.rave.web.ui.appbase.servlet.LifecycleListener.attributeAdded(LifecycleListener.java:405)
     at org.apache.coyote.tomcat5.CoyoteRequest.setAttribute(CoyoteRequest.java:1634)
     at org.apache.coyote.tomcat5.CoyoteRequestFacade.setAttribute(CoyoteRequestFacade.java:522)
     at javax.servlet.ServletRequestWrapper.setAttribute(ServletRequestWrapper.java:295)
     at com.sun.faces.context.RequestMap.put(ExternalContextImpl.java:1055)
     at com.sun.faces.application.ApplicationAssociate.createAndMaybeStoreManagedBeans(ApplicationAssociate.java:525)
     at com.sun.faces.el.ManagedBeanELResolver.getValue(ManagedBeanELResolver.java:82)
     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
     at com.sun.faces.el.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:62)
     at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:65)
     at com.sun.el.ValueExpressionImpl.getValue(ValueExpressionImpl.java:192)
     at com.sun.faces.application.ValueBindingValueExpressionAdapter.getValue(ValueBindingValueExpressionAdapter.java:102)
     at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.pageBean(ViewHandlerImpl.java:666)
     at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.pageBean(ViewHandlerImpl.java:641)
     at com.sun.rave.web.ui.appbase.faces.ViewHandlerImpl.renderView(ViewHandlerImpl.java:249)
     at com.sun.faces.lifecycle.RenderResponsePhase.execute(RenderResponsePhase.java:133)
     at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:244)
     at com.sun.faces.lifecycle.LifecycleImpl.render(LifecycleImpl.java:140)
     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:245)
     at org.apache.catalina.core.ApplicationFilterChain.servletService(ApplicationFilterChain.java:397)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
     at com.sun.webui.jsf.util.UploadFilter.doFilter(UploadFilter.java:203)
     at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:216)
     at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:184)
     at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:276)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
     at org.apache.catalina.core.StandardContextValve.invokeInternal(StandardContextValve.java:240)
     at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:179)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
     at com.sun.enterprise.web.WebPipeline.invoke(WebPipeline.java:73)
     at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:182)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
     at com.sun.enterprise.web.VirtualServerPipeline.invoke(VirtualServerPipeline.java:120)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
     at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:137)
     at org.apache.catalina.core.StandardPipeline.doInvoke(StandardPipeline.java:566)
     at org.apache.catalina.core.StandardPipeline.invoke(StandardPipeline.java:536)
     at org.apache.catalina.core.ContainerBase.invoke(ContainerBase.java:939)
     at org.apache.coyote.tomcat5.CoyoteAdapter.service(CoyoteAdapter.java:239)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.invokeAdapter(ProcessorTask.java:667)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.processNonBlocked(ProcessorTask.java:574)
     at com.sun.enterprise.web.connector.grizzly.ProcessorTask.process(ProcessorTask.java:844)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.executeProcessorTask(ReadTask.java:287)
     at com.sun.enterprise.web.connector.grizzly.ReadTask.doTask(ReadTask.java:212)
     at com.sun.enterprise.web.connector.grizzly.TaskBase.run(TaskBase.java:252)
     at com.sun.enterprise.web.connector.grizzly.WorkerThread.run(WorkerThread.java:75)
Caused by: java.lang.RuntimeException: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/MasterLocal
     at model.listeners.VisitorBadgeListener.lookupMasterBean(VisitorBadgeListener.java:67)
     at model.listeners.VisitorBadgeListener.PostLoad(VisitorBadgeListener.java:45)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at oracle.toplink.essentials.internal.security.PrivilegedAccessHelper.invokeMethod(PrivilegedAccessHelper.java:307)
     at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.invokeMethod(MetadataEntityListener.java:302)
     at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.invokeMethod(MetadataEntityListener.java:324)
     at oracle.toplink.essentials.internal.ejb.cmp3.metadata.listeners.MetadataEntityListener.postClone(MetadataEntityListener.java:404)
     at oracle.toplink.essentials.descriptors.DescriptorEventManager.notifyListener(DescriptorEventManager.java:640)
     at oracle.toplink.essentials.descriptors.DescriptorEventManager.notifyEJB30Listeners(DescriptorEventManager.java:591)
     at oracle.toplink.essentials.descriptors.DescriptorEventManager.executeEvent(DescriptorEventManager.java:199)
     at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.populateAttributesForClone(ObjectBuilder.java:2088)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.populateAndRegisterObject(UnitOfWorkImpl.java:2816)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.cloneAndRegisterObject(UnitOfWorkImpl.java:673)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkIdentityMapAccessor.getAndCloneCacheKeyFromParent(UnitOfWorkIdentityMapAccessor.java:152)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkIdentityMapAccessor.getFromIdentityMap(UnitOfWorkIdentityMapAccessor.java:90)
     at oracle.toplink.essentials.internal.sessions.IdentityMapAccessor.getFromIdentityMap(IdentityMapAccessor.java:295)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3055)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.registerExistingObject(UnitOfWorkImpl.java:3004)
     at oracle.toplink.essentials.queryframework.ObjectBuildingQuery.registerIndividualResult(ObjectBuildingQuery.java:319)
     at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildWorkingCopyCloneNormally(ObjectBuilder.java:441)
     at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildObjectInUnitOfWork(ObjectBuilder.java:406)
     at oracle.toplink.essentials.internal.descriptors.ObjectBuilder.buildObject(ObjectBuilder.java:372)
     at oracle.toplink.essentials.queryframework.ReportQueryResult.processItem(ReportQueryResult.java:205)
     at oracle.toplink.essentials.queryframework.ReportQueryResult.buildResult(ReportQueryResult.java:167)
     at oracle.toplink.essentials.queryframework.ReportQueryResult.<init>(ReportQueryResult.java:83)
     at oracle.toplink.essentials.queryframework.ReportQuery.buildObject(ReportQuery.java:579)
     at oracle.toplink.essentials.queryframework.ReportQuery.buildObjects(ReportQuery.java:628)
     at oracle.toplink.essentials.queryframework.ReportQuery.executeDatabaseQuery(ReportQuery.java:776)
     at oracle.toplink.essentials.queryframework.DatabaseQuery.execute(DatabaseQuery.java:609)
     at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.execute(ObjectLevelReadQuery.java:677)
     at oracle.toplink.essentials.queryframework.ObjectLevelReadQuery.executeInUnitOfWork(ObjectLevelReadQuery.java:731)
     at oracle.toplink.essentials.internal.sessions.UnitOfWorkImpl.internalExecuteQuery(UnitOfWorkImpl.java:2218)
     at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:937)
     at oracle.toplink.essentials.internal.sessions.AbstractSession.executeQuery(AbstractSession.java:909)
     at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.executeReadQuery(EJBQueryImpl.java:346)
     at oracle.toplink.essentials.internal.ejb.cmp3.base.EJBQueryImpl.getResultList(EJBQueryImpl.java:447)
     at facade.DataLookupBean.searchVisitorBadge(DataLookupBean.java:416)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at java.lang.reflect.Method.invoke(Method.java:597)
     at com.sun.enterprise.security.application.EJBSecurityManager.runMethod(EJBSecurityManager.java:1050)
     at com.sun.enterprise.security.SecurityUtil.invoke(SecurityUtil.java:165)
     at com.sun.ejb.containers.BaseContainer.invokeTargetBeanMethod(BaseContainer.java:2766)
     at com.sun.ejb.containers.BaseContainer.intercept(BaseContainer.java:3847)
     at com.sun.ejb.containers.EJBLocalObjectInvocationHandler.invoke(EJBLocalObjectInvocationHandler.java:184)
     ... 53 more
Caused by: javax.naming.NameNotFoundException: No object bound to name java:comp/env/ejb/MasterLocal
     at com.sun.enterprise.naming.NamingManagerImpl.lookup(NamingManagerImpl.java:751)
     at com.sun.enterprise.naming.java.javaURLContext.lookup(javaURLContext.java:156)
     at com.sun.enterprise.naming.SerialContext.lookup(SerialContext.java:307)
     at javax.naming.InitialContext.lookup(InitialContext.java:392)
     at model.listeners.VisitorBadgeListener.lookupMasterBean(VisitorBadgeListener.java:63)
     ... 101 more
|#]

Similar Messages

  • Ejb-link is still required when using local references?

    Hi!
    In BEA's link (http://e-docs.bea.com/wls/docs81/ejb/DDreference-ejb-jar.html#1114738) there is the following comment for weblogic-ejb-jar.xml element 'jndi-name':
    "Assigning a JNDI name to a bean is not recommended. Global JNDI names generate heavy multicast traffic during clustered server startup. See Using EJB Links for the better practice."
    Since we're using local references (local-jndi-name) to access our ejbs instead of remote references, is this still recommendation still pertinent?
    Thanks
    Christianne

    It is enough if you add the ejb-ref & ejb-link in the session bean. The
    session will look up relative to java:comp/env
    The following doc shows an example of accessing an ejb from a web app using
    ejb-link.
    http://e-docs.bea.com/wls/docs81/webapp/components.html#146848
    --Sathish
    <Christianne Carvalho> wrote in message news:[email protected]..
    I'm not getting very well how the ejb-link is used. In my case I have
    entity beans that are referenced in session beans.
    In my entity beans I have the following XDoclet tag.
    * @ejb.bean
    * name="ProductDescription"
    * display-name="ProductDescription"
    * jndi-name="ejb/ProductDescription"
    * local-jndi-name="ejb/ProductDescriptionLocal"
    * view-type="local"
    * type="CMP"
    In my session bean I'm currently getting the reference for the entity bean
    using the following code:
    productDescriptionLocalHome=(ProductDescriptionLocalHome)
    lookupLocalHome(ProductDescriptionLocalHome.JNDI_NAME);
    If I add the following XDoclet tag to my session bean, in ejb-jar.xml a
    <ejb-link> is created inside <ejb-local_ref> tag.
    * @ejb.ejb-ref ejb-name="ProductDescription" view-type="local"
    Considering the info above:
    1) In the entity bean, is there any extra tag to define the ejb-link or is
    the ejb-link only defined in the session bean?
    2) Re session bean, only adding the @ejb-ref xdoclet tag is enough for
    using the ejb-link or do I also have to change my lookup? If I do, what do
    I have to search for in the lookup?
    Thanks!

  • Local references and EJBs in separate jars

    Hi
    I have trouble in getting local references when the EJBs are built in separate jar files. I am using the <ejb-link> in the <local-ejb-ref>. But I could not get reference to the EJB's local reference.
    Please let me know if there is any documentation that tells about getting local references and having the EJBs in separate jar files.
    Thanks

    Greetings,
    Hi
    I have trouble in getting local references when the
    EJBs are built in separate jar files. I am using theThere are a number of reasons why this may be happening and without more specific information it is difficult to say which you are encountering... In any case, the fact that your beans are in separate jars is not, by itself, the issue. It is worth noting, however, that Local references may only be used when both components (referencer and referencee) are co-located within the same VM instance and perhaps this little fact may shed some light on your problem??
    <ejb-link> in the <local-ejb-ref>. But I could not get<ejb-link> should point to the actual JNDI binding name, sans root nomenclature (java:comp/env/), but with full sub-context (ejb/myapp/.../MyLocalBean), of the referenced bean.
    reference to the EJB's local reference.Perhaps it goes without saying (but just to be sure :)... of course, your referenced bean must actually have Local interfaces associated with it.
    Please let me know if there is any documentation
    that tells about getting local references and having
    the EJBs in separate jar files.Both the J2EE tutorial and the EJB 2.0 spec. have the relevant information. :) However, I've already listed the requirements above: supplied local interfaces, co-located components, and correct link reference.
    I hope this helps.
    ThanksRegards,
    Tony "Vee Schade" Cook

  • 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.

  • Need to delete local references in unknown calling context

    Hi,
    I was looking for the need to delete local references and came across this documentation,
    What does unknown caller context mean? and how does it cause local references to remain allocated in reference table although the native function returns?
    http://java.sun.com/docs/books/jni/html/refs.html
    5.2.1 Freeing Local References
    You want to write a utility function that is called from unknown contexts. The MyNewString example shown in Section 4.3 illustrates the use of Delete-LocalRef to delete promptly local references in a utility function. Otherwise there will be two local references that remains allocated after each call to the MyNewString function.

    how does it cause local references to remain allocated in reference table although the native function returns?Because it doesn't return to the JVM where it gets deallocated, it returns to the unknown caller context, i.e. some other piece of native code in your JNI layer. So the references remain until the unknown caller context returns to the JVM.

  • JNI freeing local references

    We're using JNI to receive data from a native callback function. The native side creates local references, but does not use the DeleteLocalRef function. This works fine with the SUN JRE.
    However, the IBM JRE gets a stack overflow exception.
    According to IBM, we should delete the local references, but this requires a total rewrite of our program.
    Unfortunately, the JNI documentation is not very clear on this topic. In our understanding, the local references are being released automatically once they are out of scope.
    Is it really necessary to delete the local references or is there a bug in the IBM JRE ?
    Sample program :
    ==============
    // JNITest.java
    interface INativeNotification
    public void nativeCallBack();
    class JNITest implements INativeNotification
    private long counter;
    public native void nativeInitialize(INativeNotification callbackNotification);
    static {
    System.loadLibrary("JNITest");
    public void nativeCallBack() {
    System.out.println("JNITest CallBack " + counter++);
    public void run() {
    nativeInitialize(this);
    counter = 0;
    while(true)
    try {
    Thread.sleep(1000);
    } catch(Exception e) {
    public static void main(String[] args) {
    JNITest jnitest = new JNITest();
    jnitest.run();
    // JNITest.cpp : Defines the entry point for the DLL application.
    #include "stdafx.h"
    #include "JNITest.h"
    static DWORD dwThreadId;
    static HANDLE hThread;
    static HANDLE volatile hInitCompleteEvent;
    static bool volatile bLoop = true;
    static JavaVM *jvm = NULL;
    static jobject nativeNotification;
    BOOL APIENTRY DllMain( HANDLE hModule,
    DWORD ul_reason_for_call,
    LPVOID lpReserved )
    return TRUE;
    bool DoNativeCall(JNIEnv *env)
    jclass cls = env->GetObjectClass(nativeNotification);
    jmethodID callbackMethod = env->GetMethodID(cls, "nativeCallBack", "()V");
    env->CallVoidMethod(nativeNotification, callbackMethod);
    if ( env->ExceptionOccurred() )
    env->ExceptionDescribe();
    env->ExceptionClear();
    printf("Native code got exception calling nativeCallBack\n");
    return(false);
    return(true);
    DWORD WINAPI JNIThread( LPVOID lpParam )
    JNIEnv *env = NULL;
    jvm->AttachCurrentThread((void**)&env,NULL);
    SetEvent(hInitCompleteEvent);
    while (bLoop)
    if (!DoNativeCall(env))
    bLoop = false;
    Sleep(1);
    env->DeleteGlobalRef(nativeNotification);
    jvm->DetachCurrentThread();
    return 0;
    * Class: JNITest
    * Method: nativeInitialize
    * Signature: ()V
    JNIEXPORT void JNICALL Java_JNITest_nativeInitialize(JNIEnv *env, jobject object, jobject _nativeNotification)
    DWORD dwThrdParam = 0;
    env->GetJavaVM(&jvm);
    nativeNotification = env->NewGlobalRef(_nativeNotification);
    hInitCompleteEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
    hThread = CreateThread( NULL, 0, JNIThread, &dwThrdParam, 0, &dwThreadId );
    if (hThread == NULL)
    env->DeleteGlobalRef(nativeNotification);
    return;
    WaitForSingleObject(hInitCompleteEvent, INFINITE);

    Hi,
    First of all, thank you for your time and interest.
    Let me first recapitulate the history of this problem :
    We have a C interface for controlling our HW boards. A few years ago, we wrote a java interface for one of our customers. This JNI wrapper was certified for the SUN JRE and has been used for several years now without a problem. There are several java and native callback functions in this wrapper and our development team took some design decisions (e.g. no DeleteLocalRef's, re-fetching the jclass and methodID in the callback functions, ...).
    Recently, one customer asked us to use this wrapper with the IBM JRE. At first, there seemed to be no porting issues. However, after running for a very long time, we had a stack overflow.
    Our customer reported this problem to IBM and finally, after sending a sample program (see my first post), IBM confirmed that there was a problem in their JVM. They provided a fix, but this fix only deleted local references which were created in a GetObjectClass call. After providing a few other fixes which did not provide a proper solution either, they suddenly changed their strategy and claimed that we have to delete all the local references which are created in a thread, otherwise we're not JNI compliant.
    However, when we look in the IBM JVM diagnostics guide (Chapter 6 : Understanding the Java Native Interface, see http://www-106.ibm.com/developerworks/java/jdk/diagnosis/), they provide the following code as a sample for loosing local references, resulting in the underlying object being garbage collected.
    jobject myJNIfunc1 ()
    return env->NewObject ();
    void myJNIfunc2 ()
    jobject obj;
    obj = myJNIfunc1 ();
    .. -> no local reference to obj exists, and the garbage collector can collect it
    Are we interpreting the IBM JVM diagnostics guide wrong or is there a problem in the IBM JVM ?
    The SUN JVM deletes the local references properly.

  • Business components mapped to EJB 2.0 local entity beans

    Hi ,
    I read about the new feature in JDev 903 that is "Creating business components mapped to EJB 2.0 local entity beans". but I am not able to find any documentation on it.can anyone provide me any link or help on this topic.
    Thanx,
    Prasoon

    Prasoon -
    For JDeveloper 10g, version 9.0.5.1, there is information on this topic located in the help:
    Building J2EE Applications >
    Working with the Business Tier >
    Developing Enterprise JavaBean Applications >
    Using Business Component Entity Facades
    Hope this helps,
    Lynn
    Java Tools Team

  • Accessing local reference

    I have the following beans defined:
    <session>
    <ejb-name>EngineControllerEJB</ejb-name>
    <home>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineControllerHome</home>
    <remote>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineController</remote>
    <ejb-class>com.mercury.topaz.security.authorization.engine.ejbs.controller.EngineControllerBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Bean</transaction-type>
    <local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
    <local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
    </session>
    <session>
    <ejb-name>TopazControllerEJB</ejb-name>
    <home>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazControllerHome</home>
    <remote>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazController</remote>
    <ejb-class>com.mercury.topaz.security.authorization.engine.spi.ejbs.TopazControllerBean</ejb-class>
    <session-type>Stateful</session-type>
    <transaction-type>Bean</transaction-type>
    <ejb-local-ref>
    <description></description>
    <ejb-ref-name>EngineControllerEJB</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
    <local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
    <ejb-link>EngineControllerEJB</ejb-link>
    </ejb-local-ref>
    </session>
    Obviously the first bean is bind with the name EngineControllerEJB. Now if I perform the lookup:
    ctx.lookup("EngineControllerEJB") it retrieves the RemoteHome. How do I get the Local Home?
    Thanks, Oren

    For the given EJB name "MyEJB", gain the remote home
    by 'ctx.lookup("MeEJB");' and the local by
    'ctx.lookup(java:comp/env/MyEjb");'Really the way that it is done is that by the spec everything ejb binded to JNDI needs the java:comp/env/ejb/ prefix. Maybe if you change it to this....
    <ejb-ref>
    <description></description>
    <ejb-ref-name>ejb/EngineControllerRemote</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</home>
    <remote>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</remote>
    <ejb-link>EngineControllerEJB</ejb-link>
    </ejb-ref>
    <ejb-local-ref>
    <description></description>
    <ejb-ref-name>ejb/EngineControllerLocal</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineControllerHome</local-home>
    <local>com.mercury.topaz.security.authorization.engine.ejbs.controller.LocalEngineController</local>
    <ejb-link>EngineControllerEJB</ejb-link>
    </ejb-local-ref>
    now you can have:
    ctx.lookup("java:comp/env/ejb/EngineControllerLocal") and
    ctx.lookup("java:comp/env/ejb/EngineControllerRemote")

  • Local references for the last time..:-)

    I'm getting NUTS with this...please is it possible determine in Visual C++ which local references in JNI are not deleted????

    You have given me no solution understandable to a non geek. I will just go to Internet explorer and try my luck.

  • Why can't local references be cached ?

    Hi,
    I read that the local references created during the lifetime of a native method cannot be cached and used in another lifetime of the native method. I don't understand why they can't be cached. I know that the VM creates a registry of local references, which is deleted once the lifetime of a native method is over, thereby allowing the objects referred by those local references be eligible for garbage collection. But then if a local reference is cached to some global/static variable, then the object referenced cannot be GCed. Hence we should be able to use that cached reference in a later execution of the native method too. i.e., Even though the local reference of the eariler exceution was freed, since we have cached its value (which I assume is a sort of pointer to the actual object), we should be able to use the cached reference. If not, can anyone please explain why this does not work like that ?
    Thanks.

    I don't want global reference. But I just wanted to understand why local references can't be cached. Though I had read what all you said above, before posting my question, the answer somehow occurred to me while I was reading your reply. So, thanks.
    I think the cruical point here is that, the JVM is not aware of the copies of the local references. It does not know and care how many copies of local references we (JNI programmers) make at the JNI level.

  • Local references...some questions...

    Hi All,
    1)
    i have a native method, which i'm calling frequentely. In this method i return one object to Java language....Weird is, if i put -verbose:jni parameter to JVM ....then i receive a lot of allerts ... that a local references count has stepped over the maximum limit 16....
    According to this, i put a env->EnsureLocalCapacity(1) call
    before
    return env->NewObject(.....) statement
    and problem wen't away....But i don't understand this, i assumed that JVM release any local references returned to Java....?????
    2) Is this code correct???
    env->EnsureLocalCapacity(1);
    env->PushLocalFrame(1);
    jobject obj = env->NewObject(....) // no local references are created here..
    obj = env->PopLocalFrame(obj);
    return obj;
    Thanks ....

    efrizzell --
    The use of local base calendars in a Project Server environment is strictly the decision of each organization.  There are certainly valid reasons for permitting them, such as when PMs need to be able to create their own custom local base calendars.
     There are also valid reasons for denying their use, so that every project must be scheduled using a valid and tested base calendar created by the Project Server administrator.
    Several years ago, I worked with an organization that initially forbid the use of local base calendars.  Because of this, the Project Server administrator was hit with dozens of requests for custom enterprise base calendars.  He found the process
    of creating and maintaining enterprise base calendars to be so much work that he gave up trying to control it, and enabled the permission to allow PMs to create their own local base calendars.
    If your organization allows the use of local base calendars, the base calendar will be stored in the project in which it was created.  Hope this helps.
    Dale A. Howard [MVP]

  • Returning local references from an EJB

    Hi,
    Is it possible to return a local object reference (of bean X) from the business method of another entity bean(Y)?
    Thanks in advance,
    Albert.

    Hey Nikola,
    Thanks for the reply.
    That is what looked so obvious to me too. My EJB is only using the local interfaces. Actually, here i am trying to use bean managed relationships. The EJB just doesn't seem to be getting deployed. Whenever i change all the references type of the specific local object to "Object" class, deployment goes thru successfully. My problem is compounded by the fact that oracle doesn't even give out any sensible error message. So i was wondering whether returning of the reference is allowed.
    Thanks,
    Albert.

  • EJB 3.0 local lookup from POJO in WLS Cluster

    Hello,
    I'm developing on JDeveloper Studio Edition Version 11.1.2.3.0 and deploying to a WebLogic 10.3.5 Cluster.
    I have developed an EJB 3.0 stateless session bean and I need to invoke it from a POJO within the same EAR, specifically an ADF EntityImpl Class.
    Up to this point, I've only invoked EJBs using injection via an @EJB annotation, and have never done a full lookup.
    Could somebody please provide a verbose instruction on how to obtain invoke an EJB 3.0 SLSB via local interface from a POJO when running on a WLS cluster?
    As I see it I have two problems to solve.
    1) Obtaining a reference to the initial context in a cluster.
    2) Using that to get a reference to the local interface of the bean, which I don't think is on the global JNDI tree.
    Many thanks.
    Edited by: user576183 on Dec 5, 2012 4:16 PM

    Re: Unable to lookup in InitialContext a Local EJB in Weblogic 10.3.5 (EJB 3.0)

  • 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

  • EJB 2.0 Local Objects

    Can I use local objects from a client residing in the same machine?

    I think not. That's because a client, even if it is running on the same machine, will not run on the same VM. So there's no way a client can obtain a valid reference to a LocalObject.
    LocalObject can be accessed only on the same server i.e. : web clients and other beans.

Maybe you are looking for

  • Flat File to Flat File

    Hi, I am doing an interface (Flat file to Flat file) The input file fields are separated by delimiter @!.Which will have multiple records like LEVEL1,LEVEL2,LEVEL3 Input Flat file Level1@!PoNo@!ShortText@!StDate@!EndDt@!Vendor@!Status Level2@!PoNo@!L

  • How do I clear (reset) keyframe points in Final Cut Pro?

    I know there is a quick and single click to clear (reset to none) all keyframe points in the viewer window (motion tab). I just can't figure it out. I have to right click each and every keyframe point and click delete. But there is a way to wipe out

  • [[11g] many XMLSCHEMA for a given binary XML table

    Hi, --1----------------------------------- I cannot create a table associated with several xmlschemas. create table "VALIDATE_XML_SCHEMA" of XMLTYPE XMLTYPE STORE AS BASICFILE BINARY XML XMLSCHEMAS (XMLSCHEMA "http://www.binary.com/root.xsd" ELEMENT

  • Item Categories Display in Contract

    Dear All, In my contracts 1) In the development I am able to see the item categories ( through F4) assigned to that contract Type (No Restriction). 2) While in Production I am not able to view any Item categories ( through f4) unless I enter material

  • Can you Make Dynamic Email Content by Open Time?

    Not by send time, but dynamic content by open time? For text in a email. Is there javascript that can do this? Thank you