Menu

JDBC driver class 'null' appfuse and resume

Help
2003-09-23
2003-09-25
  • Bernard Guillot

    Bernard Guillot - 2003-09-23

    I get this error from appfuse 0.9.1 and cvs struts-resume-cvs

    Some guy on this list said he fixed it by compilling from source but it did not work for me.

    How did you guys fix this problem ?

    I think database.properties should be correctly setup since all the two test works.
         ant test-ejb -Dtestcase=UserDAOTest
         ant test-web -Dtestcase=UserManagerTest

    But  the third test fails with the Following Message
         ant test-canoo -Dtestcase=login
    --->BUILD FAILED
    Test step null named "Home Page follows if login ok" failed with message "Wrong contents found in HTML element (type="title", name="null")! Expected "Resume ~ Main Menu" but got "An error has occurred"" <----

    When using browser to connect to Tomcat when logging in with tomcat/tomcat FAILS with this message

    --->The process did not complete. Details should follow.
    net.sf.hibernate.JDBCException: Cannot open connection: Cannot load JDBC driver class 'null' Cannot open connection: Cannot load JDBC driver class 'null' <----

    Linux Redhat 9.0
    Tomcat 4.1.27
    java 1.4.2_01
    mysql 3.23.54a

     
    • Matt Raible

      Matt Raible - 2003-09-23

      You must run "ant setup-tomcat" before running appfuse or struts-resume in Tomcat.  This copies an appfuse.xml file to $CATALINA_HOME/webapps and also puts the mysql JDBC driver into $CATALINA_HOME/common/lib.  This information should be in the README.txt file.  Let me  know if its not.

      Matt

       
      • Bernard Guillot

        Bernard Guillot - 2003-09-24

        As per the README.txt I followed all the instruction and it still failed.

        It is describe to do a ant setup-tomcat deploy.

        The appfuse.xml and struts-resume.xml are in the webapps dir. Also checked the mysql-Connector is in common/lib

        There are two section in the appfuse.xml

        It is puzzling ....

        Any other suggestion ?

         
        • Matt Raible

          Matt Raible - 2003-09-24

          Make sure you can login with the username/password specified in appfuse.xml. 

          mysql -u username -p appfuse

          (you will be prompted for the password).

          This may give you an access denied error - if so, it's a permissions problem on MySQL.

           
      • Bernard Guillot

        Bernard Guillot - 2003-09-24

        Found some errors in the Logs

        2003-09-24 22:07:01 HostConfig[localhost]: Deploying configuration descriptor struts-resume.xml2003-09-24 22:07:23 StandardHost[localhost]: ContainerBase.addChild: start:
        LifecycleException:  Exception opening database connection:  java.sql.SQLException: Server connection failure during transaction.
        Attempted reconnect 3 times. Giving up.
                at org.apache.catalina.realm.JDBCRealm.start(JDBCRealm.java:681)
                at org.apache.catalina.core.StandardContext.start(StandardContext.java:3544)
                at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:821)
                at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:807)
                at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:579)
                at org.apache.catalina.core.StandardHostDeployer.addChild(StandardHostDeployer.java:700)

         
        • Matt Raible

          Matt Raible - 2003-09-24

          Your username and password is wrong for your appfuse MySQL server.  The easiest thing to do is "mysqladmin drop appfuse" and then run "ant setup-db" again.  Otherwise, you can set the permissions manually:

          grant all privileges on appfuse.* to test@"%" identified by "test";
          grant all privileges on appfuse.* to test@localhost identified by "test";

           
          • Bernard Guillot

            Bernard Guillot - 2003-09-25

            OK it's now working.

            The only change was to add to the struts-resume/metadata/sql/mysql-create.sql

            add one more line like
            grant all privileges on appfuse.* to test@myhost.mycompany.com identified by "test";

            And like you said mysql drop database resume; then
            ant setup-db

            so it was just that the latest mysql detect the server hostname and was using it.

            Thanks for the help

             
            • Matt Raible

              Matt Raible - 2003-09-25

              I've seen this happen before, but since I can't detect the computer name in build.xml (or at least I don't know how), I haven't done this yet. 

              One user has recently contributed a patch that may fix this - I'll make a note about this in the create script in the meantime.

              Thanks,

              Matt

               
    • Bernard Guillot

      Bernard Guillot - 2003-09-24

      Tested and functional

      used mysql -u root -h myhost -p appfuse
      with the same password and it is OK

       

Log in to post a comment.