Uploaded image for project: 'WildFly'
  1. WildFly
  2. WFLY-2898

JNDI Name lookup of the DataSource returns NULL

    XMLWordPrintable

Details

    • Bug
    • Resolution: Cannot Reproduce
    • Major
    • None
    • 8.0.0.CR1, 8.0.0.Final
    • Naming, Web (Undertow)
    • None

    Description

      Hi,
      I'm having a problem to obtain DataSource using JNDI Name lookup.
      Please see my code below:

      Connection connection = null;
      DataSource dataSource = null;
      try {
      final Context initContext = new InitialContext();
      dataSource = (DataSource) initContext.lookup("java:/MyDataSource"); connection = dataSource.getConnection();
      } catch (Exception e) {
      LOGGER.error(e);
      }

      I'm doing initContext.lookup from a servlet, everything is working on JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14).

      Also I can find and test connection of my “java:/MyDataSource” under the “Datasources” section of the WildFly Administration Console just fine(anoter word the datasource is there).

      Attachments

        1. test.zip
          4 kB
        2. test.zip
          4 kB
        3. standalone.xml
          20 kB
        4. standalone.conf.bat
          3 kB
        5. server.log
          18 kB
        6. jaffa-oracle-driver-6.0.0.Alpha2-SNAPSHOT.jar
          5 kB
        7. 3.PNG
          3.PNG
          25 kB
        8. 2.PNG
          2.PNG
          100 kB
        9. 1.PNG
          1.PNG
          170 kB

        Activity

          People

            emartins@redhat.com Eduardo Martins
            eagleigor Igor Shulika (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: