7 Replies Latest reply on Jul 6, 2006 11:45 PM by Richard Doust

    Moving from JBoss 4.0.1 to 4.0.4

    Richard Doust Newbie

      I'm having the problem that my EJB beans are not being bound successfully on deployment taking what worked in 4.0.1 to 4.0.4. There are a couple of interesting things in the logfile:
      2006-07-03 14:51:34,727 DEBUG [org.jboss.ejb.EntityContainer] Unable to retrieve orbjavax.management.InstanceNotFoundException: jboss:service=CorbaORB is not registered.
      .
      .
      .
      2006-07-03 14:51:34,831 DEBUG [org.jboss.ejb.plugins.local.BaseLocalProxyFactory] TheRentalAgent cannot be Bound, doesn't have local and local home interfaces
      2006-07-03 14:51:34,898 DEBUG [org.jboss.proxy.ejb.ProxyFactory] (re-)Binding Home nym/rentalAgent
      2006-07-03 14:51:34,911 INFO [org.jboss.proxy.ejb.ProxyFactory] Bound EJB Home 'TheRentalAgent' to jndi 'foo/rentalAgent'

      I'm unable to look this bean's home object up using JNDI as I am able to do in 4.0.1. I can't tell if the problem is to do with CorbaORB not being registered, some problem with the deployment descriptors, or what. I have found some posts that hint at similar problems, but no solutions. I'm afraid I have not kept up with EJB's spec release to 3.0 and don't know if I'm forced to do something there. I have included version="2.1" in my ejb-jar tags. Can't figure out what else to do.
      Any help?

        • 2. Re: Moving from JBoss 4.0.1 to 4.0.4
          Richard Doust Newbie

          Thanks for that tip Scott, but I'm thinking that's not the solution to my problem. I'm actually looking up a remote home interface from the web tier at the point where an exception occurs because the home is not bound.
          I used the jboss installer script when I installed jboss 4.0.4, and one of the questions it asked was whether it should use pass-by-value semantics by default. I didn't select that option when I first installed. I thought that might have something to do with my problem, so I removed the install and did it again, this time checking the option. The log entries are a little different, though mostly the same as I recall, which made me think I hadn't solved the problem, but I was able to bring up the application with no further problems.

          • 3. Re: Moving from JBoss 4.0.1 to 4.0.4
            Richard Doust Newbie

            I'm going to try to be more specific.
            I have a session bean defined in a jar file that's packaged with a war file into an ear. The session bean is declared in its ejb-jar.xml as follows:

             <session>
             <display-name>The Shopping Client Controller</display-name>
             <ejb-name>TheShoppingClientController</ejb-name>
             <home>com.control.ejb.ShoppingClientControllerHome</home>
             <remote>com.control.ejb.ShoppingClientController</remote>
             <ejb-class>com.control.ejb.ShoppingClientControllerEJB</ejb-class>
             <session-type>Stateful</session-type>
             <transaction-type>Container</transaction-type>
             .
             .
             </session>
            

            The jboss.xml file contains the following:
             <session>
             <ejb-name>TheShoppingClientController</ejb-name>
             <jndi-name>foo/scc</jndi-name>
             .
             .
             </session>
            

            The web.xml contains the following:
             <ejb-ref>
             <ejb-ref-name>ejb/scc/Scc</ejb-ref-name>
             <ejb-ref-type>Session</ejb-ref-type>
             <home>com.control.ejb.ShoppingClientControllerHome</home>
             <remote>com.control.ejb.ShoppingClientController</remote>
             </ejb-ref>
            

            The jboss-web.xml contains the following:
            <ejb-ref>
            <ejb-ref-name>ejb/scc/Scc</ejb-ref-name>
            <jndi-name>foo/scc</jndi-name>
            </ejb-ref>

            In the web-tier the code does this:
             public static ShoppingClientControllerHome getSCCHome()
             throws javax.naming.NamingException {
             InitialContext initial = new InitialContext();
             Object objref = initial.lookup("java:comp/env/ejb/scc/Scc");
             return (ShoppingClientControllerHome)
             PortableRemoteObject.narrow(objref,
             ShoppingClientControllerHome.class);
             }
            


            • 4. Re: Moving from JBoss 4.0.1 to 4.0.4
              Richard Doust Newbie

              This code worked without a hitch under JBoss 4.0.1. In 4.0.4 it works if the system is installed with Pass By Value semantics by default (PBV), but PortableRemoteObject's narrow method throws a ClassCastException if 4.0.4 is installed without the Pass By Value semantics by default (PBR).
              When the application is deployed into PBR, there is output in server.log to the effect that ShoppingClientController cannot be Bound because it has no local or local home interfaces. It then says it's (re-)Binding, and that seems to throw no exceptions, so, presumably, something has been bound. In the PBV version, no error messages having to do with missing interfaces are produced. I have added the allegedly missing interfaces in the PBR version and gotten rid of the complaints in the server.log, but the code still doesn't work, i.e., it still produces a ClassCastException.
              I'm trying to move my application to a hosted server with JBoss pre-installed in the PBV configuration and would like for this code to work there.

              • 5. Re: Moving from JBoss 4.0.1 to 4.0.4
                Richard Doust Newbie

                Mistake in last sentence. I want to deploy to a server with JBoss pre-installed in the PBR configuration.

                • 6. Re: Moving from JBoss 4.0.1 to 4.0.4
                  Richard Doust Newbie

                  Wow! I don't know how people keep up with this stuff. I've just read this page:
                  http://jira.jboss.com/jira/browse/JBAS-1691
                  The most important thing I found on that page was this:
                  (in tomcat55.sar/META-INF/jboss-service.xml)
                  To revert to pre-4.0.2 config use:
                  true
                  true

                  Works like a charm again. How do you people keep up with this class loading nightmare?

                  • 7. Re: Moving from JBoss 4.0.1 to 4.0.4
                    Richard Doust Newbie

                    To revert to pre-4.0.2 config use:

                    <attribute name="Java2ClassLoadingCompliance">true</attribute>
                    <attribute name="UseJBossWebLoader">true</attribute>