10 Replies Latest reply on Feb 28, 2006 8:50 AM by squishy

    Error: can't find data source: java:/MSSQLDS

    squishy

      Hello,
      I'm trying to run JBoss 4.03SP1 together with MS SQLSERVER 2000 for a company page using JSP.
      But I'm stuck on configuring the database.

      I donwloaded and installed the JDBC drivers for MSSQL2000.

      my mssql-ds.xml looks as follows:

      <datasources>
       <local-tx-datasource>
       <jndi-name>MSSQLSERVER2000</jndi-name>
       <connection-url>jdbc:microsoft:sqlserver://w2k-praktikant\webfactory;SelectMethod=cursor;DatabaseName=KVN_Allershausen</connection-url>
       <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
       <user-name>sa</user-name>
       <password>webfactory</password>
       <!-- sql to call when connection is created
       <new-connection-sql>some arbitrary sql</new-connection-sql>
       -->
      
       <!-- sql to call on an existing pooled connection when it is obtained from pool
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>
       <type-mapping>MSSQLSERVER2000</type-mapping>
       </metadata>
       </local-tx-datasource>
      
      </datasources>


      I changed the standardjbosscmp-jdbc.xml maybe that isnt such a good idea?

      in it i changed:
       <datasource>MSSQLDS</datasource>
       <datasource-mapping>MSSQLSERVER2000</datasource-mapping>
      


      nothing else changed.

        • 1. Re: Error: can't find data source: java:/MSSQLDS
          squishy

          is there an edit button in this forum??

          the error message i get (i get about 100 of the same type, but i'll post only 1 :-) )

          org.jboss.deployment.DeploymentException: Error: can't find data source: java:/MSSQLDS; - nested throwable: (javax.naming.NameNotFoundException: MSSQLDS not bound)
          


          • 2. Re: Error: can't find data source: java:/MSSQLDS
            jaikiran

            I am not sure while deploying which component, you are getting this exception. I believe that component has a dependency on the MSSQLDS. I believe, you are trying to configure the MSSQL datasource through the mssql-ds.xml file, that you have posted. Doing the following change in the mssql-ds.xml file, might solve the issue for you:

            Change:

            <jndi-name>MSSQLSERVER2000</jndi-name>


            to:

            <jndi-name>MSSQLDS</jndi-name>




            • 3. Re: Error: can't find data source: java:/MSSQLDS
              squishy

              if i do that the error message changes to

              org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping MSSQLSERVER2000 not found

              which is the name from before :o
              seems like a quandary to me

              • 4. Re: Error: can't find data source: java:/MSSQLDS
                jaikiran

                I dont have much knowledge of what jbosscmp-jdbc.xml is meant for. I am not sure what made you change, the standardjbosscmp-jdbc.xml. If you dont have any specific reasons for this change then i would advice you to undo the changes to the standardjbosscmp-jdbc.xml and also remove the following from mssql-ds.xml:


                <metadata>
                <type-mapping>MSSQLSERVER2000</type-mapping>
                </metadata>




                • 5. Re: Error: can't find data source: java:/MSSQLDS
                  jaikiran

                  Went through the standardjbosscmp-jdbc.xml. I think this is what you
                  have to do:

                  1) Undo the changes that you did to standardjbosscmp-jdbc.xml(let this file be the same as shipped by JBoss)

                  2) In your mssql-ds.xml do the following change:
                  Change,

                  <metadata>
                  <type-mapping>MSSQLSERVER2000</type-mapping>
                  </metadata>


                  to:

                  <metadata>
                   <type-mapping>MS SQLSERVER</type-mapping>
                   </metadata>

                  Also, as initially mentioned change the following in mssql-ds.xml:

                  Change,
                  <jndi-name>MSSQLSERVER2000</jndi-name>

                  to:
                  <jndi-name>MSSQLDS</jndi-name>


                  Try this out. This might work.





                  • 6. Re: Error: can't find data source: java:/MSSQLDS
                    jaikiran

                    Oops, there was mistake in the previous post:

                    Change,


                    <metadata>
                    <type-mapping>MSSQLSERVER2000</type-mapping>
                    </metadata>


                    to

                    <metadata>
                     <type-mapping>MS SQLSERVER2000</type-mapping>
                     </metadata>


                    Notice the space in the MS SQLSERVER2000.



                    • 7. Re: Error: can't find data source: java:/MSSQLDS
                      squishy

                      i took fresh files and removed the entry from mssql-ds.xml
                      still the same error. :(

                      • 8. Re: Error: can't find data source: java:/MSSQLDS
                        jaikiran

                        Which error are you reffering to? The datasource not bound or the other one? This is how your mssql-ds.xml should look:

                        <datasources>
                         <local-tx-datasource>
                         <jndi-name>MSSQLDS</jndi-name>
                         <connection-url>jdbc:microsoft:sqlserver://w2k-praktikant\webfactory;SelectMethod=cursor;DatabaseName=KVN_Allershaus
                        en</connection-url>
                         <driver-class>com.microsoft.jdbc.sqlserver.SQLServerDriver</driver-class>
                         <user-name>sa</user-name>
                         <password>webfactory</password>
                         <!-- sql to call when connection is created
                         <new-connection-sql>some arbitrary sql</new-connection-sql>
                         -->
                        
                         <!-- sql to call on an existing pooled connection when it is obtained from pool
                         <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
                         -->
                         <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
                         <metadata>
                         <type-mapping>MS SQLSERVER2000</type-mapping>
                         </metadata>
                         </local-tx-datasource>
                        
                        </datasources>


                        • 9. Re: Error: can't find data source: java:/MSSQLDS
                          squishy

                          Okay thanks a lot that seems to have done the trick with the database.
                          thanks alot!

                          got another error now tho ;)

                          • 10. Re: Error: can't find data source: java:/MSSQLDS
                            squishy

                            still the same error as before

                            org.jboss.deployment.DeploymentException: Error in jbosscmp-jdbc.xml : datasource-mapping MSSQLSERVER2000 not found
                            


                            with a fresh install (standard files are all standard)

                            nowhere in my files "MSSQLSERVER2000" is mentioned! i only use "MS SQLSERVER2000" !

                            help please :o