7 Replies Latest reply on Dec 4, 2002 8:13 PM by CL Gilbert

    Stack overflow error - please help me

    Tom Newbie

      Can anyone help me please? I'm trying to deploy an ear file containing a bunch of servlets and a couple of stateless EJBs and I'm getting the following error the first time one of my EJBs is looked up.

      ----------------------------------------------------------
      10:18:12,297 WARN [jbossweb] WARNING: Error for /singlescrowd/Authentication/submit/login?pin=420151&password=121313&ph
      one224041java.lang.StackOverflowError
      at com.sun.naming.internal.VersionHelper12$6.run(VersionHelper12.java:161)
      at java.security.AccessController.doPrivileged(Native Method)
      at com.sun.naming.internal.VersionHelper12.getContextClassLoader(VersionHelper12.java:158)
      at com.sun.naming.internal.VersionHelper12.loadClass(VersionHelper12.java:41)
      at javax.naming.spi.NamingManager.getObjectFactoryFromReference(NamingManager.java:129)
      at javax.naming.spi.NamingManager.getObjectInstance(NamingManager.java:299)
      at javax.naming.spi.NamingManager.getContext(NamingManager.java:419)
      at javax.naming.spi.ContinuationContext.getTargetContext(ContinuationContext.java:35)
      at javax.naming.spi.NamingManager.getContinuationContext(NamingManager.java:763)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:568)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
      at javax.naming.InitialContext.lookup(InitialContext.java:347)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:533)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:569)
      at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
      ---------------------------------------------------------

      I'm pretty sure that I have modified the web.xml and the jboss-web.xml correctly but the error still occurs. The application deploys fine (according to my DOS window.) I've also been reading about the jboss.xml and am unsure as to what to do with all these XML tags!

      I'm running JBoss 3.0.3, with JDK 1.4.1 and J2EE 1.3.1 on a windows 2000 machine. The relevant contents of my xml files are...

      web.xml...

      <ejb-ref>
      <ejb-ref-name>ejb/UserSession</ejb-ref-name>
      <ejb-ref-type>Session</ejb-ref-type>
      com.masc.singles.ejb/UserSessionHome
      com.masc.singles.ejb.UserSession
      </ejb-ref>

      jboss-web.xml

      <ejb-ref>
      <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
      <jndi-name>java:comp/env/ejb/SCInterface</jndi-name>
      </ejb-ref>

      Many thanks in advance for any help!

        • 1. Re: Stack overflow error - please help me
          Adrian Brock Master

          <ejb-ref>
          <!-- This line creates java:comp/env/ejb/SCinterface
          for the web container -->
          <ejb-ref-name>ejb/SCInterface</ejb-ref-name>

          <!-- This should be the global jndi name,
          probably SCInterface unless you changed it in jboss.xml -->
          <jndi-name>java:comp/env/ejb/SCInterface</jndi-name>
          </ejb-ref>

          Regards,
          Adrian

          • 2. Re: Stack overflow error - please help me
            Tom Newbie

            Hi Adrian,

            Thanks for your advice, it doesn't seem to have worked though. I don't get the stack overflow anymore, now I changed my jboss-web.xml to read;

            <jboss-web>
            <ejb-ref>
            <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
            <jndi-name>SCInterface</jndi-name>
            </ejb-ref>
            <ejb-ref>
            <ejb-ref-name>ejb/UserSession</ejb-ref-name>
            <jndi-name>UserSession</jndi-name>
            </ejb-ref>
            </jboss-web>

            I get a NameNotFoundException thrown...

            javax.naming.NameNotFoundException: SCInterface not bound
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:495)
            at org.jnp.server.NamingServer.getBinding(NamingServer.java:503)
            at org.jnp.server.NamingServer.getObject(NamingServer.java:509)
            at org.jnp.server.NamingServer.lookup(NamingServer.java:282)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:456)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:533)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:569)
            at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:440)
            at javax.naming.InitialContext.lookup(InitialContext.java:347)
            at com.masc.singles.web.Authentication.doAction(Authentication.java:46)

            Do you have any more ideas? I'm completely stuck.

            Many thanks.

            Tom

            • 3. Re: Stack overflow error - please help me
              Adrian Brock Master

              Do you have an EJB bound at SCInterface?

              Regards,
              Adrian

              • 4. Re: Stack overflow error - please help me
                Tom Newbie

                Hi Adrian,

                I'm pretty sure I have the EJB bound correctly. Following are the details from my XML files...

                web.xml...

                <ejb-ref>
                <ejb-ref-name>ejb/UserSession</ejb-ref-name>
                <ejb-ref-type>Session</ejb-ref-type>
                com.masc.singles.ejb/UserSessionHome
                com.masc.singles.ejb.UserSession
                </ejb-ref>

                jboss-web.xml

                <ejb-ref>
                <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
                <jndi-name>java:comp/env/ejb/SCInterface</jndi-name>
                </ejb-ref>

                And in my code I am lookup()-ing the value "java:comp/env/ejb/SCInterface"

                I'm completely lost, I thought that editing the XML files (from what the Sun RI deploytool wrote for me) would surfice, but obviously not!

                Thanks for your help!

                Tom

                • 5. Re: Stack overflow error - please help me
                  Adrian Brock Master

                  You will have something like this

                  ejb-jar.xml
                  <ejb-name>SCInterface</ejb-name>

                  This will bind the bean at SCInterface
                  Unless you've changed in jboss.xml

                  In web.xml you have
                  <ejb-ref>
                  <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
                  ...
                  </ejb-ref>

                  In jboss-web.xml put
                  <ejb-ref>
                  <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
                  <jndi-name>SCInterface</jndi-name>
                  </ejb-ref>

                  NOTE: If you are using an ear, you can use ejb-link

                  In web.xml put
                  <ejb-ref>
                  <ejb-ref-name>ejb/SCInterface</ejb-ref-name>
                  ...
                  <ejb-link>SCInterface</ejb-link> <!-- ejb-name of bean -->
                  </ejb-ref>

                  Then you don't need jboss-web.xml

                  Regards,
                  Adrian

                  • 6. Re: Stack overflow error - please help me
                    CL Gilbert Newbie

                    Was their any solution here? I am having a similar issue.

                    at javax.naming.InitialContext.lookup(InitialContext.java:345)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:556)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
                    at javax.naming.InitialContext.lookup(InitialContext.java:345)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:556)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
                    at javax.naming.InitialContext.lookup(InitialContext.java:345)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:556)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:592)
                    at org.jnp.interfaces.NamingContext.lookup(NamingContext.java:443)
                    at javax.naming.InitialContext.lookup(InitialContext.java:345)
                    at

                    etc. till the stack blows. I am trying to get a database conn from the pool.

                    jboss.xml contains


                    <ejb-name>BranchKeyGenerator</ejb-name>
                    <jndi-name>ejb/BranchKeyGenerator</jndi-name>
                    <local-jndi-name>ejb/BranchKeyGeneratorLocal</local-jndi-name>
                    <resource-ref>
                    <res-ref-name>java:/jdbc/TestDS</res-ref-name>
                    <resource-name>aDBConn</resource-name>
                    </resource-ref>


                    </enterprise-beans>

                    <resource-managers>
                    <resource-manager>
                    <res-name>aDBConn</res-name>
                    <res-jndi-name>java:comp/env/jdbc/TestDS</res-jndi-name>
                    </resource-manager>
                    </resource-managers>


                    ejb-jar contains

                    <resource-ref>
                    <res-ref-name>java:/jdbc/TestDS</res-ref-name>
                    <res-type>javax.sql.Datasource</res-type>
                    <res-auth>Container</res-auth>
                    </resource-ref>



                    I just cant get it to stop blowing up...

                    • 7. Re: Stack overflow error - please help me
                      CL Gilbert Newbie

                      im using jboss 3.0.4 with tomcat 4.1.x

                      thanks!