1 2 Previous Next 18 Replies Latest reply on Mar 16, 2011 2:20 PM by obrienmi8

    jndi lookup to session ejb deployed to 10.3 weblogic fails

    23905
      Hi,

      I have followed numerous google hits and Oracle examples as to how to lookup a remote Session EJB deployed to Weblogic 10.3 (from a java client).

      I simply cannot get it to work (name not found - but it is there when I browse the JNDI tree from the console). Is there something I have to do on server for auth, etc?

      Please advise - I am about to dump the whole stack and recommend JBoss. This issue has wasted me 5 days.
        • 1. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
          648844
          Hi,

          Sorry to hear of the trouble. If you are getting a NameNotFoundException, I assume you are successfully obtaining an InitialContext to the server. I would first check to make sure you are getting the Context from the right server.

          If all looks well there, I would double check the JNDI name you are looking up the EJB with. What JNDI name are you using for the lookup on your client? How are you setting your EJB JNDI name?

          Another thing to consider is that your code may in fact be resolving the EJB but something else is going wrong. Note that EJB 3.0 beans may be created as a result of your lookup call. If the creation of the bean fails for any reason, it will result in a NamingException (hopefully with nested details of the problem). I would also be sure to check your server log to look for any exceptions.

          Finally, if none of the above suggestions help and if you are comfortable, please post the relevant sections of your Client and metadata (showing the configured JNDI name and the code performing the lookup) and I will take a look to see if I can spot anything wrong. If posting your code isn't an option, I would suggest contacting support (support.oracle.com).

          - Matt
          • 2. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
            23905
            Hi Matt
            Thank you for your interest, I appreciate it. Here is the code..

            The remote interface..
            -------------------------------------------------------------------------
            package model;

            public interface HelloWorld
            {
                 public String hello(String name);
            }
            ------------------------------------------------------------------------
            The implementation
            ------------------------------------------------------------------------
            package model;

            import javax.ejb.Remote;
            import javax.ejb.Stateless;

            @Stateless(mappedName = "HelloWorld")
            @Remote
            public class HelloWorldBean implements HelloWorld
            {

                 public String hello(String name)
                 {
                      return "Hello " + name;
                 }
                 
            }
            ------------------------------------------------------------------------
            The client code
            ------------------------------------------------------------------------
            package model;

            import java.util.Hashtable;

            import javax.naming.Context;
            import javax.naming.InitialContext;
            import javax.naming.NamingException;

            public class ClientTest {

                 //default value, overridden if passed in on command line
                 protected String providerUrl = "t3://dev-server:7001";
                 
                 //The formula is mappedName#RemoteInterfaceNameWithPackage
                 public static final String HELLO_WORLD_JNDI_NAME = "HelloWorld#model.HelloWorld";

                 public ClientTest() {
                      super();
                 }

                 /**
                 * @param args
                 */
                 public static void main(String[] args) {

                      ClientTest client = new ClientTest();

                      if (args.length > 0)
                           client.setProviderUrl(args[0]);

                      client.doTest();

                 }

                 public void doTest() {
                      InitialContext ic = null;

                      try {
                           ic = getInitialContext();
                           HelloWorld helloWorld = (HelloWorld) ic.lookup(HELLO_WORLD_JNDI_NAME);
                           log(helloWorld.hello("James"));
                      } catch (NamingException e) {
                           e.printStackTrace();
                      } finally {
                           if (ic != null) {
                                try {
                                     ic.close();
                                } catch (Exception e) {
                                }
                           }
                      }
                 }

                 public String getProviderUrl() {
                      return providerUrl;
                 }

                 public void setProviderUrl(String providerUrl) {
                      this.providerUrl = providerUrl;
                 }

                 protected void log(String message) {
                      System.out.println(message);
                 }

                 private InitialContext getInitialContext() throws NamingException {
                      try {
                           // Get an InitialContext
                           Hashtable<String, String> h = new Hashtable<String, String>();
                           h.put(Context.INITIAL_CONTEXT_FACTORY,
                                     "weblogic.jndi.WLInitialContextFactory");
                           h.put(Context.PROVIDER_URL, providerUrl);
                           return new InitialContext(h);
                      } catch (NamingException ne) {
                           log("We were unable to get a connection to the WebLogic server at "
                                     + providerUrl);
                           log("Please make sure that the server is running.");
                           throw ne;
                      }
                 }

            }
            --------------------------------------------------------------------------------------------------
            Thanks again, and kind regards,
            Murray
            • 3. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
              648844
              Hi Murray,

              I looked over your code and don't see anything wrong. In your earlier post you mentioned the JNDI binding was there when you browsed the JNDI tree from the console. Is that JNDI binding name exactly equal to the JNDI name you are performing the lookup with? Are you sure you are getting the InitialContext from the server you deployed the EJB to? Is there any nested exception that may indicate your EJB was resolved but that it failed to be instantiated? I'd be pretty surprised if your EJB couldn't be instantiated given its simplicity but it's worth looking into. Any unusual stack traces in your server log or output?

              I apologize if I'm asking some of the same questions as in my original post. I'm a bit baffled though because your code looks right to me and yet it's not working. Answers to the above questions will help me suggest the next thing to look at.

              - Matt
              • 4. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                726437
                The following works for me in weblogic 10.0. You can give it a try.

                Remote interface
                @Remote
                public class MySessionRemote {
                    ...
                }
                Session bean
                //JNDI name for this session in weblogic is [mappedName]#[package.remoteName]
                //example: "MySession#org.mycompany.session.MySessionRemote"
                @Stateless (mappedName = "MySession", name = "MySessionBean")     
                public class MySessionBean implements MySessionRemote {
                    ...
                }
                How to look up the session bean with a remote client using the initial context
                Context ctx = new InitialContext();
                MySessionRemote remote = (MySessionRemote)ctx.lookup("MySession#" + MySessionRemote.class.getName());
                If the session deploys you should be able to find it in the JNDI tree. If you dont find the session in the JNDI tree it might not have been deployed properly, or it may have been interperted as Local instead of Remote. Hope this helps.

                Regards
                Morten
                • 5. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                  23905
                  Hi Morten,
                  Thanks, I appreciate your interest - I will adjust acordingly and let you know.

                  Kind regards,
                  Murray
                  • 6. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                    737315
                    Hi!

                    I have the same error, in weblogic of course, but i trying with @local anottation.
                    My clases are:

                    //Service Interface
                    @Local
                    public interface CampanaService {
                    }

                    //Service Implementation
                    @Stateless(name="ejbearName",mappedName="ejbear")
                    public class CampanaServiceImpl implements CampanaService {
                    }

                    And in the class:
                                   campanaService = (CampanaService) jndiContext.lookup("ejbear#" + CampanaService.class.getName());

                    I haven´t error of NamingException but when i use campanaService i have null pointer. I don't understand!!!
                    It's works in jboss-4.2.2.GA.

                    PLEASE HELP! i need it!

                    Thank!
                    • 7. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                      651477
                      Hi,
                      could you please paste the full stack trace of the exception you got?
                      • 8. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                        23905
                        Hi,

                        Apologies for delays in reply. This issue is resolved. My lookup was correct, I just did not deploy the EJB properly. It is working now as it should be.

                        Kind regards,
                        Murray
                        • 9. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                          23905
                          Hi,

                          Apologies in delay of reply. My issue was that I never deployed the EJB correctly, and therefore was not in the JNDI tree. If you like I can send you my JDeveloper (11g) workspace?

                          Kind regards,
                          Murray
                          • 10. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                            737315
                            HI!

                            this is the error in console. I think the problem is in named of ejb in jndi.... The clases i used are in the post i wrote last days.

                            javax.naming.NameNotFoundException: While trying to lookup 'ejbear#com.biko2.gn.
                            service.CampanaService' didn't find subcontext 'ejbear#com'. Resolved ''; remain
                            ing name 'ejbear#com/biko2/gn/service/CampanaService'
                            at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
                            NamingNode.java:1139)
                            at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.jav
                            a:247)
                            at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.j
                            ava:182)
                            at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:20
                            6)
                            at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.j
                            ava:254)
                            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:388)
                            at javax.naming.InitialContext.lookup(InitialContext.java:392)
                            at gn.serviceW.CampanaActionsW.<init>(CampanaActionsW.java:135)
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
                            orAccessorImpl.java:39)
                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
                            onstructorAccessorImpl.java:27)
                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                            at java.lang.Class.newInstance0(Class.java:355)
                            at java.lang.Class.newInstance(Class.java:308)
                            at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecyclePr
                            ovider.newInstance(NoInjectionAnnotationLifecycleProvider.java:45)
                            at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(Managed
                            BeanBuilder.java:85)
                            at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createMana
                            gedBean(ManagedBeanResolver.java:198)
                            at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(M
                            anagedBeanResolver.java:164)
                            at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                            at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getVa
                            lue(FacesCompositeELResolver.java:140)
                            at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableRe
                            solverImpl.java:64)
                            at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(V
                            ariableResolverToELResolver.java:95)
                            at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                            at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getVa
                            lue(FacesCompositeELResolver.java:140)
                            at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
                            at com.sun.el.parser.AstValue.getTarget(AstValue.java:63)
                            at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
                            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)

                            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.ja
                            va:68)
                            at javax.faces.component._MethodExpressionToMethodBinding.invoke(_Method
                            ExpressionToMethodBinding.java:78)
                            at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
                            nListenerImpl.java:57)
                            at javax.faces.component.UICommand.broadcast(UICommand.java:141)
                            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:3
                            69)
                            at javax.faces.component.UIViewRoot.process(UIViewRoot.java:264)
                            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
                            53)
                            at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(Invoke
                            ApplicationExecutor.java:32)
                            at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl
                            .java:103)
                            at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
                            :76)
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
                            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
                            (StubSecurityHelper.java:227)
                            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
                            tyHelper.java:125)
                            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
                            a:292)
                            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
                            va:56)
                            at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(Extensions
                            Filter.java:147)
                            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
                            va:56)
                            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
                            n.run(WebAppServletContext.java:3588)
                            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
                            dSubject.java:321)
                            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
                            121)
                            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
                            ervletContext.java:2200)
                            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
                            ontext.java:2106)
                            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
                            ava:1428)
                            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                            at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                            javax.naming.NameNotFoundException: While trying to lookup 'ejbear#com.biko2.gn.
                            service.CampanaService' didn't find subcontext 'ejbear#com'. Resolved ''; remain
                            ing name 'ejbear#com/biko2/gn/service/CampanaService'
                            at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(Basic
                            NamingNode.java:1139)
                            at weblogic.jndi.internal.BasicNamingNode.lookupHere(BasicNamingNode.jav
                            a:247)
                            at weblogic.jndi.internal.ServerNamingNode.lookupHere(ServerNamingNode.j
                            ava:182)
                            at weblogic.jndi.internal.BasicNamingNode.lookup(BasicNamingNode.java:20
                            6)
                            at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.j
                            ava:254)
                            at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:388)
                            at javax.naming.InitialContext.lookup(InitialContext.java:392)
                            at gn.utils.Utils.init(Utils.java:98)
                            at gn.serviceW.CampanaActionsW.<init>(CampanaActionsW.java:147)
                            at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

                            at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstruct
                            orAccessorImpl.java:39)
                            at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingC
                            onstructorAccessorImpl.java:27)
                            at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                            at java.lang.Class.newInstance0(Class.java:355)
                            at java.lang.Class.newInstance(Class.java:308)
                            at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecyclePr
                            ovider.newInstance(NoInjectionAnnotationLifecycleProvider.java:45)
                            at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(Managed
                            BeanBuilder.java:85)
                            at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createMana
                            gedBean(ManagedBeanResolver.java:198)
                            at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(M
                            anagedBeanResolver.java:164)
                            at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                            at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getVa
                            lue(FacesCompositeELResolver.java:140)
                            at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableRe
                            solverImpl.java:64)
                            at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(V
                            ariableResolverToELResolver.java:95)
                            at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                            at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getVa
                            lue(FacesCompositeELResolver.java:140)
                            at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
                            at com.sun.el.parser.AstValue.getTarget(AstValue.java:63)
                            at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
                            at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)

                            at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.ja
                            va:68)
                            at javax.faces.component._MethodExpressionToMethodBinding.invoke(_Method
                            ExpressionToMethodBinding.java:78)
                            at org.apache.myfaces.application.ActionListenerImpl.processAction(Actio
                            nListenerImpl.java:57)
                            at javax.faces.component.UICommand.broadcast(UICommand.java:141)
                            at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:3
                            69)
                            at javax.faces.component.UIViewRoot.process(UIViewRoot.java:264)
                            at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:1
                            53)
                            at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(Invoke
                            ApplicationExecutor.java:32)
                            at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl
                            .java:103)
                            at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java
                            :76)
                            at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
                            at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run
                            (StubSecurityHelper.java:227)
                            at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecuri
                            tyHelper.java:125)
                            at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
                            a:292)
                            at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
                            va:56)
                            at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(Extensions
                            Filter.java:147)
                            at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.ja
                            va:56)
                            at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
                            n.run(WebAppServletContext.java:3588)
                            at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
                            dSubject.java:321)
                            at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
                            121)
                            at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppS
                            ervletContext.java:2200)
                            at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
                            ontext.java:2106)
                            at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
                            ava:1428)
                            at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                            at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                            11-30@09:57:08 DEBUG (CampanaActionsW.java:156) - [preBuscarCampanas]
                            <30-nov-2009 09H57' CET> <Warning> <netuix> <BEA-423420> <Redirect is executed i
                            n begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_p
                            ageLabel=DiagnosticsViewDomainLogTablePage&DiagnosticsViewDomainLogTablePortleth
                            andle=com.bea.console.handles.LogDispatchHandle%28%22AdminServer%3BDomainLog%22%
                            29.>
                            <30-nov-2009 09H57' CET> <Warning> <netuix> <BEA-423420> <Redirect is executed i
                            n begin or refresh action. Redirect url is /console/console.portal?_nfpb=true&_p
                            ageLabel=DiagnosticsViewServerLogTablePage&DiagnosticsViewServerLogTablePortleth
                            andle=com.bea.console.handles.LogDispatchHandle%28%22AdminServer%3BServerLog%22%
                            29.>


                            THANKS!!!!
                            • 11. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                              651477
                              Hi,
                              currently Weblogic server doesn't expose global JNDI name for local business interface of EJB.
                              you can use dependency injection in your client to lookup the local ejb, something like:

                              @EJB CampanaService service;


                              Thanks,
                              Amy
                              • 12. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                                737315
                                Hi!! i'm here again! ( if my english isn't correct sorry :P )

                                I change you tell me, but i have error's again.

                                There are my clases with changes:

                                In the class where i use my local interface
                                @EJB CampanaService campanaService;
                                And i delete campanaService = (CampanaService) jndiContext.lookup("ejbear#" + CampanaService.class.getName()); from this class. ok

                                The Service implementation have this:
                                @Stateless(name="ejbearName",mappedName="ejbear")
                                public class CampanaServiceImpl implements CampanaService { ... }

                                And the interface this:
                                @Local
                                public interface CampanaService { ... }

                                ¿Correct? ok, but the error now is:

                                javax.faces.FacesException: Error calling action method of component with id j_id6:j_id16
                                     at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:77)
                                     at javax.faces.component.UICommand.broadcast(UICommand.java:141)
                                     at javax.faces.component.UIViewRoot._broadcastForPhase(UIViewRoot.java:369)
                                     at javax.faces.component.UIViewRoot.process(UIViewRoot.java:264)
                                     at javax.faces.component.UIViewRoot.processApplication(UIViewRoot.java:153)
                                     at org.apache.myfaces.lifecycle.InvokeApplicationExecutor.execute(InvokeApplicationExecutor.java:32)
                                     at org.apache.myfaces.lifecycle.LifecycleImpl.executePhase(LifecycleImpl.java:103)
                                     at org.apache.myfaces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:76)
                                     at javax.faces.webapp.FacesServlet.service(FacesServlet.java:151)
                                     at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:227)
                                     at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:125)
                                     at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:292)
                                     at weblogic.servlet.internal.TailFilter.doFilter(TailFilter.java:26)
                                     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
                                     at org.apache.myfaces.webapp.filter.ExtensionsFilter.doFilter(ExtensionsFilter.java:147)
                                     at weblogic.servlet.internal.FilterChainImpl.doFilter(FilterChainImpl.java:56)
                                     at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3588)
                                     at weblogic.security.acl.internal.AuthenticatedSubject.doAs(AuthenticatedSubject.java:321)
                                     at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:121)
                                     at weblogic.servlet.internal.WebAppServletContext.securedExecute(WebAppServletContext.java:2200)
                                     at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:2106)
                                     at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1428)
                                     at weblogic.work.ExecuteThread.execute(ExecuteThread.java:201)
                                     at weblogic.work.ExecuteThread.run(ExecuteThread.java:173)
                                Caused by: javax.faces.FacesException: javax.naming.NameNotFoundException: While trying to look up comp/env/gn.serviceW.CampanaActionsW/campanaService in /app/webapp/facturas/32891847.; remaining name 'comp/env/gn/serviceW/CampanaActionsW/campanaService'
                                     at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:156)
                                     at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.createManagedBean(ManagedBeanResolver.java:198)
                                     at org.apache.myfaces.el.unified.resolver.ManagedBeanResolver.getValue(ManagedBeanResolver.java:164)
                                     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                                     at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:140)
                                     at org.apache.myfaces.el.VariableResolverImpl.resolveVariable(VariableResolverImpl.java:64)
                                     at org.apache.myfaces.el.convert.VariableResolverToELResolver.getValue(VariableResolverToELResolver.java:95)
                                     at javax.el.CompositeELResolver.getValue(CompositeELResolver.java:143)
                                     at org.apache.myfaces.el.unified.resolver.FacesCompositeELResolver.getValue(FacesCompositeELResolver.java:140)
                                     at com.sun.el.parser.AstIdentifier.getValue(AstIdentifier.java:68)
                                     at com.sun.el.parser.AstValue.getTarget(AstValue.java:63)
                                     at com.sun.el.parser.AstValue.invoke(AstValue.java:153)
                                     at com.sun.el.MethodExpressionImpl.invoke(MethodExpressionImpl.java:283)
                                     at com.sun.facelets.el.TagMethodExpression.invoke(TagMethodExpression.java:68)
                                     at javax.faces.component._MethodExpressionToMethodBinding.invoke(_MethodExpressionToMethodBinding.java:78)
                                     at org.apache.myfaces.application.ActionListenerImpl.processAction(ActionListenerImpl.java:57)
                                     ... 23 more
                                Caused by: javax.naming.NameNotFoundException: While trying to look up comp/env/gn.serviceW.CampanaActionsW/campanaService in /app/webapp/facturas/32891847.; remaining name 'comp/env/gn/serviceW/CampanaActionsW/campanaService'
                                     at weblogic.jndi.internal.BasicNamingNode.newNameNotFoundException(BasicNamingNode.java:1139)
                                     at weblogic.jndi.internal.ApplicationNamingNode.lookup(ApplicationNamingNode.java:144)
                                     at weblogic.jndi.internal.WLEventContextImpl.lookup(WLEventContextImpl.java:254)
                                     at weblogic.jndi.internal.WLContextImpl.lookup(WLContextImpl.java:388)
                                     at weblogic.jndi.factories.java.ReadOnlyContextWrapper.lookup(ReadOnlyContextWrapper.java:45)
                                     at weblogic.jndi.internal.AbstractURLContext.lookup(AbstractURLContext.java:130)
                                     at javax.naming.InitialContext.lookup(InitialContext.java:392)
                                     at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.lookupFieldResource(ResourceAnnotationLifecycleProvider.java:125)
                                     at org.apache.myfaces.config.annotation.AllAnnotationLifecycleProvider.checkFieldAnnotation(AllAnnotationLifecycleProvider.java:81)
                                     at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.checkAnnotation(ResourceAnnotationLifecycleProvider.java:76)
                                     at org.apache.myfaces.config.annotation.ResourceAnnotationLifecycleProvider.processAnnotations(ResourceAnnotationLifecycleProvider.java:54)
                                     at org.apache.myfaces.config.annotation.NoInjectionAnnotationLifecycleProvider.newInstance(NoInjectionAnnotationLifecycleProvider.java:46)
                                     at org.apache.myfaces.config.ManagedBeanBuilder.buildManagedBean(ManagedBeanBuilder.java:85)
                                     ... 38 more


                                My aplication have 2 modules: war and jar, package in ear. The war is the web aplicacion, where is the class that use the ejb. The jar is the ejb.

                                THANKS!!!!

                                Edited by: user11242902 on 30-nov-2009 2:41
                                • 13. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                                  726437
                                  Is there any reason why your interface needs to be @Local? Try to change it to @Remote.
                                  • 14. Re: jndi lookup to session ejb deployed to 10.3 weblogic fails
                                    740559
                                    Hi ,

                                    'm also getting the same NameNotFound exception.I can see the JNDI name in view JNDI tree .
                                    Binding Name: bulking.BulkTopLevel .

                                    The same is working fine in Welogic 8.1 .'m unable to trace where it is failing .
                                    Is it at the context or at bean instantiatio level.This is how 'm creating the context .
                                    Hashtable env1 = new Hashtable(5);
                                    env1.put(Context.INITIAL_CONTEXT_FACTORY,
                                    "weblogic.jndi.WLInitialContextFactory");
                                    env1.put(Context.PROVIDER_URL,
                                              webLogicServerURL);
                                    Context ctx = new InitialContext(env1);
                                    'm using EJB 2.0 -Is there any problem with the version?
                                    A quick help is really great!!

                                    Thanks,
                                    Kala
                                    1 2 Previous Next