2 Replies Latest reply on Oct 9, 2002 2:13 AM by Dhiraj

    Configuration of JBOSS with MSSQLServer2000

    Dhiraj Newbie

      Hi Guys ,
      For the past 2 days i have been trying to configure JBoss3.0.3 to work with MSSQLServer2000. I have followed the following steps for configuring JBOSS with SQLServer2000,

      The following are the steps that i have done in JBoss3.0.3 to get it working with SQLServer2000,

      a) Copied mssqlservice.xml to {$JBOSS-HOME}/server/all/deploy/

      b) Copied the 3 jar files given with the driver to {$JBOSS-HOME}/server/all/lib

      c) Changed the standardjbosscmp-jdbc.xml to the following (i am pasting only the part which i have changed.)

      java:/MSSQLDS
      <datasource-mapping>MS SQLSERVER2000</datasource-mapping>

      d) Changed the standardjaws.xml (i am pasting only the part which i have changed.)

      java:/MSSQLDS
      <type-mapping>MS SQLSERVER2000</type-mapping>

      e) Changed the mssql-service.xml to the following ,


      PersonEntity


      <config-property name="ConnectionURL" type="java.lang.String"> jdbc:microsoft:sqlserver://localhost;DatabaseName=ContactInfo</config-property>
      <config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</config-property>
      <!--set these only if you want only default logins, not through JAAS-->
      <config-property name="UserName" type="java.lang.String">sa</config-property>
      <config-property name="Password" type="java.lang.String">sa</config-property>


      <depends optional-attribute-name="ManagedConnectionPool">
      <!--embedded mbean-->

      0
      50
      5000
      15-->
      <!--criteria indicates if Subject (from security domain) or app supplied parameters (such as from getConnection(user, pw)) are used to distinguish
      connections in the pool. Choices are
      ByContainerAndApplication (use both),
      ByContainer (use Subject),
      ByApplication (use app supplied params only),
      ByNothing (all connections are equivalent, usually if adapter supports reauthentication)
      ByContainerAndApplication




      For the above line if i give use the following options it gives me the following error

      a) ByContainerAndApplication - org.jboss.util.NestedSQLException: Need non-null subject for subject/cri based pooling; - nested throwable: (javax.resource.ResourceException:

      b) ByApplication Or ByContainer - Could not create connection; - nested throwable: (java.sql.SQLException: [Microsoft][SQLServer 2000 Driver for JDBC]Error establishing socket.); - nested throwable:

      I will be grateful if u could let me know if ,
      - I have followed the correct steps
      - What is the fix for the problem?

      Thank You very much

      Dhiraj Ramakrishnan



        • 1. Re: Configuration of JBOSS with MSSQLServer2000
          Prasanna Newbie

          Hi,
          What does your JBoss console say?

          It should be some thing like

          INFO [MSSQLDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/MSSQLDS'

          Also while doing lookup you need to mention JNDI name as 'java:/MSSQLDS'.

          If all these are correct check your database server and the url.

          Thanks,
          Prasanna

          • 2. Re: Configuration of JBOSS with MSSQLServer2000
            Dhiraj Newbie

            Hi Prasana,
            Thank You for you response. Yes i am getting the message,
            INFO [MSSQLDS] Bound connection factory for resource adapter 'JBoss LocalTransaction JDBC Wrapper' to JNDI name 'java:/MSSQLDS'
            This while starting and when the bean is not deployed.
            I get these exceptions when i am trying to deploy the bean.

            I have given the name MSSQLDS in mssqlservice.xml and changed the datasource names in StandardJaws.xml and StandardJbossCmp-Jdbc.xml to MSSQLDS

            I have added the resource-ref in ejb-jar.xml which looks like this ,

            <resource-ref>
            <res-ref-name>java:/MSSQLDS</res-ref-name>
            <res-type>javax.sql.DataSource</res-type>
            <res-auth>Container</res-auth>
            </resource-ref>

            Awaiting your response.
            Thanks
            Dhiraj Ramakrishnan