Discussions

EJB programming & troubleshooting: Locale ref in pramati server

  1. Locale ref in pramati server (3 messages)

    I am unable to get the local ref for an stateless session bean in pramati server 3.0, both the EJB and jsp are in the same ear file. (Remote works fine)

    <BODY>
    Welcome to test.jsp
    <%
       try {
            javax.naming.Context context = new javax.naming.InitialContext();
    MySubLocalHome localhome = (MySubLocalHome)context.lookup("TEST");
    MySubLocal local = (MySubLocal)localhome.create();
    out.println("Age:"+local.getAge());
    } catch (Exception e) {e.printStackTrace();}
    %>
    </BODY>

    I have add in web.xml also... the file has the following entry
    <ejb-local-ref>
        <description />
        <ejb-ref-name>TEST</ejb-ref-name>
        <ejb-ref-type>Session</ejb-ref-type>
        <local-home>com.cgm.pcorecfs.enterprise.business.session.MySubLocalHome</local-home>
    <local>com.cgm.pcorecfs.enterprise.business.session.MySubLocal</local>
    </ejb-local-ref>

    but the container throws the following exception
    java.lang.ClassCastException

    has any one tried this... (am i doing something wrong)

    Threaded Messages (3)

  2. Locale ref in pramati server[ Go to top ]

    Are you using a different JNDI name for the local and remote interface?
  3. Locale ref in pramati server[ Go to top ]

    No... I am not using different JNDI Name, i have same name
  4. Locale ref in pramati server[ Go to top ]

    That's the problem. You can't bind two different objects to the same JNDI name. You must give the Local and Remote interfaces different JNDI names.