8 Replies Latest reply on Jul 4, 2012 7:33 PM by sfcoy

    Converting from AS5 to AS7. Not going so well. Help!

    jimmyinmd

      I've been working on this conversion for a couple of days now. I've been fighting various ClassNotFoundException/NoClassDefFoundError's. I've tried loading my depencies by creating new modules, linking to them in either the MANIFEST.MF or jboss-deployment-structure.xml.

       

      I'm thinking I should start over and try and go the easiest route possible.

       

      Our application isn't that complicated. We deploy a WAR file with all our dependencies (Spring 3 included) under WEB-INF/lib.

       

      Is there any reason why this shouldn't work? I've converted my datasource into the standalone.xml file and that works fine. The problems start when applicationContext.xml is loading. Do I really NEED to move things out of WEB-INF/lib?

       

      Thanks for the help.

        • 1. Re: Converting from AS5 to AS7. Not going so well. Help!
          sfcoy

          Hi there! Welcome to the JBoss forums.

           

          Using a jboss-deployment-structure.xml is generally a last resort so don't worry about that for now.

           

          Show us the result of

           

               tar -tf yourapp.war

           

          One issue a lot of people have is that classes in WAR/lib jars override those in the application server and that can cause problems, particularly those of the class loading variety.

           

          Also, be sure that you're using a version of Spring 3.0 > 3.0.2. Earlier versions have known problems. See SPR-7197

           

          Finally, please post the stack traces that you're getting.

          1 of 1 people found this helpful
          • 2. Re: Converting from AS5 to AS7. Not going so well. Help!
            jimmyinmd

            Thanks for the quick response!

             

            We are using Spring 3.0, so I'll throw the 3.05 jars into my war instead and see what happens.

             

            I can't post the result of tar -tf here, unfortunately. For security reasons.

             

            I'll post my stacktrace tomorrow when I'm back in the office.

             

            If I do have classes in my WAR that override those in the application server, are there steps I can take to force AS7 to use the jars in my WAR instead?

            • 3. Re: Converting from AS5 to AS7. Not going so well. Help!
              sfcoy

              I can't post the result of tar -tf here, unfortunately. For security reasons.

              Listing only the third party jars would be adequate. Debugging classloading problems without knowing what is in your app would otherwise be quite difficult.

              If I do have classes in my WAR that override those in the application server, are there steps I can take to force AS7 to use the jars in my WAR instead?

              This is almost always the wrong thing to do.

              • 4. Re: Converting from AS5 to AS7. Not going so well. Help!
                jimmyinmd

                I will post the 3rd party jars tomorrow.

                 

                What is the proper way to handle the duplicate jars? Do you use the ones included in AS7 and just deal with any necessary code changes? I'm asking before I post by exceptions/war so I can have some plan of attack tomorrow.

                 

                Thanks a lot for the help.

                • 5. Re: Converting from AS5 to AS7. Not going so well. Help!
                  sfcoy

                  The first thing to do is remove any jars that contain JEE (or JaveSE) classes. A common one is xml-apis and friends.

                   

                  Hibernate jars should be OK if they're recent enough. We're using 3.3.2.GA without problems so far.

                  • 6. Re: Converting from AS5 to AS7. Not going so well. Help!
                    jimmyinmd

                    Going pretty well so far...

                     

                    Getting this exception now:

                    java.lang.ClassNotFoundException: com.sun.org.apache.xerces.internal.dom.DOMXSImplementationSourceImpl from...

                     

                    That class is included in rt.jar, so that doesn't make much sense (to me). Any ideas?

                    • 7. Re: Converting from AS5 to AS7. Not going so well. Help!
                      jimmyinmd

                      Ignore that. I fixed it by adding a dependency to that package. I wouldn't think that is necessary, but I guess it is.

                      • 8. Re: Converting from AS5 to AS7. Not going so well. Help!
                        sfcoy

                        That suggests that you still have XML parsers in your application. You should not need that as JEE servers have always provided XML services.