Bug 1007181 - [GSS] (6.2.x) testConnection should account for deployment classloader
[GSS] (6.2.x) testConnection should account for deployment classloader
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise Application Platform 6
Classification: JBoss
Component: Class Loading (Show other bugs)
6.1.1
All All
medium Severity medium
: CR2
: EAP 6.2.2
Assigned To: Jay SenSharma
Russell Dickenson
:
Depends On: 1060997
Blocks: eap62-cp02-blockers
  Show dependency treegraph
 
Reported: 2013-09-12 00:59 EDT by Jay SenSharma
Modified: 2015-07-19 20:59 EDT (History)
13 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
A bug was uncovered that could cause earlier versions of JBoss EAP to throw an exception when testing a datasource. The exception presented while using the LDAP protocol in the datasource "connection-url" tag. The product was failing to instantiate +InitialContextFactory+ because the "org.jboss.as.connector" module was not able to access some of the JDK provided classes (such as +com.sun.jndi.ldap.LdapCtxFactory+). This resulted in a datasource connection test failure when the Datasource "connection-url" was using "ldap://" protocol. This issue was resolved by adding a dependency on +sun.jdk+ to the +org.jboss.as.connector+ module. This makes the required JDK classes accessible from the connector module and the datasource testing using CLI using "test-connection-in-pool" operation succeeds.
Story Points: ---
Clone Of:
: 1060997 (view as bug list)
Environment:
Last Closed: 2014-06-02 08:49:37 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker WFLY-2047 Major Closed testConnection should account for deployment classloader 2016-02-19 03:56 EST

  None (edit)
Description Jay SenSharma 2013-09-12 00:59:26 EDT
Description of problem:
------------------------



If a DataSource is created as following:
++++++++++++++++
<datasource jndi-name="java:jboss/datasources/test_pool" pool-name="test_pool" enabled="true" use-java-context="true">
<connection-url>jdbc:oracle:thin:@ldap://example.com:3060/test,cn=OracleA,dc=worldA</connection-url>
<driver>oracle</driver>
<pool>
<min-pool-size>1</min-pool-size>
<max-pool-size>15</max-pool-size>
</pool>
<security>
<user-name>Test</user-name>
<password>testPassword</password>
</security>
</datasource>

<drivers>
<driver name="oracle" module="com.oracle.jdbc6">
<driver-class>oracle.jdbc.driver.OracleDriver</driver-class>
</driver>
<driver name="h2" module="com.h2database.h2">
<xa-datasource-class>org.h2.jdbcx.JdbcDataSource</xa-datasource-class>
</driver>
</drivers>
++++++++++++++++

Then while testing the DataSource the Wildfly throws the following Exception:

+++++++++++++++++++++
16:47:10,498 WARN [org.jboss.jca.core.connectionmanager.pool.strategy.OnePool] (management-handler-thread - 3) IJ000604: Throwable while attempting to get a new connection: null: javax.resource.ResourceException: Could not create connection
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:282) [ironjacamar-jdbc-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.createManagedConnection(LocalManagedConnectionFactory.java:240) [ironjacamar-jdbc-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.createConnectionEventListener(SemaphoreArrayListManagedConnectionPool.java:781) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.mcp.SemaphoreArrayListManagedConnectionPool.getConnection(SemaphoreArrayListManagedConnectionPool.java:344) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getSimpleConnection(AbstractPool.java:397) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.getConnection(AbstractPool.java:365) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.AbstractPool.internalTestConnection(AbstractPool.java:627) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.jca.core.connectionmanager.pool.strategy.OnePool.testConnection(OnePool.java:89) [ironjacamar-core-impl-1.0.17.Final.jar:1.0.17.Final]
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$TestConnectionInPool.invokeCommandOn(PoolOperations.java:143) [jboss-as-connector-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.connector.subsystems.common.pool.PoolOperations$1.execute(PoolOperations.java:82) [jboss-as-connector-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.executeStep(AbstractOperationContext.java:440) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.doCompleteStep(AbstractOperationContext.java:322) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.completeStepInternal(AbstractOperationContext.java:229) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.AbstractOperationContext.executeOperation(AbstractOperationContext.java:224) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.ModelControllerImpl.internalExecute(ModelControllerImpl.java:194) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.ModelControllerImpl.execute(ModelControllerImpl.java:115) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler.doExecute(ModelControllerClientOperationHandler.java:139) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.controller.remote.ModelControllerClientOperationHandler$ExecuteRequestHandler$1.execute(ModelControllerClientOperationHandler.java:108) [jboss-as-controller-7.3.0.Final-redhat-X-SNAPSHOT.jar:7.3.0.Final-redhat-X-SNAPSHOT]
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$2$1.doExecute(AbstractMessageHandler.java:296)
at org.jboss.as.protocol.mgmt.AbstractMessageHandler$AsyncTaskRunner.run(AbstractMessageHandler.java:518)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886) [rt.jar:1.6.0_21]
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908) [rt.jar:1.6.0_21]
at java.lang.Thread.run(Thread.java:619) [rt.jar:1.6.0_21]
at org.jboss.threads.JBossThread.run(JBossThread.java:122) [jboss-threads-2.1.0.Final.jar:2.1.0.Final]
Caused by: java.sql.SQLRecoverableException: Io exception: JNDI Package failurejavax.naming.NamingException: JBAS011843: Failed instantiate InitialContextFactory com.sun.jndi.ldap.LdapCtxFactory from classloader ModuleClassLoader for Module "org.jboss.as.connector:main" from local module loader @571a75a2 (finder: local module finder @a210b5b (roots: /home/jsensharma/NotBackedUp/SVN_16_Jan/EAP6_Main/build_wildfly/jboss-as-7.3.0.Final-redhat-X-SNAPSHOT/modules,/home/jsensharma/NotBackedUp/SVN_16_Jan/EAP6_Main/build_wildfly/jboss-as-7.3.0.Final-redhat-X-SNAPSHOT/modules/system/layers/base))
at oracle.jdbc.driver.SQLStateMapping.newSQLException(SQLStateMapping.java:101)
at oracle.jdbc.driver.DatabaseError.newSQLException(DatabaseError.java:112)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:173)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:229)
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:458)
at oracle.jdbc.driver.T4CConnection.logon(T4CConnection.java:411)
at oracle.jdbc.driver.PhysicalConnection.<init>(PhysicalConnection.java:490)
at oracle.jdbc.driver.T4CConnection.<init>(T4CConnection.java:202)
at oracle.jdbc.driver.T4CDriverExtension.getConnection(T4CDriverExtension.java:33)
at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:474)
at org.jboss.jca.adapters.jdbc.local.LocalManagedConnectionFactory.getLocalManagedConnection(LocalManagedConnectionFactory.java:254) [ironjacamar-jdbc-1.0.17.Final.jar:1.0.17.Final]

++++++++++++++++++++++



Version-Release number of selected component (if applicable):


How reproducible:
----------------




Steps to Reproduce:
1. Create the above mentioned DataSource using the "ldap://" protocol in the "connection-url" attribute of the dataSource and then run the CLI command to test the DataSource connections.

2.  /subsystem=datasources/data-source=test_pool:test-connection-in-pool

3. Check JBoss Console  output to see the above error.

Actual results:
See above exception


Expected results:
 Test Connection from DataSource should have returned Successful results.

Additional info:
Comment 1 Jay SenSharma 2013-09-12 01:01:54 EDT
Workaround :
############
Add the module dependency "$JBOSS_HOME/modules/system/layers/base/org/jboss/as/connector/main/module.xml"" which needs to be dependent on the following module <module name="sun.jdk"/>

- So alter the module "org.jboss.as.connector" and add the following dependencies to it :

<dependencies>
     <module name="sun.jdk"/>
      .
      .
      .
</dependencies>
Comment 2 JBoss JIRA Server 2013-09-12 08:28:24 EDT
Jesper Pedersen <jpederse@redhat.com> made a comment on jira WFLY-2047

Why is LDAP leaking into JDBC ?
Comment 3 JBoss JIRA Server 2013-09-12 09:29:01 EDT
Jesper Pedersen <jpederse@redhat.com> made a comment on jira WFLY-2047

[~darranl] Do you have input on this ?
Comment 4 JBoss JIRA Server 2013-09-12 10:09:35 EDT
Darran Lofthouse <darran.lofthouse@jboss.com> made a comment on jira WFLY-2047

Hi Jesper, As this is how the Oracle connection is defined shouldn't it be the Oracle driver that has the dependency on sun.jdk ?
Comment 5 JBoss JIRA Server 2013-09-12 10:14:52 EDT
Jesper Pedersen <jpederse@redhat.com> updated the status of jira WFLY-2047 to Closed
Comment 6 JBoss JIRA Server 2013-09-12 10:14:52 EDT
Jesper Pedersen <jpederse@redhat.com> made a comment on jira WFLY-2047

See [~dlofthouse] 's comment - it is the Oracle module that needs the dependency if ldap is used in the url
Comment 7 JBoss JIRA Server 2013-09-12 10:23:11 EDT
Jay Kumar SenSharma <jsenshar@redhat.com> made a comment on jira WFLY-2047

Oracle Module has the following dependency still the same issue occurs.
Comment 8 JBoss JIRA Server 2013-09-12 10:23:11 EDT
Jay Kumar SenSharma <jsenshar@redhat.com> made a comment on jira WFLY-2047

Oracle Module has the following dependency still the same issue occurs.
Comment 9 JBoss JIRA Server 2013-09-12 10:23:32 EDT
Jay Kumar SenSharma <jsenshar@redhat.com> made a comment on jira WFLY-2047

<?xml version="1.0" ?>
<module xmlns="urn:jboss:module:1.1" name="com.oracle.jdbc6">
    <resources>
        <resource-root path="ojdbc6.jar"/>
    </resources>
        <dependencies>
                <module name="javax.api"/>
                <module name="sun.jdk"/>
        </dependencies>
</module>
Comment 10 JBoss JIRA Server 2013-09-12 10:27:54 EDT
Jesper Pedersen <jpederse@redhat.com> made a comment on jira WFLY-2047

Then it is a classloading or module dependency issue
Comment 11 JBoss JIRA Server 2013-09-12 13:47:42 EDT
Jay Kumar SenSharma <jsenshar@redhat.com> updated the status of jira WFLY-2047 to Reopened
Comment 12 JBoss JIRA Server 2013-09-12 13:47:42 EDT
Jay Kumar SenSharma <jsenshar@redhat.com> made a comment on jira WFLY-2047

Reopening this issue and will try to change the component to Jboss classloading
Comment 13 JBoss JIRA Server 2013-09-12 15:25:04 EDT
Jesper Pedersen <jpederse@redhat.com> made a comment on jira WFLY-2047

Changed the description to account for the real failure
Comment 22 Russell Dickenson 2013-12-03 08:31:55 EST
`Requires doc text` flag cleared as it's too late to include an entry in the JBoss EAP 6.2.0 Release Notes.
Comment 28 Shaun Appleton 2014-01-22 05:15:18 EST
The customer has asked if they can test this - can the fix be made available as a patch?
Comment 37 Scott Mumford 2014-02-26 18:19:01 EST
Redrafted Doc Text to prose format.
Comment 38 Jan Martiska 2014-03-05 10:13:28 EST
Verified in 6.2.2.CR2.
Comment 45 JBoss JIRA Server 2014-11-13 10:27:47 EST
Stefano Maestri <smaestri@redhat.com> updated the status of jira WFLY-2047 to Closed

Note You need to log in before you can comment on or make changes to this bug.