1 Reply Latest reply on Sep 21, 2005 11:11 AM by Bill Burke

    Weblogic 9 + JBoss Embeddable

    zaid haque Newbie

      Hi Bill,

      Still no luck. As you said I followed the EmbeddedEJB3.jsp how it does the lookup. Later I did ported EmebeddedEJB3.jsp itself with having its classes in place. Both the cases I'm gettting javax.naming.NameNotFoundException:

      Am I missing something. It looks for some kind of binding. Do I have to have jndi.properties somewhere (I see this file created when I use JBoss IDE). I had no issues with JBOSS AS 4RC2. I didn't do any special configuration as I can remember.

      However let me list down what I'm doing:

      1. I'm having all the files in \conf directory put in the WEB-INF\classes directory

      embedded-jboss-beans.xml, jboss-jms-beans.xml, testjms.xml, ejb3-deployment.xml, ejb3-interceptors-aop.xml, log4j.xml, default.persistence.properties

      2. Added all the jars (jars thats comes with EJB3) in to WEB-INF\lib directory

      3. Modified web.xml to have follwing

      <context-param>
      <param-name>jboss-kernel-deployments</param-name>
      <param-value>embedded-jboss-beans.xml, jboss-jms-beans.xml, testjms.xml, ejb3-deployment.xml</param-value>
      </context-param>


      <listener-class>org.jboss.ejb3.embedded.ServletBootstrapListener</listener-class>


      4. and now I do the lookup as following

      public static InitialContext getInitialContext() throws Exception
      {
      Hashtable props = getInitialContextProperties();
      return new InitialContext(props);
      }

      private static Hashtable getInitialContextProperties()
      {
      Hashtable props = new Hashtable();
      props.put("java.naming.factory.initial", "org.jnp.interfaces.LocalOnlyContextFactory");
      props.put("java.naming.factory.url.pkgs", "org.jboss.naming:org.jnp.interfaces");
      return props;
      }



      public void jspInit () {
      try {
      InitialContext ctx = getInitialContext();
      cal = (Calculator) ctx.lookup(
      Calculator.class.getName());
      } catch (Exception e) {
      e.printStackTrace ();
      }
      }




      javax.naming.NameNotFoundException: com.emirates.ibe.testejb3.business.interface
      s.Calculator 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at jsp_servlet.__calculator.jspInit(__calculator.java:121)
      at weblogic.servlet.jsp.JspBase.init(JspBase.java:27)
      at weblogic.servlet.internal.StubSecurityHelper$ServletInitAction.run(St
      ubSecurityHelper.java:265)
      at weblogic.security.acl.internal.AuthenticatedSubject.doAs(Authenticate
      dSubject.java:321)
      at weblogic.security.service.SecurityManager.runAs(SecurityManager.java:
      121)
      at weblogic.servlet.internal.StubSecurityHelper.createServlet(StubSecuri
      tyHelper.java:61)
      at weblogic.servlet.internal.StubLifecycleHelper.createOneInstance(StubL
      ifecycleHelper.java:58)
      at weblogic.servlet.internal.StubLifecycleHelper.(StubLifecycleHel
      per.java:48)
      at weblogic.servlet.internal.ServletStubImpl.prepareServlet(ServletStubI
      mpl.java:502)
      at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:225)
      at weblogic.servlet.jsp.JspStub.prepareServlet(JspStub.java:164)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
      a:224)
      at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(Servlet
      StubImpl.java:383)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
      a:298)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.jav
      a:165)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationActio
      n.run(WebAppServletContext.java:3022)
      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:1925)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletC
      ontext.java:1848)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.j
      ava:1288)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)


      javax.naming.NameNotFoundException: org.jboss.tutorial.embeddedwar.CustomerDAOLocal 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 org.jnp.interfaces.NamingContext.lookup(NamingContext.java:610)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:572)
      at javax.naming.InitialContext.lookup(InitialContext.java:351)
      at jsp_servlet.__embeddedejb3._jspService(__embeddedejb3.java:204)
      at weblogic.servlet.jsp.JspBase.service(JspBase.java:34)
      at weblogic.servlet.internal.StubSecurityHelper$ServletServiceAction.run(StubSecurityHelper.java:214)
      at weblogic.servlet.internal.StubSecurityHelper.invokeServlet(StubSecurityHelper.java:120)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:272)
      at weblogic.servlet.internal.ServletStubImpl.onAddToMapException(ServletStubImpl.java:383)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:298)
      at weblogic.servlet.internal.ServletStubImpl.execute(ServletStubImpl.java:165)
      at weblogic.servlet.internal.WebAppServletContext$ServletInvocationAction.run(WebAppServletContext.java:3022)
      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:1925)
      at weblogic.servlet.internal.WebAppServletContext.execute(WebAppServletContext.java:1848)
      at weblogic.servlet.internal.ServletRequestImpl.run(ServletRequestImpl.java:1288)
      at weblogic.work.ExecuteThread.execute(ExecuteThread.java:207)
      at weblogic.work.ExecuteThread.run(ExecuteThread.java:179)



      Rgds

      Zaid

        • 1. Re: Weblogic 9 + JBoss Embeddable
          Bill Burke Master

          Did you modify ejb3-deployment.xml to automatically find your jars? My guess is that your EJB3 jars are not getting deployed.

          JBoss EJB3 is being initialized correctly as I see you are finally at least hooking up to the JBoss embedded JNDI server.

          Can you run the embedded-war tutorial AS IS in weblogic?