1 2 Previous Next 16 Replies Latest reply on Mar 2, 2006 3:34 PM by Burton

    NoClassDefFoundError

    James Cook Newbie

      I am using the JBoss 4.0.3 SP1 app server release installed by unzipping the package into a directory. I have also downloaded the latest seam release and unzipped into its own directory.

      The JBoss server starts up fine using run.bat [-c default].

      While in the Seam directory, I have properly set up the build.properties file with the path to my jboss install. I have run the "ant deploy" target in the registration directory and the target succesfully [AFAICT] builds the ear file and deploys it.

      JBoss 4.0.3 SP1 detects the deployed file and begins to deploy it. It quickly experiences an exception:

      20:27:32,265 ERROR [[/seam-registration]] Exception sending context initialized event to listener instance of class org.jboss.seam.servlet.SeamListener
      java.lang.NoClassDefFoundError: javax/ejb/Stateful
       at org.jboss.seam.Seam.getComponentType(Unknown Source)
       at org.jboss.seam.Component.<init>(Unknown Source)
       at org.jboss.seam.Component.<init>(Unknown Source)
       at org.jboss.seam.init.Initialization.addComponent(Unknown Source)
       at org.jboss.seam.init.Initialization.addComponents(Unknown Source)
       at org.jboss.seam.init.Initialization.init(Unknown Source)


      At this point, I thought that maybe I should be running "run.bat -c all" because I am not sure if the EJB3 classes are accessible. However, when I ran the "all" profile and copied the deploy ear file manually, the same error occurred.

      Some questions:

      -- Perhaps the jBoss 4.0.3 SP1 download does not include EJB3?

      -- If that is the case, the EJB3 embedded -ejb directory it is definitely part of the Seam download along with a bunch of other directories. Where are the instructions on how to add this to the jBoss 4.0.3 server?

      -- What are the microcontainer and lib directories for in the seam download?

      Thanks for any help.

        • 1. Re: NoClassDefFoundError
          ryan dewell Novice

          FYI, I have the exact same problem / exception / error with the final release of 4.0.3. However, the build of 4.0.3 that was made especially for Seam works just fine. I was not able to get any advice as to why this might be. I hope your post will spark new consideration of this problem.

          Ryan

          • 2. Re: NoClassDefFoundError
            James Cook Newbie

            Ryan, thanks for that info. Any ideas where the custom version of JBoss 4.0.3 for Seam is now? Didn't see anything special on the download page.

            Hopefully the Seam team (or anyone else who has it working) can post some specific install instructions for the latest release.

            • 3. Re: NoClassDefFoundError
              ryan dewell Novice

              It used to be posted alongside the other Seam files:

              http://sourceforge.net/project/showfiles.php?group_id=22866&package_id=163777

              Unfortunately it appears to no longer be listed. I'm assuming they removed the special build since Seam is *supposed* to work with the final 4.0.3.

              • 4. Re: NoClassDefFoundError
                Norman Richards Master

                Install JBoss using the installer to get EJB3 support for Seam.

                • 5. Re: NoClassDefFoundError
                  James Cook Newbie

                  The short answer to the question of how to run Seam applications on JBoss 4.0.3 final is to download and install EJB3 to this app server. I'm assuming Norman's approach (installing JBoss using the installer) will also work, but for those old school folks that don't need a fancy GUI installer ;-), this seems to work.

                  1. Download and unzip the latest JBoss 4.0.3. I downloaded the SP1 release. 71MB, damn.

                  2. Download EJB 3. The EJB 3.0 RC3 seemed to work fine for me.

                  3. I created a copy of the :jboss:/server/all directory and named it :jboss:/server/seam. You can't use the :jboss:/server/default directory as a starting point because the EJB3 package has some dependencies that exist in "all".

                  4. Following the instructions that come with the EJB 3 zip file, I copy a few files and directories from that archive into my :jboss:/server/seam/deploy directory and one file into :jboss:/server/seam/lib. I also have to remove the :jboss:/server/seam/deploy/jboss-aop.deployer directory. The instructions mention that the :jboss:/server/seam/deploy/jboss-hibernate.deployer directory should be removed, but it doesn't exist. Must be for an older version of the server.

                  5. Start the JBoss 4.0.3 server using the command run -c seam

                  6. Once that is done, running ant deploy from one of the examples directory should generate an ear file that is deployed to the app server you specified in your build.properties file (in the seam root directory). The only problem at this point is the default build script copies (i.e. deploys) the ear file to :jboss:/server/default/deploy.

                  To remedy this, locate the :seam:/build.xml file. In this ant build script, change the line that reads:

                  <property name="deploy.dir" value="${jboss.home}/server/default/deploy"/>

                  to
                  <property name="deploy.dir" value="${jboss.home}/server/seam/deploy"/>


                  7. From the :seam:/examples/booking directory, run ant deploy again, and the jboss-seam-booking.ear should be properly deployed to the running server.

                  8. Point your browser to http://localhost:8080/seam-booking to verify the install.


                  • 6. Re: NoClassDefFoundError
                    Norman Richards Master

                    Yes, that is obviously simpler than:

                    1 - Go to http://www.jboss.com/products/jbossas/downloads and click "run installer".
                    2 - Download seam
                    3 - set jboss.home in build.properties and run ant in the examples/seam-booking directory

                    "It's just that easy" :)

                    • 7. Re: NoClassDefFoundError
                      Patrick Angeles Novice

                      I do appreciate oravecz's post... not all of us have a gui available on the machine where we install jboss ;)

                      • 8. Re: NoClassDefFoundError
                        ryan dewell Novice

                        Exactly... The installer is a neat idea, but cumbersome to deal with when the target is a headless machine. What JBoss needs to do is provide some downloadable common configurations, at least.

                        Ryan

                        • 9. Re: NoClassDefFoundError
                          Norman Richards Master

                          You can create your JBoss image from the installer on ANY machine and copy it over to your headless machine. Think of it as a customized jboss.zip creator.

                          • 10. Re: NoClassDefFoundError
                            ryan dewell Novice

                            Interesting. I'll give that a try next go around.

                            • 11. Re: NoClassDefFoundError
                              James Cook Newbie

                              Obviously, I wasn't giving these instructions because they were easier than the "installer". I was trying to help others who may want to stay current with the jBoss app server head and seam together. (I didn't consider the headless server guys, but their point is valid.)

                              Welcome Norman. I can see you've been assimilated quite nicely into the JBoss fold.

                              • 12. Re: NoClassDefFoundError
                                Norman Richards Master

                                The best approach to use Seam with the latest 4.0.3SP1 release is to run the 4.0.3SP1 installer to generate a current EJB3 configuration. We don't ship an EJB3 configuration with the 4.0 tar/zip distributions and don't recommend trying to mix and match releases. You are obviously welcome to do that and you are more than welcome to help others do that, but please don't be surprised when someone points out that you are making things unnecessarily complex.

                                • 13. Re: NoClassDefFoundError
                                  Patrick Angeles Novice

                                  hrm....

                                  So I installed 4.0.3SP1 and redeployed my SEAM app... seems to work fine, except that the 'import.sql' file was not read.

                                  Any ideas?

                                  Looks like I might have to update the jars in my dev environment as well to sync up with the ones in 4.0.3SP1...

                                  • 14. Re: NoClassDefFoundError
                                    Louis Coetzee Apprentice

                                     

                                    So I installed 4.0.3SP1 and redeployed my SEAM app... seems to work fine, except that the 'import.sql' file was not read.


                                    I have noticed the same behavior. Very weird as the log file actually states that it is importing the 'import.sql'
                                    INFO [org.hibernate.tool.hbm2ddl.SchemaExport] Executing import script: /import.sql
                                    DEBUG [org.hibernate.tool.hbm2ddl.SchemaExport] insert into service (service_id,name,version) values (170,'One',0)
                                    .
                                    .
                                    .
                                    .

                                    But those values are never inserted into my persistence store.

                                    My environment uses 4.0.3SP1, CVS Seam, and PostgreSQL8.

                                    Later

                                    L

                                    1 2 Previous Next