7 Replies Latest reply on Nov 28, 2002 10:05 AM by CL Gilbert

    MSSQL..  $&%#&$%#&" problem ! :(

    Siggi Newbie


      Hope some of you out there..have any tips for me on how to get Jboss3 to accept Mssql database connection

      I HAVE TRIED EVERYTING !!!!!!!! I have f.... lost it.. trying to get this thing to work

      The files i allready changed are

      mmsql-service.xml and login-config.xml

      here they are !!

      first login-config.xml

      <!-- The XML based JAAS login configuration read by the
      org.jboss.security.auth.login.XMLLoginConfig mbean. Add
      an application-policy element for each security domain.

      The outline of the application-policy is:
      <application-policy name="security-domain-name">

      <login-module code="login.module1.class.name" flag="control_flag">
      <module-option name = "option1-name">option1-value</module-option>
      <module-option name = "option2-name">option2-value</module-option>

      <login-module code="login.module2.class.name" flag="control_flag">


      $Revision: $

      <!-- Used by clients within the application server VM such as
      mbeans and servlets that access EJBs.
      <application-policy name = "client-login">

      <login-module code = "org.jboss.security.ClientLoginModule"
      flag = "required">


      <!-- Security domain for JBossMQ -->
      <application-policy name = "jbossmq">

      <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
      flag = "required">
      <module-option name = "unauthenticatedIdentity">guest</module-option>
      <module-option name = "sm.objectnam">jboss.mq:service=StateManager</module-option>


      <!-- Security domains for testing new jca framework -->

      <application-policy name = "HsqlDbRealm">

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


      <application-policy name = "FirebirdDBRealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
      flag = "required">
      <module-option name = "principal">sysdba</module-option>
      <module-option name = "userName">sysdba</module-option>
      <module-option name = "password">masterkey</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=FirebirdDS</module-option>


      <application-policy name = "MSSQLDbRealm">

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


      <application-policy name = "JmsXARealm">

      <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule"
      flag = "required">
      <module-option name = "principal">guest</module-option>
      <module-option name = "userName">guest</module-option>
      <module-option name = "password">guest</module-option>
      <module-option name = "managedConnectionFactoryName">jboss.jca:service=XaTxCM,name=jmsra</module-option>


      <!-- The default login configuration used by any security domain that
      does not have a application-policy entry with a matching name
      <application-policy name = "other">
      <!-- A simple server login module, which can be used when the number
      of users is relatively small. It uses two properties files:
      users.properties, which holds users (key) and their password (value).
      roles.properties, which holds users (key) and a comma-separated list of
      their roles (value).
      The unauthenticatedIdentity property defines the name of the principal
      that will be used when a null username and password are presented as is
      the case for an unuathenticated web client or MDB. If you want to
      allow such users to be authenticated add the property, e.g.,

      <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
      flag = "required" />



      Then the mssql-service.xml

      <?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 -->
      <!-- ===================================================================== -->

      <!--comment out this line if you want component managed security or want
      to use the default values in the ManagedConnectionFactoryProperties-->

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


      <config-property name="ConnectionURL" type="java.lang.String">jdbc:microsoft:sqlserver://;DatabaseName=IG_Test</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"></config-property>
      <config-property name="Password" type="java.lang.String"></config-property>

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

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

      <!--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

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

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

      <!--make the rar deploy! hack till better deployment-->


      everytime.. i change the mssql-service.xml file .. i watch the output on the screen.. witch in every case..no matter what i do... returns this !!

      16:09:41,213 WARN [ServiceController] jboss.jca:service=LocalTxDS,name=MSSQLDS does not implement any Service methods
      16:09:41,214 INFO [JBossManagedConnectionPool] Creating
      16:09:41,215 INFO [JBossManagedConnectionPool] Created
      16:09:41,219 INFO [JBossManagedConnectionPool] Starting
      16:09:41,220 INFO [JBossManagedConnectionPool] Started
      16:09:41,222 INFO [MainDeployer] Successfully completed deployment of package: file:/var/jboss/server/default/deploy/mssql-service.xml

      Hope someone ..can help me.. because if not.. i have to check myself into a looneybin...


        • 1. Re: MSSQL..  $&%#&$%#&" problem ! :(
          David Jencks Master

          Did you try to see if the datasource is bound in jndi and if it works? The "warning" is a bit of obsolete code that may have once meant something but really doesn't any more. It's gone from cvs head.

          In other words from what you show your datasource is deploying fine.

          • 2. Re: MSSQL..  $&%#&$%#&" problem ! :(
            Siggi Newbie

            Ok i took a look at the output.. when i connect to the internet site where the connection i to take place.. and when i did.. ! I got this.

            !Embedded Exception
            BGPDS not bound; nested exception is:
            javax.ejb.EJBException: null
            Embedded Exception
            BGPDS not bound
            javax.ejb.EJBException: null
            Embedded Exception
            BGPDS not bound

            So what do i do now ?! :)


            • 3. Re: MSSQL..  $&%#&$%#&" problem ! :(
              David Jencks Master

              I don't really see how you expect anyone to guess what the problem might be from the information you provide, but I wonder if you are trying to get a connection in a different vm from jboss? This is not possible. The java:/ environment is accessible only within the jboss vm.

              • 4. Re: MSSQL..  $&%#&$%#&" problem ! :(
                srinivas challa Newbie

                if you are using JBoss 3.x than configure the following

                1. mysql-service.xml change mysql parameter in file and copy to server/default/deploy diectory.
                2. then add mysql-connector-java-2.0.14-bin.jar classpath to JBOSS_CLASSPATH
                3. start the JBoss and you can see the deployment of connection pool in console with jndi name.

                in mysql-service.xml like ..


                <config-property name="ConnectionURL" type="java.lang.String">jdbc:mysql://localhost:3306/aptlc</config-property>
                <config-property name="DriverClass" type="java.lang.String">com.mysql.jdbc.Driver</config-property>
                <!--set these only if you want only default logins, not through JAAS -->
                <config-property name="UserName" type="java.lang.String"></config-property>
                <config-property name="Password" type="java.lang.String"></config-property>

                from client call thru jndi like ...

                InitialContext initCtx = null;
                initCtx = new InitialContext();
                DataSource ds = (javax.sql.DataSource)initCtx.lookup("java:MySqlDS");

                try the above steps.


                • 5. Re: MSSQL..  $&%#&$%#&" problem ! :(
                  naresh maharaj Newbie

                  Wanted to know if you finally got Jboss to work with MSSQLServer2000 and if so where can i find out what steps to take in order to get a datasource connected. Am a 'newbie' to JBoss

                  • 6. Re: MSSQL..  $&%#&$%#&" problem ! :(
                    Bryan Newbie

                    I SHARED THE SAME ERROR/EMOTION.
                    The data source is deployed, but the service is not started and the JNDI is not bound. Got the xml, micro$oft jars in classpaths and all, but it's just not coming up.

                    Anybody cna post the step-by-step FOR SQL2K would be the savior of many lost souls around here.

                    PS> I despite the fact that every 0.01 update, they change the bejesus out of the configs files.

                    • 7. Re: MSSQL..  $&%#&$%#&" problem ! :(
                      CL Gilbert Newbie

                      Can you deploy tp the DefaultDS name? You should try that first. Their seem to be issues with using a different datasource named other than DefaultDS. Im sure its just a matter of education, but first step I think is to use DefaultDS.