2 Replies Latest reply on Nov 20, 2006 1:06 AM by russray

    Where's the Binding?

    russray

      I am running MyEclipse 5.1 with JBoss4.0.5. I have ported my code over from WSAD to MyEclipse 5.1 I have removed all my IBM specific files and started anew. I have the projects build and deploying to JBoss on my local machine. I have a data source setup to a SQL Server database. I can start the server with no errors. When I bring up the Application within a browser, I receive the below error.

      20:38:23,421 FATAL [ConfigException] {ServiceLocator}{getDataSource}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:jdbc not bound}
      {ServiceLocator}{getDataSource}{CONFIG0001}{Failed to find EJB Reference from JNDI tree}{External Message:jdbc not bound}
      


      What is interesting is my data source is identified with the -ds.xml and the tables are created specifically for JMS, so I know the database is accessible. I have looked on the web and can see the following is recommended.


      In the jboss-web.xml

      <jboss-web>
       <resource-ref>
       <res-ref-name>jdbc/pidbdev</res-ref-name>
       <jndi-name>java:jdbc/pidbdev</jndi-name>
       </resource-ref>
      </jboss-web>
      



      In the web.xml

       <resource-ref>
       <description>DB Connection</description>
       <res-ref-name>jdbc/pidbdev</res-ref-name>
       <res-type>javax.sql.DataSource</res-type>
       <res-auth>Container</res-auth>
       </resource-ref>
      



      And the data source -ds.xml


       datasources>
      - <xa-datasource>
       <jndi-name>jdbc/pidbdev</jndi-name>
       <track-connection-by-tx />
       <isSameRM-override-value>false</isSameRM-override-value>
       <xa-datasource-class>com.microsoft.jdbcx.sqlserver.SQLServerDataSource</xa-datasource-class>
       <xa-datasource-property name="ServerName">meserver</xa-datasource-property>
       <xa-datasource-property name="DatabaseName">medb</xa-datasource-property>
       <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
      - <!-- not sure if these should be here
       -->
       <user-name>user1</user-name>
       <password>pwd1</password>
      - <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional)
       -->
      - <metadata>
       <type-mapping>MS SQLSERVER2000</type-mapping>
       </metadata>
       </xa-datasource>
       </datasources>
      


      When I look through the server logs, I see the following item telling me everything is correctly attached:

       [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/pidbdev' to JNDI name 'java:jdbc/pidbdev'
      


      Any help would be greatly appreciated.....

      Thank you for readding my post...

      Russ

        • 1. Re: Where's the Binding?
          russray

          I have gone back and re-installed the Application Server and ensured I declared only one datasource for our projects. Now I can not get a connection.

          00:38:27,677 INFO [WrapperDataSourceService] Bound ConnectionManager 'jboss.jca:service=DataSourceBinding,name=jdbc/pidbdev' to JNDI name 'java:jdbc/pidbdev'
          00:38:27,724 WARN [JBossManagedConnectionPool] Throwable while attempting to get a new connection: null
          org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.lang.ClassCastException: com.microsoft.jdbc.sqlserver.SQLServerDriver)
          


          The XML files remained the same. The previous install did not extablish a default database. SQL Server really the secondary DB.

          I am hoping someone will throw me a bone here.....

          • 2. Re: Where's the Binding?
            russray

            I updated my -ds.xml to the correct settings for SQL Server and it all worked.