7 Replies Latest reply on Jul 29, 2003 12:15 PM by Jon Barnett

    upgrading from 2.4.4 to 3.0.7

    djs1w Newbie

      I'm having problems getting my application to work the same as it did on JBoss/Tomcat 2.4.4. My setup is as follows: Redhat 9 (no firewall), Sun Java 1.4.03, JBoss/Jetty 3.0.7 running the default instance. I'm new to Java/JBoss to bear with me.

      I've made the following changes to the source code of our application:

      a) in ejb-jar.xml:
      1)I've changed the DOCTYPE to reflect DTD 2.0, ie <!DOCTYPE ejb-jar
      PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN"
      "http://java.sun.com/dtd/ejb-jar_2_0.dtd">

      2)added the following tags to each section, <cmp-version>1.x</cmp-version>

      b) commented out any ejb-ref sections in both ejb-jar.xml and web.xml files.

      Now, I'm not exactly sure why I did these things. The admin before me was responsible for this code migration and this is as far as he got, so I'm going off his notes. The application deploys correctly, and I'm able to authenticate/query against an oracle database, but there are certain pages that will give me the "HTTP ERROR: 500 Internal Server Error RequestURI=/cgi-java/common/jsp/Logout.jsp" error. This doesn't happen on JBoss 2.4.4. Any ideas as to what I'm missing, also, maybe also an explanation as to what the changes I made mentioned above would be greatly appreciated. I've browsed through the forums but haven't come across anything. Thanks in advance, please ask if there's anything I've left out.

        • 2. Re: upgrading from 2.4.4 to 3.0.7
          Jon Barnett Master

          OK. As best I can:

          The addition of the doctype is not absolutely necessary in 3.0.x but is necessary in 3.2.x to pass the strict verification of the XML. I suppose it is to indicate the

          The explicit CMP definition is to tell the container which CMP engine to use. Because you have included the EJB template for spec 2.0, normally the assumption would be that you want to use the CMP 2.0 engine (2.4.x did not support CMP 2.0).

          Not quite sure why the ejb-ref tags were commented out. I would have assumed you are still going to want to reference these other components. Unless the intention was to recode and use local references through <ejb-local-ref>. This would make sense I suppose, so to support that you would need the EJB 2.0 DTD. However, you probably don't want to do a major recode of any entity beans for CMP 2.0 so you need to specify the CMP spec you are adhering to is 1.x.

          Otherwise, to avoid all this and avoid having to recode anything, you would just re-instate your ejb-refs, remove the CMP 1.x tags and substitute your doctype with this:
          <!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 1.1//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_1_1.dtd">

          I'm assuming the internal servlet error is due to some EJB not being found because you've removed the reference and not replaced it with anything. You should be getting console errors, or something in the logs saying why the JSP failed - probably "null" something or other.

          A bit hard to guess without specific cases though. Hope that helps a bit.

          • 3. Re: upgrading from 2.4.4 to 3.0.7
            Jon Barnett Master

            Sorr that first paragraph was munged by a combination of network and Opera. What I mean to say at the end of it is that your doctype specifies the DTD to be used to verify your XML. In this case, it says use the DTD for the EJB 2.0 spec.

            • 4. Re: upgrading from 2.4.4 to 3.0.7
              djs1w Newbie

              Ok, it's slowly starting to make some sense. I did the following things you mentioned:

              1) reinstated my ejb-refs
              2) removed the CMP 1.x tags
              3) and changed the doctype to 1.1

              All the things you wanted me to do, are what our application code repository looks like when we do a build (with ant) for JBoss 2.4.4. So I really didn't have to do anything you asked, I just checkout a fresh copy from CVS. If I take that repository and do a build against JBoss 3.x, the build is successful, however I get these errors when the application is deployed:

              ----------------------------------------------
              2003-07-29 08:10:57,311 WARN [org.jboss.metadata.EntityMetaData] Client: The abstract-schema-name Element must be specified for CMP 2.x Beans
              2003-07-29 08:10:57,313 WARN [org.jboss.metadata.EntityMetaData] Client: The abstract-schema-name must be a valid Java Identifier 'null'
              -----------------------------------------------

              followed by:

              ---------------------------------------
              Bean : Client
              Section: 10.6.2
              Warning: The entity bean class must be defined as public and abstract.

              2003-07-29 08:10:58,317 INFO [org.jboss.ejb.EJBDeployer]
              Bean : Client
              Section: 10.6.2
              Warning: The entity bean class must define a set accessor for each CMP field.
              Info : Field: clientId
              ----------------------------------------------------

              Let me know if you need any more information, and the help is much appreciated, thanks!

              • 5. Re: upgrading from 2.4.4 to 3.0.7
                Jon Barnett Master

                I would manually check the ejb-jar.xml of the JARs that failed deployment. I'm not sure if you have EAR bundles or JAR bundles for your EJB deployment but you need to track down the particular EJB deployments that failed and check these files. You will probably find they still have the DTD for 2.0 specified. This is causing JBoss to think they are CMP 2.x deployments and it expects the <abstract-schema-name> defined in the deployment. That will probably lead to your other failures - otherwise they are a different issue.

                I just experimented with some old 2.4.x deployments I had lying around. It spits this out with the 2.0 doctype declaration (<!DOCTYPE ejb-jar PUBLIC "-//Sun Microsystems, Inc.//DTD Enterprise JavaBeans 2.0//EN" "http://java.sun.com/j2ee/dtds/ejb-jar_2_0.dtd">
                ):

                org.jboss.deployment.DeploymentException: Error in ejb-jar.xml for Entity Bean BiblioRef: The abstract-schema-name must be specified for CMP 2.x Beans
                at org.jboss.metadata.ApplicationMetaData.importEjbJarXml(Unknown Source
                )
                at org.jboss.metadata.XmlFileLoader.load(Unknown Source)

                • 6. Re: upgrading from 2.4.4 to 3.0.7
                  djs1w Newbie

                  Yeah there was one file I missed that had the 2.0 specified. Now I'm receiving this error on deployment:

                  org.jboss.deployment.DeploymentException: ejb-ref: Blotter/Blotter, no ejb-link match, use jndi-name in jboss-web.xml; - nested throwable: (javax.naming.NamingException: ejb-ref: Blotter/Blotter, no ejb-link match, use jndi-name in jboss-web.xml)

                  • 7. Re: upgrading from 2.4.4 to 3.0.7
                    Jon Barnett Master

                    Sounds like some changes have been made in this area. You are referencing Blotter/Blotter but this should link through to an entry specifying the actual JNDI name reference but you don't have that. I'm going off-line but someone should be able to provide some help if you can show - I'm assuming the problem is with a web application - probably the jboss-web.xml and the corresponding web.xml.