1 Reply Latest reply on Sep 26, 2005 4:10 AM by kasch1980

    in trouble! need help

    zzl886

      i have finished a app for searching in tomcat ,now i need deploy it in jboss.
      so i change the search to search.war.and copy to the path c:\jboss\server\default\deploy,and put a sybase-ds.xml to the path,which has been editted and the datasource name is "jdbc/hello"
      then a archive the jdbc driver that is "com/sybase/.." named com.jar and
      copy it to c:\jboss\server\default\lib.
      after that i start the jboss ,and there is a exception means the datasource name in web.xml not a jndi name,so i cut the "<ref-resoure>....." from the web.xml,
      then start the jboss again,it works well,aslo a information mens "java:jdbc/hello"datasource bunding.,but when i open a jsp page.appearing a exception,"the datasource invalid :no suitable driver"!
      so what's wrong ?could you help me ,i appreciate it ...

        • 1. Re: in trouble! need help
          kasch1980

          For an jdbc datasource you have to define an specific Driver in your xml:

          <datasources>
           <local-tx-datasource>
          
           <jndi-name>MySqlDS</jndi-name>
          
           <connection-url>jdbc:mysql://localhost:3306/database</connection-url>
           <driver-class>com.mysql.jdbc.Driver</driver-class>
          
           <user-name>username</user-name>
           <password>secret</password>
          
           <connection-property name="autoReconnect">true</connection-property>
          
           <!-- Typemapping for JBoss 4.0 -->
           <metadata>
           <type-mapping>mySQL</type-mapping>
           </metadata>
          
           </local-tx-datasource>
          </datasources>


          It looks like your Driver class does not match to your DataSource

          Also look: http://wiki.jboss.org/wiki/Wiki.jsp?page=SetUpAMysqlDatasource