1 Reply Latest reply on Jun 27, 2002 5:18 PM by mkgarnek

    Datasource error

    quitejack

      Hi all

      When I use a datasource to get a connection, it throws a exception like this:
      java.sql.SQLException: ResourceException javax.resource.ResourceException: Wrong
      ManagedConnectionFactory sent to allocateConnection!

      My mssql-service.xml is placed on deploy folder and seems like this
      <?xml version="1.0" encoding="UTF-8"?>

      <!-- ===================================================================== -->
      <!-- -->
      <!-- JBoss Server Configuration -->
      <!-- -->
      <!-- ===================================================================== -->



      <!-- ======================================================================-->
      <!-- New ConnectionManager setup for Microsoft SQL Server 2000 driver -->
      <!-- You may download the latest Microsoft JDBC driver from *Microsoft* -->
      <!-- http://msdn.microsoft.com/downloads/default.asp?url=/downloads/sample.asp?url=/MSDN-FILES/027/001/779/msdncompositedoc.xml&frame=true -->
      <!-- Build jmx-api (build/build.sh all) and view for config documentation -->
      <!-- ===================================================================== -->



      <!-- Include a login module configuration named MSSQLDbRealm.
      Update your login-conf.xml, here is an example for a
      ConfiguredIdentityLoginModule:

      <application-policy name = "MSSQLDbRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
      <module-option name = "principal">yourprincipal</module-option>
      <module-option name = "userName">yourusername</module-option>
      <module-option name = "password">yourpassword</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=MSSQLDS</module-option>
      </login-module>

      </application-policy>

      NOTE: the application-policy name attribute must match SecurityDomainJndiName, and the
      module-option name = "managedConnectionFactoryName"
      must match the object name of the ConnectionManager you are configuring here.
      -->
      <!--comment out this line if you want component managed security or want
      to use the default values in the ManagedConnectionFactoryProperties -->

      MSSQLDbRealm

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


      FlowEngineDataSource



      <config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://mocha:1433;DatabaseName=FlowEngineWork</config-property>
      <config-property name="DriverClass" type="java.lang.String">com.microsoft.jdbc.sqlserver.SQLServerDriver</config-property>
      <config-property name="UserName" type="java.lang.String">sa</config-property>
      <config-property name="Password" type="java.lang.String"></config-property>



      <!--Below here are advanced properties -->
      <!--hack-->
      <depends optional-attribute-name="OldRarDeployment">jboss.jca:service=RARDeployment,name=JBoss LocalTransaction JDBC Wrapper



      <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)-->
      ByContainer



      <depends optional-attribute-name="CachedConnectionManager">jboss.jca:service=CachedConnectionManager

      <depends optional-attribute-name="JaasSecurityManagerService">jboss.security:name=JaasSecurityManager

      java:/TransactionManager
      <!--make the rar deploy! hack till better deployment-->
      jboss.jca:service=RARDeployer





      Does anyone could help ?
      Have I done all the thing for a datasource ?

        • 1. Re: Datasource error
          mkgarnek

          I want to use MS SQL Server 2000 with JBoss 3.0. If you got this working could you post what has to be done to make it work. Where do the MS SQL Server jars go? Is mssql-service.xml the only file that needs to be configured?

          In your original post it looks like you are pooling (?) the microsoft jdbc driver - you specified the driver com.microsoft.jdbc.sqlserver.SQLServerDriver. Can this be done using com.microsoft.jdbcx.sqlserver.SQLServerDataSource which manages its own connection pooling?

          I want to bind the DataSource into a JNDI namespace. Is that done in mssql-service.xml? If so, how is it done? If not, where is this done and how is it done?

          Thanks