Ejb3 help needed( ejb-local-ref      )

hi
I have developed one enterprise application.In client refers the session bean in turn session bean refers the entity bean.
But the problem is when i run that application i am not getting desired output.I ahve used JNDI look up to refer the bean.
i am using netbeansIDE5.5 and sun's application server
i think my web.xml ( )is not correcct.
content of web.xml (partly)
<ejb-local-ref>
<ejb-ref-name>TaskSessionLocal</ejb-ref-name>
<ejb-ref-type>Session</ejb-ref-type>
<local-home/>
<local>TaskEjb.TaskSessionLocal</local>
<ejb-link>TaskSession</ejb-link>
</ejb-local-ref>
can anybody please tell me what all these signifies(<ejb-local-ref> and all)
regards
shruthi

If you're referring to an EJB 3.0 Local Business interface using an ejb-local-ref do not
include the <local-home> element. Here's a full description of the meaning of each
element from our EJB FAQ :
https://glassfish.dev.java.net/javaee5/ejb/EJB_FAQ.html#EJB_ejb-ref_ejb_local_ref

Similar Messages

  • Cant resolve ejb-local-ref

    Hi!
    Im a novice at this environment so I have been running the EJB Tutorial provided
    with 8.1
    Everything works as i should until I deploy the application.
    I get a:
    weblogic.management.DeploymentException: Could not setup environment - with nest
    ed exception:
    [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'Ban
    dsExampleEJB.jar#Music' declared in the ejb-ref or ejb-local-ref 'ejb/MusicLink'
    in the application module 'webapp' could not be resolved. The target EJB for
    th
    e ejb-ref could not be found. Please ensure the link is correct.]
    The code for the ejb-local-ref is as folows:
    <ejb-local-ref>
    <ejb-ref-name>ejb/MusicLink</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
    <local>examples.ejb20.relationships.bands.Music</local>
    <ejb-link>BandsExampleEJB.jar#Music</ejb-link>
    </ejb-local-ref>
    What can I be doing wrong?
    /Peter

    Gunnar,
    There are a few mistakes in the tutorial that will
    be fixed for the upcoming SP2 release. As far as the tutorial code
    itself goes I've reproduced this problem by following the tutorial
    exactly as its stated and there's a couple of things that can be
    what's causing all the problems for you and others.
    The easiest solution is to use the supplied MusicBean source that's
    supplied with the tutorial. That bean code is correct and functional.
    The tutorial is missing some of the steps required to reproduce that
    exact bean code.
    I'll cover all the errors I found. One of these is quite possibly what's
    tripping you and others up.
    1) The getBands() and addBand() method should be made to be local
    methods instead of remote methods.
    So in step 4 after you've created these methods change the interface
    exposure
    to be local either directly in the source by changing the tag, or in the
    design view
    by right clicking the method and selecting "local". This will show the
    methods
    with a yellow diamond next to them in the design view.
    You also need to enable local interfaces as well as update the local
    interface and local home interface.
    To do this:
    1) switch to the design view
    2) click on the EJB
    3) find the "naming" node in the property editor and uncheck "Remote EJB"
    4) check the "Local EJB" checkbox which will then enable the fields for
    the local and local home interfaces
    5) enter the value of local interface to be: "Music"
    6) enter the value of local home interface to be: "MusicHome"
    2) The setup datasource step is incorrect in the tutorial.
    The entity beans that are imported use a datasource called
    "examples-dataSource-demoPool".
    This datasource doesn't exist in the default workshop domain so in this step
    the user
    is to create the missing datasource. So going to the datasource viewer and
    choosing "add datasource"
    and pasting in the above name will create the datasource that's needed for
    the entity beans.
    3) In the source code listing for MusicBean there's missing imports for:
    javax.naming.InitialContext
    javax.naming.NamingException
    4) the ejb-local-ref XML has one problem, possibly two:
    1) The case is incorrect for the EJB ref name. The tutorial has it as:
    ejb/MusicLink
    but addBand.jsp refers to it as ejb/musicLink. So either change the
    jsp file or the ejb-ref-name so
    that the two match.
    2) The placement of the <ejb-local-ref> XML may be in the wrong spot.
    This element must
    appear at the bottom of web.xml. i.e.
    <webapp>
    <ejb-local-ref>
    <ejb-ref-name>ejb/musicLink</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
    <local>examples.ejb20.relationships.bands.Music</local>
    <ejb-link>BandsExampleEJB.jar#Music</ejb-link>
    </ejb-local-ref>
    </web-app>
    5) and finally ensure that your application's build order is correct. Make
    sure that the EJB
    project builds before the web project.
    This can be verified by selecting the menu "tools->application properties"
    and then
    clicking on the "build" node to get the build order.
    All of these mistakes will be fixed for the SP02 release. Hopefully one of
    these solutions fixes
    the problems you're experiencing.
    -Michael
    "Gunnar Skogen" <[email protected]> wrote in message
    news:[email protected]...
    >
    This thread :
    Suggestions on newbie tutorials for Workshop and Weblogic 8.1
    Date: 8 Aug 2003 15:06:55 -0700
    From: "Morgan" <[email protected]>
    Organization: BEA NEWS SITE
    Newsgroup: weblogic.developer.interest.workshop
    Describes the same problem, no solution - so:
    1) When will the tutorial(s)/ and or workshop be fixed ?
    2) Could we get a fix for this particular problem ? ( I tried more than Iwant
    to admit )
    "Gunnar Skogen" <[email protected]> wrote:
    Hi,
    (chiming in because:)
    I have exactly the same problem with the same app:
    This is following the tutorial for 8.1 :"Tutorial EJB project, Part one"
    to the
    letter and running the build.
    The link names etc are correct, however, nothing is/has been deployed
    according
    to console..
    NB: Following the tutorial the MusicBean is set up as a remote bean
    (default
    in
    workshop?) - have tried going the local way also without any success.
    It appears
    the tutorial itself is faulty(?) ( it also shows the dialog for importing
    a webapp
    when it most probably means to create an empty one )
    Michael Kovacs <[email protected]> wrote:
    Hi Peter,
    A couple of things...
    Ensure that your EJBs are deployed to the server properly. It
    seems from your error that they might very well already be
    deployed successfully, but that's just a guess. To verify this you
    can have a look at the WebLogic admin console and see that your
    beans have been deployed to the server by looking at your
    application.
    Assuming your beans are deployed....
    Ensure that the reference to the EJB ref is using the exact
    name of the ejb-ref-name. The name is case sensitive.
    So when you do your lookup of the bean in your JSP
    ensure that the "ejb/MusicLink" from the <ejb-ref-name>
    matches exactly. i.e.
    Object obj = ctx.lookup("java:comp/env/ejb/MusicLink");
    Also, make sure that the <ejb-link> is correct.
    The format for the link name is:
    EJBprojectname.jar#EJBName
    So for your example, make sure that "BandsExampleEJB"
    is the name of your EJB project or correct that value in the
    link name, and that your Bean's EJB name is "Music".
    Let me know if this helps.
    -Michael
    Peter Hegedüs wrote:
    Hi!
    Im a novice at this environment so I have been running the EJB
    Tutorial
    provided
    with 8.1
    Everything works as i should until I deploy the application.
    I get a:
    weblogic.management.DeploymentException: Could not setup environment- with nest
    ed exception:
    [weblogic.deployment.EnvironmentException: [J2EE:160101]Error: Theejb-link 'Ban
    dsExampleEJB.jar#Music' declared in the ejb-ref or ejb-local-ref
    'ejb/MusicLink'
    in the application module 'webapp' could not be resolved. The targetEJB for
    th
    e ejb-ref could not be found. Please ensure the link is correct.]
    The code for the ejb-local-ref is as folows:
    <ejb-local-ref>
    <ejb-ref-name>ejb/MusicLink</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local-home>examples.ejb20.relationships.bands.MusicHome</local-home>
    <local>examples.ejb20.relationships.bands.Music</local>
    <ejb-link>BandsExampleEJB.jar#Music</ejb-link>
    </ejb-local-ref>
    What can I be doing wrong?
    /Peter

  • ejb-local-ref where to put this tag in ejb-jar.xml ??

    I have an ejb-jar.xml that looks like this. I have had no problem with remote interfaces. Now I want the bean to have a local interface too.
    Just let me know where the tag I have mentioned for the <ejb-local-ref> has to be put into.
    When I compile this file it throws me an error which i have shown below the output of the ejb-jar.xml file
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>IDMaster</ejb-name>
    <home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
    <remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    <ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>IDMaster</abstract-schema-name>
    <cmp-field>
    <field-name>idPrefix</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>idValue</field-name>
    </cmp-field>
    <primkey-field>idPrefix</primkey-field>
    <query>
         <query-method>
              <method-name>findAllIDMasters</method-name>
              <method-params/>
         </query-method>
         <ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>IDMaster</ejb-name>
         <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>
    I have also added the following tag in the weblogic-jar.xml
    <local-jndi-name>IDMasterEJB.IDMasterLocalHome</local-jndi-name>
    Just let me know whether I am correct
    On compilation (using ant utility) the error thrown is like this :
    ejbc:
    [java] ERROR: Error parsing 'ejb-jar.xml' line 47: The content of element type "entity" must ma
    tch "(description?,display-name?,small-icon?,large-icon?,ejb-name,home?,remote?,local-home?,local?,e
    jb-class,persistence-type,prim-key-class,reentrant,cmp-version?,abstract-schema-name?,cmp-field*,pri
    mkey-field?,env-entry*,ejb-ref*,ejb-local-ref*,security-role-ref*,security-identity?,resource-ref*,r
    esource-env-ref*,query*)".
    [java] ERROR: ejbc found errors
    [java] Java Result: 1
    Kindly Help !!!
    Thanks n regards
    Sajiv

    This should take care of it
    <ejb-jar>
    <enterprise-beans>
    <entity>
    <ejb-name>IDMaster</ejb-name>
    <home>maxateev.mondial.brg.idmaster.IDMasterHome</home>
    <remote>maxateev.mondial.brg.idmaster.IDMaster</remote>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    <ejb-class>maxateev.mondial.brg.idmaster.IDMasterEJB</ejb-class>
    <persistence-type>Container</persistence-type>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <prim-key-class>java.lang.String</prim-key-class>
    <reentrant>False</reentrant>
    <cmp-version>2.x</cmp-version>
    <abstract-schema-name>IDMaster</abstract-schema-name>
    <cmp-field>
    <field-name>idPrefix</field-name>
    </cmp-field>
    <cmp-field>
    <field-name>idValue</field-name>
    </cmp-field>
    <primkey-field>idPrefix</primkey-field>
    <ejb-local-ref>
    <ejb-ref-name>ejb/IDMasterLocalHome</ejb-ref-name>
    <ejb-ref-type>Entity</ejb-ref-type>
    <local-home>maxateev.mondial.brg.idmaster.IDMasterLocalHome</local-home>
    <local>maxateev.mondial.brg.idmaster.IDMasterLocal</local>
    </ejb-local-ref>
    <query>
    <query-method>
    <method-name>findAllIDMasters</method-name>
    <method-params/>
    </query-method>
    <ejb-ql><![CDATA[SELECT OBJECT (f) FROM IDMaster as f]]></ejb-ql>
    </query>
    </entity>
    </enterprise-beans>
    <assembly-descriptor>
    <container-transaction>
    <method>
    <ejb-name>IDMaster</ejb-name>
    <method-name>*</method-name>
    </method>
    <trans-attribute>Required</trans-attribute>
    </container-transaction>
    </assembly-descriptor>
    </ejb-jar>

  • ejb-local-ref usage

    Hi
    Can someone explain me exact use of this <ejb-local-ref>
    tag. I have seen ejb running without this config also and most of the professionally written ejb have this. When should this be used and why.
    Also i see <ejb-link> tag being used. I beleive if want to reference another ejb in another jar of the same ear, this should be used. I would appreciate if someone can explain me these 2 things.
    Thanks

    Can someone explain me exact use of this
    <ejb-local-ref>
    tag. I have seen ejb running without this config also
    and most of the professionally written ejb have this.
    When should this be used and why.ejb-ref is a way of getting reference to another ejb from within the bean code in one ejb. It provides a way to link ejbs based on ejb names rather than jndi-names.
    you can also refer to another ejb using the jndi name of the target ejb by looking it up from the global jndi tree. However, this is not a clean way, bcos the jndi name is the deployer's responsibility and could change. If you hook different ejbs using the jndi-names it could be quite inflexible and also you may not be able to take advantage of the container's colocation optimizations.
    To link ejbs within the same J2ee application in a flexible way and to take advantage of the container's optimizations, you can use ejb-refs and ejb-links.
    hope this helps,
    Mihir
    Also i see <ejb-link> tag being used. I beleive if
    want to reference another ejb in another jar of the
    same ear, this should be used. I would appreciate if
    someone can explain me these 2 things.
    Thanks

  • Ejb-ref and ejb-local-ref tags

    Hi everyone,
    Can someone please tell me
    1) Is it necessary for me to define ejb-ref or ejb-local-ref tags if I am referering one ejb from other ejb? I mean to say is it mandatory that I should have these deployment descriptor tags?
    2) What is purpose of ejb-link tag ?

    Hi everyone,
    Can someone please tell me
    1) Is it necessary for me to define ejb-ref or
    ejb-local-ref tags if I am referering one ejb from
    other ejb? I mean to say is it mandatory that I should
    have these deployment descriptor tags?Yes, to write portable J2EE components, every time you have a dependency on an ejb, you need to declare an ejb-ref (for a Remote EJB client) or ejb-local-ref (for a Local EJB client). This is true no matter what kind of J2EE component is accessing the ejb (Application Client, JSP, Servlet, or another ejb).
    Think of the ejb-ref or ejb-local-ref as a pointer. It's different from the thing that is pointed to. Instead, it represents a dependency between a client component and a target ejb.
    2) What is purpose of ejb-link tag ?Every ejb-ref or ejb-local-ref must be resolved to unambiguously point to the target ejb. The ejb-link tag is one way to resolve this dependency for the case where the target ejb lives in the same .ear as the referring component. The ejb-link tag is the ejb-name (or <ejb-jar uri>#<ejb-name>) of the target ejb.
    Note that this means ejb-link is the ONLY way to resolve an ejb-local-ref, since by definition Local EJB access can only take place between two ejbs within the same .ear or a web component/ejb that live within the same .ear.
    For ejb-refs, you can use ejb-link if the target ejb is within the same .ear. If not, the ejb specification does not prescribe how the dependency is resolved. It's left up to the J2EE implementation. The most common approach is for the vendor to provide a product-specific runtime .xml element that resolves the ejb-ref by associating it with the global JNDI name of the target EJB. That's the approach used in the J2EE SDK and Sun Java System Application Server.
    Kenneth Saks
    J2EE SDK Team
    SUN Microsystems

  • Ejb-local-refs not showing up in webapp

    I have an EAR that has a WAR and an EJBJAR inside (nothing new here). I have my
    WAR reference several local ejbs from the EJBJAR. All of my local-ejb-ref entries
    in web.xml are not appearing in the console.
    Are there any restrictions on this?
    Thanks

    Local refs in web.xml is supported in 70 (servlet 2.3) and up, I suppose.
    Chris Bono wrote:
    I have an EAR that has a WAR and an EJBJAR inside (nothing new here). I have my
    WAR reference several local ejbs from the EJBJAR. All of my local-ejb-ref entries
    in web.xml are not appearing in the console.
    Are there any restrictions on this?
    Thanks--
    Rajesh Mirchandani
    Developer Relations Engineer
    BEA Support

  • Help Needed: Enable local currency for Customer Invoicing

    We are needing to enable local currency for customer invoicing on a project coming very soon.  Does anyone have any information on the best way to get this done and/or documentation to look over?  Any help would be greatly appreciated!!
    Thank You in Advance!
    Jay Esparza
    SAP Functional Consultant

    Hi
    Local currency automatically gets activated as you set your company code currency.
    No need to enable separately for customer invoicing
    Plz assign points if it is helpful.
    Regards
    Tapan

  • Help needed please, Local - Remote mySQL transition

    Hi all,
    Ok here is my problem.
    I have wamp installed on my local system and have created a database in mySQL. I use this connection in my Dreamweaver cs3 site.
    I have just requested a mysql database from my hosting company and they have given me a sql address e.g sql34.hostdomain.net, a username and password.
    My problem is I know how to connect to this through dreamweaver, but how do I transfer my local database to my remote mysql server?

    learner2site wrote:
    My problem is I know how to connect to this through dreamweaver, but how do I transfer my local database to my remote mysql server?
    You export it and then import it on the server. It's all in the phpMyAdmin start page... If you have no direct access to the admin UI, check for a respective PHP script that contains the necessary SQL queries.
    Mylenium

  • Help needed - javax.naming.NameNotFoundException:

    Hi,
    I am writing a stateless local session bean that is invoked within an EJB,
    it deploys fine,
    console
    16:52:58,719 INFO [EjbModule] Deploying LocalRuleEngine
    but when I run it I get NameNotFoundException,
    javax.naming.NameNotFoundException: LocalRuleEngine not bound
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:491)
    at org.jnp.server.NamingServer.getBinding(NamingServer.java:499)
    at org.jnp.server.NamingServer.getObject(NamingServer.java:505)
    at org.jnp.server.NamingServer.lookup(NamingServer.java:278)
    at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
    this is mapping files,
    jboss.xml,
    <?xml version="1.0"?>
    <jboss>
        <enterprise-beans>
            <message-driven>
                <ejb-name>DistributionManager</ejb-name>
                <destination-jndi-name>queue/dr</destination-jndi-name>
                <resource-ref>
                    <res-ref-name>jms/QCF</res-ref-name>
                    <jndi-name>ConnectionFactory</jndi-name>
                </resource-ref>
            </message-driven>
              <session>
                   <ejb-name>LocalRuleEngine</ejb-name>
                   <jndi-name>ejb/LocalRuleEngine</jndi-name>
              </session>
        </enterprise-beans>
    </jboss>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>
      <enterprise-beans>
         <message-driven>
               <ejb-name>DistributionManager</ejb-name>
               <ejb-class>com.test.DataDistributionManager</ejb-class>
               <transaction-type>Container</transaction-type>
               <acknowledge-mode>AUTO_ACKNOWLEDGE</acknowledge-mode>
               <message-driven-destination>
                 <destination-type>javax.jms.Queue</destination-type>
               </message-driven-destination>
                <ejb-local-ref>
                     <ejb-ref-name>ejb/LocalRuleEngine</ejb-ref-name>
                  <ejb-ref-type>Session</ejb-ref-type>
                  <local-home>com.test.LocalRuleEngineHome</local-home>
                  <local>com.test.LocalRuleEngine</local>
                  <ejb-link>LocalRuleEngine</ejb-link>
                 </ejb-local-ref>
               <resource-ref>
                 <res-ref-name>jms/QCF</res-ref-name>
                 <res-type>javax.jms.QueueConnectionFactory</res-type>
                 <res-auth>Container</res-auth>
               </resource-ref>
        </message-driven>
        <session>
                  <ejb-name>LocalRuleEngine</ejb-name>
                   <local-home>com.test.LocalRuleEngineHome</local-home>
                  <local>com.test.LocalRuleEngine</local>
                  <ejb-class>com.test.RuleEngineBean</ejb-class>
                  <session-type>Stateless</session-type>
                  <transaction-type>Container</transaction-type>
        </session>
      </enterprise-beans>
    </ejb-jar>this is my local home interface
    package com.test;
    import javax.ejb.CreateException;
    import javax.ejb.EJBLocalHome;
    public interface LocalRuleEngineHome extends EJBLocalHome{
         public LocalRuleEngine create() throws CreateException;
    }this is my local interface
    package com.test;
    import java.util.List;
    import javax.ejb.EJBLocalObject;
    import com.raytheon.jetts.domain.DomainClass;
    import com.raytheon.jetts.domain.DomainKey;
    public interface LocalRuleEngine extends EJBLocalObject {
         public List findMatchingRules(DomainClass itemToDistribute);
         public List createRules(DomainKey domainKey, List<Address> addresses);
         public ImAdapter getImAdapter();
         public void setImAdapter(ImAdapter imAdapter);
         public List getAddressesFromRules(List<DistributionRule> distributionRules);
         public void addRule(DistributionRule distributionRule);
         public void removeRule(DomainKey domainKey);
         public String testReturn();
    }this is my bean,
    package com.test;
    import java.rmi.RemoteException;
    import java.util.List;
    import javax.ejb.CreateException;
    import javax.ejb.EJBException;
    import javax.ejb.EJBLocalHome;
    import javax.ejb.EJBLocalObject;
    import javax.ejb.RemoveException;
    import javax.ejb.SessionBean;
    import javax.ejb.SessionContext;
    import org.apache.commons.logging.Log;
    import org.apache.commons.logging.LogFactory;
    import com.raytheon.jetts.domain.DomainClass;
    import com.raytheon.jetts.domain.DomainKey;
    public class RuleEngineBean implements SessionBean, LocalRuleEngine{
         private static Log log = LogFactory.getLog(DataDistributionManager.class);
         private LocalRuleEngine engine;
         private LocalRuleEngineHome localHome;
         public RuleEngineBean(){}
         public List findMatchingRules(DomainClass itemToDistribute){
              List list = null;
              return list;
         public String testReturn(){
              return new String("is home time");
         public List createRules(DomainKey domainKey, List<Address> addresses){
              List list = null;
              return list;
         public ImAdapter getImAdapter(){
              ImAdapter imAdapter = null;
              return imAdapter;
         public void setImAdapter(ImAdapter imAdapter){
         public List getAddressesFromRules(List<DistributionRule> distributionRules){
              List list = null;
              return list;
         public void addRule(DistributionRule distributionRule){
         public void removeRule(DomainKey domainKey){
         public void ejbCreate(String info){}
         public void setSessionContext(SessionContext context){}
         public void remove(){}
         public void ejbActivate(){}
         public void ejbPassivate(){}
         public void ejbRemove(){}
         public void ejbCreate(){}
         public boolean isIdentical(EJBLocalObject obj)throws EJBException{
              return true;
         public EJBLocalHome getEJBLocalHome(){
              return localHome;
         public Object getPrimaryKey()throws EJBException{
              return new Object();
    }Thanks for any help on this,
    Jp.

    sorry about that,
    I'm doing this,
    InitialContext ctx = new InitialContext();
                  LocalRuleEngineHome localRuleEngineHome  = (LocalRuleEngineHome)ctx.lookup("ejb/LocalRuleEngine");
                 //localRuleEngineHome = (LocalRuleEngineHome)PortableRemoteObject.narrow(objref,  LocalRuleEngineHome.class);
                 LocalRuleEngine lre = localRuleEngineHome.create();
                 log.info(lre.testReturn());

  • Creating a simple java client for a session EJB local interface

    Hi all
    Is it possible to create a simple java client for a session ejb local interface with JDeveloper.
    The problem is that it creates a test client for a remote interface only...
    i.e.
    MySessionEJB sessionEJB = context.lookup("MySessionEJB")
    and once i try to adjust it manually for the local interface...
    MySessionEJBLocal sessionEJB = (MySessionEJBLocal) context.lookup("MySessionEJBLocal") (MySessionEJBLocal - is the name of my local interface)
    it generates the exception:
    javax.naming.NotFoundException: SessionEJBLocal not found
    at...........................(RMIClientContext.java:52)
    There is still no problem with accessing the local interface object from the jsf project where i've added <ejb-local-ref> tag into the web.xml file.
    but i need the possibility of testing the simple java client for the local interface to test business methods wich should return objects without indirect properties
    Thanks in advance.
    Alex.

    Pedja thanks for reply.
    I still dont understand what is wrong with my example.
    The first peace of the code i wrote (getting the reference to the remote interface object) works pretty well, and even more it is produced automatically by JDeveloper, so why we cant get a reference to the local interface object the same way?
    Certanly we should use the local interface for getting access to the resource functioning under the same local jvm and i think it doesnt metter wich app server we really use wls or oas or others
    Thanks. Alex.

  • Unable to lookup ejb local home interface after moving to wls 7.0

    I'm getting an exception trying to lookup an ejb's local home interface
    which I believe was deployed correctly. On startup I get the message:
    EJB Deployed EJB with JNDI name
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome.
    However, when I try to do a lookup using this jndi name, I get the
    following exception:
    javax.naming.LinkException: . Root exception is
    javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/local-home'
    Resolved: 'app/ejb'
    Unresolved:'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb'
    ; remaining name
    'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/local-home'
    The name it can't resolve is different than the name I was trying to
    look up. I can see
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome
    in the jndi tree through the admin console, but the attributes Object
    Class, Object Hash Code, and Object To String are blank.
    This worked with weblogic 6.1 sp3. Is there something I missed in the
    migration to 7.0?
    Any help would be appreciated. Thanks in advance,
    -Brad

    That explains it - in 7.0 (unlike 6.1 - then the only factor was
    classloaders arrangement) client has to be
    in the same application (ear) - note JNDI links used to be able to lookup
    local homes.
    "Brad Geddes" <[email protected]> wrote in message
    news:[email protected]...
    I'm looking it up from a web application. I did notice a message on thistopic
    from last thursday (subject: "Pls Help! Failed to access local Sessionbean in
    7.0!"). In it, the individual said he had to add ejb-local-ref elementsin the
    web.xml. I tried this but can't seem to get it to work.
    javax.naming.NameNotFoundException: Unable to resolve ejb-link.
    ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb isnot in
    the context. The context includes the following link bindings: {} Makesure the
    link reference is relative to the URI of the referencing module.
    Also, I don't have a war or ear in the environment I'm working in; theejb's are
    all deployed separately in jar files, and the web app is in explodedformat.
    >
    -Brad
    "Dimitri I. Rakitine" wrote:
    Are you looking up the local home from outside of an application ?
    "Brad Geddes" <[email protected]> wrote in message
    news:[email protected]...
    I'm getting an exception trying to lookup an ejb's local home
    interface
    which I believe was deployed correctly. On startup I get the message:
    EJB Deployed EJB with JNDI name
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome.
    >>>
    However, when I try to do a lookup using this jndi name, I get the
    following exception:
    javax.naming.LinkException: . Root exception is
    javax.naming.NameNotFoundException: Unable to resolve
    'app/ejb/ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificf
    veb/local-home'
    Resolved: 'app/ejb'
    Unresolved:'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecif
    icfveb'
    ; remaining name
    'ShipperSpecificFVDO.jar#com.logistics.basedata.ejb.shipperspecificfveb/loca
    l-home'
    The name it can't resolve is different than the name I was trying to
    look up. I can see
    com.logistics.basedata.ejb.shipperspecificfveb.ShipperSpecificFVDOLocalHome
    in the jndi tree through the admin console, but the attributes Object
    Class, Object Hash Code, and Object To String are blank.
    This worked with weblogic 6.1 sp3. Is there something I missed in the
    migration to 7.0?
    Any help would be appreciated. Thanks in advance,
    -Brad
    Dimitri--
    Dimitri

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

  • Using EJB Local Interface problem

    Hi to all
    I have got a problem in using Local EJB Interface in Weblogic , please attention to my description
    I use JDeveloper as IDE
    At first I create an Application in JDeveloper that has two projects that their names are Model and ViewContorller that first one contains my EJB and another contains my JSP page respectively
    The EJB code is :
    @Stateless(name="AliEJB001Bean")
    @Remote
    @Local
    public class AliEJB001Bean implements AliEJB001, AliEJB001Local {
    public AliEJB001Bean() {
    public String Hi(){
    return "Hi000";
    And its Local Interface code is :
    @Local
    public interface AliEJB001Local {
    String Hi();
    I deploy Model project to an EJB Jar file that its name is AliEE1ejb1.jar
    and I deploy the ViewContorller project to a WAR file that its name is AliEE1WebApp.war
    Now I add this tags to web.xml
    <ejb-local-ref>
    <ejb-ref-name>ali/testejb</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>model.AliEJB001Local</local>
    </ejb-local-ref>
    Then I deploy the Application to an EAR file by name AliEE1
    After those I run my JSP page witch calls the EJB in JDeveloper (through Local EJB Interface) , JDeveloper deploy my Application to the ItegratedWeblogicServer
    Ultimately the JSP can calls the EJB through Local Interface and use the Hi method and shows me the result but JDeveloper while compiles the application give me these Warnings :
    Warning: <May 15, 2011 9:02:52 AM PDT> <Error> <J2EE> <BEA-160187> <weblogic.appc failed to compile your application. Recompile with the -verbose option for more details. Please see the error message(s) below.>
    Warning: There are 1 nested errors:
    Warning: weblogic.servlet.internal.dd.compliance.ComplianceException: Element "<ejb-local-ref>" with ejb-ref-name "ali/testejb" must either specify a valid ejb-link element or have a corresponding ejb-reference-descriptor element in weblogic.xml with a valid jndi-name.
    Warning:      at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:74)
    Warning:      at weblogic.servlet.internal.dd.compliance.BaseComplianceChecker.addDescriptorError(BaseComplianceChecker.java:80)
    Warning:      at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.validate(EJBRefsComplianceChecker.java:97)
    Warning:      at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.checkEJBLocalRef(EJBRefsComplianceChecker.java:47)
    Warning:      at weblogic.servlet.internal.dd.compliance.EJBRefsComplianceChecker.check(EJBRefsComplianceChecker.java:39)
    Warning:      at weblogic.servlet.internal.dd.compliance.ComplianceUtils.checkCompliance(ComplianceUtils.java:48)
    Warning:      at weblogic.servlet.jsp.JspcInvoker.checkCompliance(JspcInvoker.java:145)
    Warning:      at weblogic.servlet.jsp.JspcInvoker.compile(JspcInvoker.java:198)
    Warning:      at weblogic.application.compiler.AppcUtils.compileWAR(AppcUtils.java:376)
    Warning:      at weblogic.application.compiler.WARModule.compile(WARModule.java:245)
    Warning:      at weblogic.application.compiler.flow.SingleModuleCompileFlow.proecessModule(SingleModuleCompileFlow.java:18)
    Warning:      at weblogic.application.compiler.flow.SingleModuleFlow.compile(SingleModuleFlow.java:36)
    Warning:      at weblogic.application.compiler.FlowDriver$FlowStateChange.next(FlowDriver.java:69)
    Warning:      at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
    Warning:      at weblogic.application.compiler.FlowDriver.nextState(FlowDriver.java:36)
    Warning:      at weblogic.application.compiler.FlowDriver.run(FlowDriver.java:26)
    Warning:      at weblogic.application.compiler.WARCompiler.compile(WARCompiler.java:29)
    Warning:      at weblogic.application.compiler.flow.AppCompilerFlow.compileInput(AppCompilerFlow.java:112)
    Warning:      at weblogic.application.compiler.flow.AppCompilerFlow.compile(AppCompilerFlow.java:37)
    Warning:      at weblogic.application.compiler.Appc.runBody(Appc.java:198)
    Warning:      at weblogic.utils.compiler.Tool.run(Tool.java:158)
    Warning:      at weblogic.utils.compiler.Tool.run(Tool.java:115)
    Warning:      at weblogic.application.compiler.Appc.main(Appc.java:257)
    Warning:      at weblogic.appc.main(appc.java:14)
    According to the warning messages I wanna add <ejb-link> tag to the web.xml for resolving warnings I add the <ejb-link> like this:
    <ejb-local-ref>
    <ejb-ref-name>ali/testejb</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>model.AliEJB001Local</local>
    <ejb-link>AliEE1ejb1.jar#AliEJB001Bean </ejb-link>
    </ejb-local-ref>
    But when JDeveloper want deploy my application again it shows me this Error
    [09:29:59 AM] Redeploying Application...
    <May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149265> <Failure occurred in the execution of deployment request with ID '1305476999381' for task '7'. Error is: 'weblogic.application.ModuleException: Could not setup environment'
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    <May 15, 2011 9:29:59 AM PDT> <Error> <Deployer> <BEA-149202> <Encountered an exception while attempting to commit the 9 task for the application 'AliEE1'.>
    <May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149004> <Failures were detected while initiating deploy task for application 'AliEE1'.>
    <May 15, 2011 9:29:59 AM PDT> <Warning> <Deployer> <BEA-149078> <Stack trace for message 149004
    weblogic.application.ModuleException: Could not setup environment
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1499)
         at weblogic.servlet.internal.WebAppModule.activate(WebAppModule.java:442)
         at weblogic.application.internal.flow.ModuleStateDriver$2.next(ModuleStateDriver.java:375)
         at weblogic.application.utils.StateMachineDriver.nextState(StateMachineDriver.java:41)
         at weblogic.application.internal.flow.ModuleStateDriver.activate(ModuleStateDriver.java:95)
         Truncated. see log file for complete stacktrace
    Caused By: weblogic.deployment.EnvironmentException: [J2EE:160101]Error: The ejb-link 'AliEE1ejb1.jar#AliEJB001Bean' declared in the ejb-ref or ejb-local-ref 'ali/testejb' in the application module 'ViewControllerWebApp.war' could not be resolved. The target EJB for the ejb-ref could not be found. Please ensure the link is correct.
         at weblogic.deployment.BaseEnvironmentBuilder.addEJBLinkRef(BaseEnvironmentBuilder.java:464)
         at weblogic.deployment.EnvironmentBuilder.addEJBReferences(EnvironmentBuilder.java:485)
         at weblogic.servlet.internal.CompEnv.activate(CompEnv.java:157)
         at weblogic.servlet.internal.WebAppServletContext.activate(WebAppServletContext.java:3117)
         at weblogic.servlet.internal.WebAppModule.activateContexts(WebAppModule.java:1497)
         Truncated. see log file for complete stacktrace
    >
    [09:30:00 AM] #### Deployment incomplete. ####
    [09:30:00 AM] Remote deployment failed
    Do you know how I can solve this issue ?
    thanks

    Thank you so much
    I find out the solution
    I have to define my EJB in ejb-jar.xml like this
    <enterprise-beans>
         <session>
         <ejb-name>ReplicableSFSB2</ejb-name>
         <business-local>model2.AliEJB001Local</business-local>
         <business-remote>model2.AliEJB001</business-remote>
         <ejb-class>model2.AliEJB001Bean</ejb-class>
         <session-type>Stateless</session-type>
         </session>
    </enterprise-beans>
    And then I use the EJB name witch I defined in <ejb-name> tag in <ejb-link> tag of web.xml
    like this
    <ejb-local-ref>
    <ejb-ref-name>ali/testejb2</ejb-ref-name>
    <ejb-ref-type>Session</ejb-ref-type>
    <local>model2.AliEJB001Local</local>
    <ejb-link>Model2EJB.jar#ReplicableSFSB2</ejb-link>
    </ejb-local-ref>

  • Help needed in EJB

    Hi friends ,
    I need your help in EJB
    I have to perform these operations
    1) Calling an Appl Service from a EJB module.
    2) Calling an EJB module from an Appl Service.
    3) Basics of JNDI.
    for the second part I am exposing the EJB module as an Web Service and then consuming it in the Application Service as an External Service(that EJB has a Session Bean with a local Interface that has some logic to be exposed ).(Any further suggestions for this !!!!)
    1)But I still dont know how to call an Application Service from an EJB module .
    3)And finally I have an Application Service which would have a JNDI strings pointing to the Local EJB Interfaces and I have to access any one string from a Application Service and call that Local EJB Interface(local EJB invocation)
    So can anyone help me in these two areas
    Please keep in mind that I am relatively new to J2EE.
    Thanks in advance

    Hi,
    You need to change your application server specific
    deployment descriptors.
    If your ejb uses container-managed persistence then you need to creates
    jdo resources in your application and also modify application server specific deployment descriptors.
    -Amol

  • Need Help in EJB 3.0

    HI,
    I am just started with EJB.
    I am getting getting the following exception while running the client Program
    javax.naming.NoInitialContextException: Need to specify class name in environment or system property, or as an applet parameter, or in an application resource file: java.naming.factory.initial
         at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
         at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.getURLOrDefaultInitCtx(Unknown Source)
         at javax.naming.InitialContext.lookup(Unknown Source)
         at in.test.TestClient.main(TestClient.java:18)
    Here is the sample program which I am using to test the application.
    package in.test;
    import java.util.Properties;
    import javax.naming.InitialContext;
    public class TestClient {
    public static void main(String[] args) throws Exception{
         LocalTestLocal ejb = null;     
              try {
                   InitialContext ctx = new InitialContext();
                   ejb = (LocalTestLocal) ctx.lookup("in.test.TestLocal");
              System.out.println(">>>"+ejb.meth());
              } catch (Exception e) {  
              e.printStackTrace ();
    I am using JBOSS 4.2.3
    package in.test;
    import javax.ejb.Local;
    @Local
    public interface LocalTestLocal {
         public String meth();
    package in.test;
    import javax.ejb.Stateless;
    import org.jboss.annotation.ejb.LocalBinding;
    import org.jboss.annotation.ejb.RemoteBinding;
    @Stateless
    @LocalBinding(jndiBinding="TestLocal")
    public class LocalTest implements LocalTestLocal {
    public LocalTest() {
    public String meth() {
         return "HI this is a test program";
    let me know what changes I need to make the program running?
    Thanks,
    Shyma

    A quick fix is to use the InitialContext() constructor which takes a Map and pass in a Map that contains and entry for
    the Context.INITIAL_CONTEXT_FACTORY key. Your tutorial should mention that as well as the other options.

Maybe you are looking for