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. 1.PNG
          170 kB
          Igor Shulika
        2. 2.PNG
          100 kB
          Igor Shulika
        3. 3.PNG
          25 kB
          Igor Shulika
        4. server.log
          18 kB
          Igor Shulika
        5. standalone.conf.bat
          3 kB
          Igor Shulika
        6. standalone.xml
          20 kB
          Igor Shulika

        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: