9 Replies Latest reply on Sep 18, 2008 8:15 AM by Max Rydahl Andersen

    Can't generate seam entities

    Savvas Sopiadis Newbie

      Hi!
      First of all apologize my realy bad english (i 'm greek) ... and my newbie understandnig of the SEAM-world (i 'm very new to this J2EE stuff).
      My problem is realted to Eclipse 3.4, JBOSS Tools 3.0.0 Alpha and !!GLASSFISH!!
      Had no problem with installing Eclipse, the (nightly build) of JBoss Tools (16/9/2008) into Eclipse (used dropin folder) and downloading and setting up Glassfish v2 driver and the application server. Setup of JBOSS 4.2.1GA into the framework worked also fine without any problem. MySQL driver was also setup, cause Eclipse seems to have problems finding the preconfigured driver.
      JRE used 1.5 .


      First project - no problem: New Seam Web Project->choosing JBOSS 4.2 as the deployment server, using all the default values until the last form. There i choose to create a new connection profile, setting it up properly (trying to ping, which works fine), after that, filling out the fields of Database Schema Name, Database Catalog Name and checking the DB Tables already exists checkbox.
      After this step trying to SEAM GENERATE ENTITIES which works fine!


      Second projet - no way to work: New Seam Web Project->choosing Glassfish as the deployment server and using all the default values until the last form. There i choose as connection profile the one from the previous project. Everything seems to work fine. After this step trying to SEAM GENERATE ENTITIES which DOES NOT WORK AT ALL!!!
      The error i get is:
      Can't generate seam entities
      org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.mysql.jdbc.Driver)
      Problems while loading database driverclass (com.mysql.jdbc.Driver)
      org.hibernate.console.HibernateConsoleRuntimeException: Problems while loading database driverclass (com.mysql.jdbc.Driver)
      Problems while loading database driverclass (com.mysql.jdbc.Driver) java.lang.ClassNotFoundException: com.mysql.jdbc.Driver
      com.mysql.jdbc.Driver


      First i thought it has to do with the installation of Eclipse beeing somehow missconfigured (dont't know how!!). So i reinstalled a fresh Eclipse setup with all the stuff. Tried to create JBOSS based projects which worked fine. As soon as i tried to use Glassfish i got this error.

      Does reverse engeneering not function with Glassfish selected? I searched JIRA but could not find anything similar to this.


      MAAANY thanks in advance

      ssopiadis

        • 1. Re: Can't generate seam entities
          Max Rydahl Andersen Master

          We copy jdbc drivers to the jboss server which then become available in the JBoss runtime classpath which the project(s) are using.

          We cannot do the same for Glassfish so you will need to add the mysql driver manually to the project.

          • 2. Re: Can't generate seam entities
            Savvas Sopiadis Newbie

            Hi max!

            Thank you for this really quick reply!
            Yes it worked indeed!

            By the way...what is the best approach to solve such issues? Include the JBOSS Runtime library into the classpath? Will/can it cause any trouble to the project?

            Thanks again

            ssopiadis

            • 3. Re: Can't generate seam entities
              Max Rydahl Andersen Master

              The best way is what I suggested.

              Adding the jboss runtime library will also make your specific problem go away - but it will probably use different jars than what is in Glassfish.

              Doesn't Glassfish provide a runtime library which includes jdbc driver jars ?

              • 4. Re: Can't generate seam entities
                Savvas Sopiadis Newbie

                Unfortunatelly there are no (MySQL) jdbc drivers included. Actually the list of included jars in the Glassfish runtime library cannot be compared the ones included in the JBOSS library: they are far less!!

                After inlcuding the MysQL library, i succefully reverse engeneered the entities and got "not resolved" issues (e.g org.hibernate). After excluding the MysQL library and including the JBOSS runtime library they went away.

                I also noticed that the jars included in JBOSS runtime library do not exist (and thus not interfear?? with the ones) in the Glassfish runtime library. So i could use them without affecting then project!
                Is this correct?

                Thanks again

                • 5. Re: Can't generate seam entities
                  Max Rydahl Andersen Master

                  the classes in a server adapter runtime does not get deployed to the server since they are assumed to already be there.

                  So if the jars are not either in your project or in glassfish then your project will not work work when deployed but it will compile ;)

                  • 6. Re: Can't generate seam entities
                    Savvas Sopiadis Newbie

                    I do understand quite fine what you say!
                    I experienced it the hard way...tried to deploy and got errors!

                    Is there any tutorial about how to configure Eclipse based Seam projects to be deployed to Glassfish (or to Geronimo). I read Juntao's book and there is some reference to Eclipse and Glassfish, but i think this is outdated cause i think it is SEAM 1.2 based (do the configurations apply also to SEAM 2??). Any proposals?

                    ... this SEAM wolrd seems to be very extraordinary when it comes to configuration for different App Servers! Isn't there a way to simply write a J2EE Seam enabled app and when it comes to deployment, a tool takes over?

                    • 7. Re: Can't generate seam entities
                      Max Rydahl Andersen Master

                      The seam manual has descriptions on how the configuration differ for the various servers.

                      btw. deployment is a small part here. It is about having the right classpath/dependencies setup for the build - that unfortunately varies dependent on what the server runtimes provides/don't provide out-of-box.

                      • 8. Re: Can't generate seam entities
                        Savvas Sopiadis Newbie

                        Thanks very much max!

                        I think i have to dig much deeper...hope not get toooo mudded out ouf it!! :))

                        Unfortunately the Glassfish (or Geronimo) Server is a MUST for this project ... so i have to experiment.

                        Thank you for having talked to you, it was very enlightning for me!!

                        ...from very sunny Greece/Thessaloniki

                        ssopiadis

                        • 9. Re: Can't generate seam entities
                          Max Rydahl Andersen Master

                          You have Geronimo as a must for a project ? I wonder why ?

                          Anyhow - look in seam 2 docs - they have tips for different version of appserver.