7 Replies Latest reply on Jul 7, 2009 1:13 PM by hubaghdadi

    Database connectivity error

    hubaghdadi

      Hey,


      I'm trying to deploy Seam skeleton application on JBoss AS 4.2.3


      The environment is:


      Seam 2.1.2


      MySQL 5.x


      MySQL JDBC driver 5.1.6


      But I'm getting this exception:



      16:32:58,602 WARN  [SettingsFactory] Could not obtain connection metadata
      org.jboss.util.NestedSQLException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql://domain/appdb?characterEncoding=utf-8); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (org.jboss.resource.JBossResourceException: Apparently wrong driver class specified for URL: class: com.mysql.jdbc.Driver, url: jdbc:mysql://domain/appdb?characterEncoding=utf-8))





        • 1. Re: Database connectivity error
          sherkan777

          post your db conf.

          • 2. Re: Database connectivity error
            hubaghdadi

            The datasource file:



            <datasources>   
               <local-tx-datasource>
                  <jndi-name>SmsBulkSendDatasource</jndi-name>
                  <use-java-context>false</use-java-context>
                  <connection-url>jdbc:mysql://domain/appdb?characterEncoding=utf-8</connection-url>
                  <driver-class>com.mysql.jdbc.Driver</driver-class>
                  <user-name>smsbulk_user</user-name>
                  <password>pass</password>
               </local-tx-datasource>   
            </datasources>



            persistence.xml:



               <persistence-unit name="SmsBulkSend" transaction-type="JTA">
                  <provider>org.hibernate.ejb.HibernatePersistence</provider>
                  <jta-data-source>SmsBulkSendDatasource</jta-data-source>
                  <properties>
                     <property name="hibernate.dialect" value="org.hibernate.dialect.MySQL5Dialect"/>
                     <property name="hibernate.hbm2ddl.auto" value="update"/>
                     <property name="hibernate.show_sql" value="true"/>
                     <property name="hibernate.format_sql" value="true"/>
                      <property name="hibernate.cache.provider_class" value="org.hibernate.cache.HashtableCacheProvider"/>
                  </properties>
               </persistence-unit>





            • 3. Re: Database connectivity error
              sherkan777

              What is your db driver?


              Read your error msg



               Apparently wrong driver class specified for URL



              • 4. Re: Database connectivity error
                hubaghdadi

                mysql-connector-java-5.1.6-bin.jar

                • 5. Re: Database connectivity error
                  sherkan777

                  and driver jar is in



                  <jboss AS>/server/default/lib 



                  • 6. Re: Database connectivity error
                    sherkan777

                    nah,
                    Is what is this domain


                    first try to connect without encoding like this:




                    <connection-url>jdbc:mysql://localhost:3306/test</connection-url>



                    • 7. Re: Database connectivity error
                      hubaghdadi

                      Thanks.