0 Replies Latest reply on Dec 27, 2010 4:25 AM by PagesOfJoy

    Problem in establishing connection between Oracle 11g database and jboss

    PagesOfJoy Level 1

      I am using Oracle 11g database to store my forms data from the process.First i created username,password,database and a sample table in the Oracle Database.In reference with the Adobe Prepare single install pdf file i have edited adobe-ds.xml,oracle-ds.xml and login-config.xml files.I copied the ojdbc6.jar file in the lib folder to make the connection.At the end of my process i used an Execute Sql Statement operation to write the insert query.After inserting the sql query and testing am getting the error message as

      "Exception: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: The Network Adapter could not establish the connection); - nested throwable: (org.jboss.resource.JBossResourceException: Could not create connection; - nested throwable: (java.sql.SQLException: Io exception: The Network Adapter could not establish the connection))"  .

       

      I am providing the three files which i have edited:

      Adobe-ds.xml

       

      <?xml version="1.0" encoding="UTF-8"?>
      <datasources>
      <local-tx-datasource>
        <jndi-name>IDP_DS</jndi-name>
        <connection-url>jdbc:mysql://localhost:1138/adobe</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <!-- modified by installer to encrypt password -->
        <security-domain>EncryptDBPassword_IDP_DS</security-domain>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>30</max-pool-size>
        <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectio nChecker</valid-connection-checker-class-name>
        <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorte r</exception-sorter-class-name> 
        <new-connection-sql>SELECT count(*) from DUAL</new-connection-sql>
        <check-valid-connection-sql>SELECT count(*) from DUAL</check-valid-connection-sql>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </local-tx-datasource>

      <local-tx-datasource>
        <jndi-name>EDC_DS</jndi-name>
        <connection-url>jdbc:mysql://localhost:1138/adobe</connection-url>
        <driver-class>com.mysql.jdbc.Driver</driver-class>
        <!-- modified by installer to encrypt password -->
        <security-domain>EncryptDBPassword_EDC_DS</security-domain>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>20</max-pool-size>
        <valid-connection-checker-class-name>com.mysql.jdbc.integration.jboss.MysqlValidConnectio nChecker</valid-connection-checker-class-name>
        <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorte r</exception-sorter-class-name> 
        <new-connection-sql>SELECT count(*) from DUAL</new-connection-sql>
        <check-valid-connection-sql>SELECT count(*) from DUAL</check-valid-connection-sql>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </local-tx-datasource>
      <!--
      <local-tx-datasource>
        <jndi-name>IDP_DS</jndi-name>
        <connection-url>jdbc:oracle:thin:@buniyaproject.aleron-auh:1521/DB1</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>adobe</user-name>
        <password>adobe</password>
                      <min-pool-size>1</min-pool-size>
        <max-pool-size>30</max-pool-size>
                      <exception-sorter-class-name>
        org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
        </exception-sorter-class-name>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </local-tx-datasource>

      <local-tx-datasource>
        <jndi-name>EDC_DS</jndi-name>
        <connection-url>jdbc:oracle:thin:@buniyaproject.aleron-auh:1521/DB1</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>adobe</user-name>
        <password>adobe</password>
        <min-pool-size>1</min-pool-size>
        <max-pool-size>20</max-pool-size>
                      <exception-sorter-class-name>
        org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
        </exception-sorter-class-name>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </local-tx-datasource>

      -->
      </datasources>

       

      Oracle-ds.xml


      <?xml version="1.0" encoding="UTF-8"?>

       

      <datasources>

      <local-tx-datasource>
        <jndi-name>Sample</jndi-name>
        <connection-url>jdbc:oracle:thin:@buniyaproject.aleron-auh:1521/DB1</connection-url>
        <driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
        <user-name>adobe</user-name>
        <password>adobe</password>
                      <min-pool-size>1</min-pool-size>
        <max-pool-size>30</max-pool-size>
                      <exception-sorter-class-name>
        org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter
        </exception-sorter-class-name>
        <blocking-timeout-millis>20000</blocking-timeout-millis>
        <idle-timeout-minutes>2</idle-timeout-minutes>
        <prepared-statement-cache-size>20</prepared-statement-cache-size>
        <transaction-isolation>TRANSACTION_READ_COMMITTED</transaction-isolation>
      </local-tx-datasource>

       

      login-config.xml

      <?xml version='1.0'?>
      <!DOCTYPE policy PUBLIC
            "-//JBoss//DTD JBOSS Security Config 3.0//EN"
            "http://www.jboss.org/j2ee/dtd/security_config.dtd">

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

          <login-module code="login.module2.class.name" flag="control_flag">
            ...
          </login-module>
          ...
        </authentication>
      </application-policy>


      -->

      <policy>
          <!-- Used by clients within the application server VM such as
          mbeans and servlets that access EJBs.
          -->
          <application-policy name = "client-login">
             <authentication>
                <login-module code = "org.jboss.security.ClientLoginModule"
                   flag = "required">
                   <!-- Any existing security context will be restored on logout -->
                   <module-option name="restore-login-identity">true</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <!-- Security domain for JBossMQ -->
          <application-policy name = "jbossmq">
             <authentication>
                <login-module code = "org.jboss.security.auth.spi.DatabaseServerLoginModule"
                   flag = "required">
                   <module-option name = "unauthenticatedIdentity">guest</module-option>
                   <module-option name = "dsJndiName">java:/DefaultDS</module-option>
                   <module-option name = "principalsQuery">SELECT PASSWD FROM JMS_USERS WHERE USERID=?</module-option>
                   <module-option name = "rolesQuery">SELECT ROLEID, 'Roles' FROM JMS_ROLES WHERE USERID=?</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <!-- Security domain for JBossMQ when using file-state-service.xml
          <application-policy name = "jbossmq">
             <authentication>
                <login-module code = "org.jboss.mq.sm.file.DynamicLoginModule"
                   flag = "required">
                   <module-option name = "unauthenticatedIdentity">guest</module-option>
                   <module-option name = "sm.objectname">jboss.mq:service=StateManager</module-option>
                </login-module>
             </authentication>
          </application-policy>
          -->

          <!-- Security domains for testing new jca framework -->
          <application-policy name = "HsqlDbRealm">
             <authentication>
                <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=DefaultDS</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <application-policy name = "JmsXARealm">
             <authentication>
                <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=TxCM,name=JmsXA</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <!-- A template configuration for the jmx-console web application. This
            defaults to the UsersRolesLoginModule the same as other and should be
            changed to a stronger authentication mechanism as required.
          -->
          <application-policy name = "jmx-console">
             <authentication>
                <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
                   flag = "required">
                 <module-option name="usersProperties">props/jmx-console-users.properties</module-option>
                 <module-option name="rolesProperties">props/jmx-console-roles.properties</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <!-- A template configuration for the web-console web application. This
            defaults to the UsersRolesLoginModule the same as other and should be
            changed to a stronger authentication mechanism as required.
          -->
          <application-policy name = "web-console">
             <authentication>
                <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
                   flag = "required">
                   <module-option name="usersProperties">web-console-users.properties</module-option>
                   <module-option name="rolesProperties">web-console-roles.properties</module-option>
                </login-module>
             </authentication>
          </application-policy>

          <!--
            A template configuration for the JBossWS security domain.
            This defaults to the UsersRolesLoginModule the same as other and should be
            changed to a stronger authentication mechanism as required.
          -->
          <application-policy name="JBossWS">
            <authentication>
              <login-module code="org.jboss.security.auth.spi.UsersRolesLoginModule"
                flag="required">
                <module-option name="usersProperties">props/jbossws-users.properties</module-option>
                <module-option name="rolesProperties">props/jbossws-roles.properties</module-option>
                <module-option name="unauthenticatedIdentity">anonymous</module-option>
              </login-module>
            </authentication>
          </application-policy>

          <!-- 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.,
             unauthenticatedIdentity="nobody"
             -->
             <authentication>
                <login-module code = "org.jboss.security.auth.spi.UsersRolesLoginModule"
                   flag = "required" />
             </authentication>
          </application-policy>

      <application-policy name = "OracleDbRealm">
            <authentication>
              <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
                <module-option name = "principal">adobe</module-option>
                <module-option name = "userName">adobe</module-option>
                <module-option name ="password">adobe</module-option>
                <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=Sample</module-option>
              </login-module>
            </authentication>
          </application-policy>

          <application-policy name = "MySqlDbRealm">
            <authentication>
              <login-module code = "org.jboss.resource.security.ConfiguredIdentityLoginModule" flag = "required">
                <module-option name = "principal">adobe</module-option>
                <module-option name = "userName">adobe</module-option>
                <module-option name ="password">5dfc52b51bd35553df8592078de921bc</module-option>
                <module-option name = "managedConnectionFactoryName">jboss.jca:service=LocalTxCM,name=DefaultDS</module-option>
              </login-module>
            </authentication>
          </application-policy>

      <!-- installation added the following policies -->

      <application-policy name="EncryptDBPassword">
              <authentication>
                  <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
                      <module-option name="username">adobe</module-option>
                      <module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
                      <module-option name="managedConnectionFactoryName">jboss.jca:name=DefaultDS,service=LocalTxCM</module-op tion>
                  </login-module>
              </authentication>
          </application-policy>
          <application-policy name="EncryptDBPassword_IDP_DS">
              <authentication>
                  <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
                      <module-option name="username">adobe</module-option>
                      <module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
                      <module-option name="managedConnectionFactoryName">jboss.jca:name=IDP_DS,service=LocalTxCM</module-optio n>
                  </login-module>
              </authentication>
          </application-policy>
          <application-policy name="EncryptDBPassword_EDC_DS">
              <authentication>
                  <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
                      <module-option name="username">adobe</module-option>
                      <module-option name="password">5dfc52b51bd35553df8592078de921bc</module-option>
                      <module-option name="managedConnectionFactoryName">jboss.jca:name=EDC_DS,service=LocalTxCM</module-optio n>
                  </login-module>
              </authentication>
          </application-policy>
         
      </policy>