0 Replies Latest reply on Mar 5, 2014 5:58 AM by tommuck1

    JNDI data source

    tommuck1

      I'm trying to use a JNDI data source in CF 10. We used to do it in CF 8 in the JRun admin, and was able to use data sources across coldFusion and java code. Any ideas on how to make it work in CF 10? I've tried several online resources, setting up a resource in Context.xml:

        <Resource name="mydatasource" auth="Container" type="javax.sql.DataSource"

                     maxActive="100" maxIdle="30" maxWait="10000"

                     username="myuser" password="mypass" driverClassName="macromedia.jdbc.MacromediaDriver"

                     url="jdbc:macromedia:sqlserver://127.0.0.1:1433;databaseName=mydb;SendStringParametersAsU nicode=false;SendStringAsUnicode=false"/>

       

      then a resource-ref in web.xml

      <resource-ref>

            <description>DB Connection</description>

            <res-ref-name>mydatasource</res-ref-name>

            <res-type>javax.sql.DataSource</res-type>

            <res-auth>Container</res-auth>

                  </resource-ref>

       

       

      but I'm getting errors

       

      java.lang.IllegalArgumentException: Cannot convert value of type [jav

      a.lang.String] to required type [javax.sql.DataSource] for property 'dataSource'

      : no matching editors or conversion strategy found