3 Replies Latest reply on Jul 25, 2008 10:27 AM by jaikiran

    could not find datasource

    1womps1

      sorry my last post didn't show up here is my problem

      i'm trying to install seam on tomcat,and i have a problem wich is blocking me,the server can't find the datasource,here is a part from the stacktrace

      GRAVE: Could not find datasource: java:/mysqlds
      javax.naming.NameNotFoundException: Le Nom mysqlds n'est pas lié à ce Contexte
       at org.apache.naming.NamingContext.lookup(NamingContext.java:770)
       at org.apache.naming.NamingContext.lookup(NamingContext.java:153)
       at org.apache.naming.SelectorContext.lookup(SelectorContext.java:137)
       at javax.naming.InitialContext.lookup(Unknown Source)
       at org.hibernate.connection.DatasourceConnectionProvider.configure(DatasourceConnectionProvider.java:52)
       at org.hibernate.connection.ConnectionProviderFactory.newConnectionProvider(ConnectionProviderFactory.java:124)|
      

      i have created a file mysql-ds.xml in seam\bootstrap\deploy ,and deleted hsql-ds.xml since i'm working with mysql here is the file

      <datasources>
       <local-tx-datasource>
       <jndi-name>MySqlDS</jndi-name>
       <connection-url>jdbc:mysql://mysql-hostname:3306/jbossdb</connection-url>
       <driver-class>com.mysql.jdbc.Driver</driver-class>
       <user-name>x</user-name>
       <password>y</password>
       <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLExceptionSorter</exception-sorter-class-name>
       <!-- should only be used on drivers after 3.22.1 with "ping" support
       <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.MySQLValidConnectionChecker</valid-connection-checker-class-name>
       -->
       <!-- 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 - MySQLValidConnectionChecker is preferred for newer drivers
       <check-valid-connection-sql>some arbitrary sql</check-valid-connection-sql>
       -->
      
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
       <metadata>
       <type-mapping>mySQL</type-mapping>
       </metadata>
       </local-tx-datasource>
      </datasources>
      
      

      could you please help me to figure out where is the problem

        • 1. Re: could not find datasource
          jaikiran

           

          org.apache.naming.NamingContext


          You should be using the JBoss specific initial context properties, through jndi.properties file. See this for details http://www.jboss.com/index.html?module=bb&op=viewtopic&t=135363

          • 2. Re: could not find datasource
            1womps1

            Do you mean that i have to configure my jndi.properties?
            I'm just trying to deploy the registration example and i have this error.i haven't touched the source code

            • 3. Re: could not find datasource
              jaikiran

               

              i'm trying to install seam on tomcat


              You mean, you are deploying your application on a standalone tomcat right? And going by the exception stacktrace, that's what you are doing, i believe.

              i have created a file mysql-ds.xml in seam\bootstrap\deploy


              The "deploy" folder is specific to JBoss.

              I am a bit confused (maybe because of my lack of Seam knowledge?). Why are you deploying the datasource into JBoss and your application in Tomcat?

              Could you please provide more details about what exactly you are doing and how the application is being deployed? That will help us in pointing out, what is wrong.