[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Igor Shulika edited comment on WFLY-2898 at 2/11/14 12:38 PM:
--------------------------------------------------------------
Please take a look at the attached screenshots from Admin Console.
Also I attached the startup log screenshot.
was (Author: eagleigor):
Please take a look at the attached screenshots from Admin Console
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
> Attachments: 1.PNG, 2.PNG, 3.PNG
>
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Igor Shulika edited comment on WFLY-2898 at 2/11/14 12:37 PM:
--------------------------------------------------------------
I don’t have the javax.naming.NameNotFoundException, just simply the (DataSource) initContext.lookup("java:/GOLDDatasource") statement returns NULL.
was (Author: eagleigor):
I don’t have the javax.naming.NameNotFoundException, just simply the(DataSource) initContext.lookup("java:/MyDataSource") statement returns NULL.
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
> Attachments: 1.PNG, 2.PNG, 3.PNG
>
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2900) Performance issue with Xalan transformer and very large text nodes
by Kyle Lape (JIRA)
[ https://issues.jboss.org/browse/WFLY-2900?page=com.atlassian.jira.plugin.... ]
Kyle Lape updated WFLY-2900:
----------------------------
Summary: Performance issue with Xalan transformer and very large text nodes (was: Performance issue with Xalan transformer and very large character data nodes)
> Performance issue with Xalan transformer and very large text nodes
> ------------------------------------------------------------------
>
> Key: WFLY-2900
> URL: https://issues.jboss.org/browse/WFLY-2900
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: XML Frameworks
> Reporter: Kyle Lape
> Assignee: Jason Greene
>
> It has been observed that when using the {{Transfomer}} to convert a {{StreamSource}} to {{DOMResult}}, the performance of Transform gets worse as the size of the
> character data increases. If you have a 50MB text blob in XML, this will take a very long time to finish.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Igor Shulika updated WFLY-2898:
-------------------------------
Attachment: 3.PNG
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
> Attachments: 1.PNG, 2.PNG, 3.PNG
>
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Igor Shulika updated WFLY-2898:
-------------------------------
Attachment: 1.PNG
2.PNG
Please take a look at the attached screenshots from Admin Console
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
> Attachments: 1.PNG, 2.PNG
>
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2899) Help and error messages in Main classes should be printed raw
by James Perkins (JIRA)
[ https://issues.jboss.org/browse/WFLY-2899?page=com.atlassian.jira.plugin.... ]
James Perkins commented on WFLY-2899:
-------------------------------------
Example HC output after patch is applied:
{code}
[jperkins@jperkins-rh build]$ ./target/wildfly-8.0.0.Final-SNAPSHOT/bin/domain.sh --foo
=========================================================================
JBoss Bootstrap Environment
JBOSS_HOME: /home/jperkins/projects/jboss/as/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT
JAVA: /home/jperkins/java/64/default//bin/java
JAVA_OPTS: -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
=========================================================================
09:29:54,685 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final
09:29:54,804 INFO [org.jboss.as.process.Host Controller.status] (main) JBAS012017: Starting process 'Host Controller'
[Host Controller] 09:29:55,283 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final
[Host Controller] JBAS010961: Invalid option '--foo'. Use domain.sh --help for information on valid command line arguments and their syntax.
[Host Controller]
[Host Controller] Usage: domain.sh [args...]
[Host Controller] where args include:
[Host Controller] --admin-only Set the host controller's running type
[Host Controller] to ADMIN_ONLY causing it to open
[Host Controller] administrative interfaces and accept
[Host Controller] management requests but not start
[Host Controller] servers or, if this host controller is
[Host Controller] the master for the domain, accept
[Host Controller] incoming connections from slave host
[Host Controller] controllers.
[Host Controller]
[Host Controller]
[Host Controller] -b <value>, -b=<value> Set system property jboss.bind.address
[Host Controller] to the given value
[Host Controller]
[Host Controller]
[Host Controller] -b<interface>=<value> Set system property
[Host Controller] jboss.bind.address.<interface> to the
[Host Controller] given value
[Host Controller]
[Host Controller]
[Host Controller] --backup Keep a copy of the persistent domain
[Host Controller] configuration even if this host is not
[Host Controller] the Domain Controller
[Host Controller]
[Host Controller]
[Host Controller] -c <config>, -c=<config> Name of the domain configuration file
[Host Controller] to use (default is "domain.xml") (Same
[Host Controller] as --domain-config)
[Host Controller]
[Host Controller]
[Host Controller] --cached-dc If this host is not the Domain
[Host Controller] Controller and cannot contact the
[Host Controller] Domain Controller at boot, boot using a
[Host Controller] locally cached copy of the domain
[Host Controller] configuration (see --backup)
[Host Controller]
[Host Controller]
[Host Controller] -D<name>[=<value>] Set a system property
[Host Controller]
[Host Controller]
[Host Controller] --domain-config=<config> Name of the domain configuration file
[Host Controller] to use (default is "domain.xml") (Same
[Host Controller] as -c)
[Host Controller]
[Host Controller]
[Host Controller] -h, --help Display this message and exit
[Host Controller]
[Host Controller]
[Host Controller] --host-config=<config> Name of the host configuration file to
[Host Controller] use (default is "host.xml")
[Host Controller]
[Host Controller]
[Host Controller] --interprocess-hc-address=<address> Address on which the host controller
[Host Controller] should listen for communication from
[Host Controller] the process controller
[Host Controller]
[Host Controller]
[Host Controller] --interprocess-hc-port=<port> Port on which the host controller
[Host Controller] should listen for communication from
[Host Controller] the process controller
[Host Controller]
[Host Controller]
[Host Controller] --master-address=<address> Set system property
[Host Controller] jboss.domain.master.address to the
[Host Controller] given value. In a default slave Host
[Host Controller] Controller config, this is used to
[Host Controller] configure the address of the master
[Host Controller] Host Controller.
[Host Controller]
[Host Controller]
[Host Controller] --master-port=<port> Set system property
[Host Controller] jboss.domain.master.port to the given
[Host Controller] value. In a default slave Host
[Host Controller] Controller config, this is used to
[Host Controller] configure the port used for native
[Host Controller] management communication by the master
[Host Controller] Host Controller.
[Host Controller]
[Host Controller]
[Host Controller] --read-only-domain-config=<config> Name of the domain configuration file
[Host Controller] to use. This differs from
[Host Controller] '--domain-config', '-c' and
[Host Controller] '-domain-config' in that the initial
[Host Controller] file is never overwritten.
[Host Controller]
[Host Controller]
[Host Controller] --read-only-host-config=<config> Name of the host configuration file to
[Host Controller] use. This differs from '--host-config'
[Host Controller] in that the initial file is never
[Host Controller] overwritten.
[Host Controller]
[Host Controller]
[Host Controller] -P <url>, -P=<url>, Load system properties from the given
[Host Controller] --properties=<url> url
[Host Controller]
[Host Controller]
[Host Controller] --pc-address=<address> Address on which the process controller
[Host Controller] listens for communication from
[Host Controller] processes it controls
[Host Controller]
[Host Controller]
[Host Controller] --pc-port=<port> Port on which the process controller
[Host Controller] listens for communication from
[Host Controller] processes it controls
[Host Controller]
[Host Controller]
[Host Controller] -u <value>, -u=<value> Set system property
[Host Controller] jboss.default.multicast.address to the
[Host Controller] given value
[Host Controller]
[Host Controller]
[Host Controller] -V, -v, --version Print version and exit
[Host Controller]
[Host Controller]
09:29:55,434 INFO [org.jboss.as.process.Host Controller.status] (reaper for Host Controller) JBAS012010: Process 'Host Controller' finished with an exit status of 99
09:29:55,439 INFO [org.jboss.as.process] (Thread-6) JBAS012016: Shutting down process controller
09:29:55,440 INFO [org.jboss.as.process] (Thread-6) JBAS012015: All processes finished; exiting
{code}
> Help and error messages in Main classes should be printed raw
> -------------------------------------------------------------
>
> Key: WFLY-2899
> URL: https://issues.jboss.org/browse/WFLY-2899
> Project: WildFly
> Issue Type: Enhancement
> Security Level: Public(Everyone can see)
> Components: Logging
> Reporter: James Perkins
> Assignee: James Perkins
> Priority: Minor
>
> The help in standalone and host-controller main methods gets printed after {{System.out}} and {{System.err}} have been captured by jboss-stdio. This leads the help and errors being printed in a log manager format rather than just the raw text.
> Example output:
> {code}
> [jperkins@jperkins-rh wildfly]$ ./build/target/wildfly-8.0.0.Final-SNAPSHOT/bin/standalone.sh -help
> =========================================================================
> JBoss Bootstrap Environment
> JBOSS_HOME: /home/jperkins/projects/jboss/as/wildfly/build/target/wildfly-8.0.0.Final-SNAPSHOT
> JAVA: java
> JAVA_OPTS: -server -XX:+UseCompressedOops -Xms64m -Xmx512m -XX:MaxPermSize=256m -Djava.net.preferIPv4Stack=true -Djboss.modules.system.pkgs=org.jboss.byteman -Djava.awt.headless=true
> =========================================================================
> 15:31:43,895 INFO [org.jboss.modules] (main) JBoss Modules version 1.3.0.Final
> 15:31:44,918 INFO [stdout] (main)
> 15:31:44,918 INFO [stdout] (main) Usage: standalone.sh [args...]
> 15:31:44,918 INFO [stdout] (main) where args include:
> 15:31:44,918 INFO [stdout] (main) --admin-only Set the server's running type to
> 15:31:44,919 INFO [stdout] (main) ADMIN_ONLY causing it to open
> 15:31:44,919 INFO [stdout] (main) administrative interfaces and accept
> 15:31:44,919 INFO [stdout] (main) management requests but not start other
> 15:31:44,920 INFO [stdout] (main) runtime services or accept end user
> 15:31:44,920 INFO [stdout] (main) requests.
> 15:31:44,920 INFO [stdout] (main)
> 15:31:44,920 INFO [stdout] (main)
> 15:31:44,921 INFO [stdout] (main) -b <value>, -b=<value> Set system property jboss.bind.address
> 15:31:44,921 INFO [stdout] (main) to the given value
> 15:31:44,921 INFO [stdout] (main)
> 15:31:44,921 INFO [stdout] (main)
> 15:31:44,922 INFO [stdout] (main) -b<interface>=<value> Set system property
> 15:31:44,922 INFO [stdout] (main) jboss.bind.address.<interface> to the
> 15:31:44,922 INFO [stdout] (main) given value
> 15:31:44,922 INFO [stdout] (main)
> 15:31:44,923 INFO [stdout] (main)
> 15:31:44,923 INFO [stdout] (main) -c <config>, -c=<config> Name of the server configuration file
> 15:31:44,923 INFO [stdout] (main) to use (default is "standalone.xml")
> 15:31:44,923 INFO [stdout] (main) (Same as --server-config)
> 15:31:44,924 INFO [stdout] (main)
> 15:31:44,924 INFO [stdout] (main)
> 15:31:44,924 INFO [stdout] (main) --debug [<port>] Activate debug mode with an optional
> 15:31:44,924 INFO [stdout] (main) argument to specify the port. Only
> 15:31:44,925 INFO [stdout] (main) works if the launch script supports it.
> 15:31:44,925 INFO [stdout] (main)
> 15:31:44,925 INFO [stdout] (main)
> 15:31:44,925 INFO [stdout] (main) -D<name>[=<value>] Set a system property
> 15:31:44,926 INFO [stdout] (main)
> 15:31:44,926 INFO [stdout] (main)
> 15:31:44,926 INFO [stdout] (main) -h, --help Display this message and exit
> 15:31:44,927 INFO [stdout] (main)
> 15:31:44,927 INFO [stdout] (main)
> 15:31:44,927 INFO [stdout] (main) --read-only-server-config=<config> Name of the server configuration file
> 15:31:44,927 INFO [stdout] (main) to use. This differs from
> 15:31:44,928 INFO [stdout] (main) '--server-config' and '-c' in that the
> 15:31:44,928 INFO [stdout] (main) original file is never overwritten.
> 15:31:44,928 INFO [stdout] (main)
> 15:31:44,928 INFO [stdout] (main)
> 15:31:44,929 INFO [stdout] (main) -P <url>, -P=<url>, Load system properties from the given
> 15:31:44,929 INFO [stdout] (main) --properties=<url> url
> 15:31:44,929 INFO [stdout] (main)
> 15:31:44,929 INFO [stdout] (main)
> 15:31:44,930 INFO [stdout] (main) -S<name>[=<value>] Set a security property
> 15:31:44,930 INFO [stdout] (main)
> 15:31:44,930 INFO [stdout] (main)
> 15:31:44,930 INFO [stdout] (main) --server-config=<config> Name of the server configuration file
> 15:31:44,931 INFO [stdout] (main) to use (default is "standalone.xml")
> 15:31:44,931 INFO [stdout] (main) (Same as -c)
> 15:31:44,931 INFO [stdout] (main)
> 15:31:44,931 INFO [stdout] (main)
> 15:31:44,932 INFO [stdout] (main) -u <value>, -u=<value> Set system property
> 15:31:44,932 INFO [stdout] (main) jboss.default.multicast.address to the
> 15:31:44,932 INFO [stdout] (main) given value
> 15:31:44,933 INFO [stdout] (main)
> 15:31:44,933 INFO [stdout] (main)
> 15:31:44,933 INFO [stdout] (main) -v, -V, --version Print version and exit
> 15:31:44,934 INFO [stdout] (main)
> 15:31:44,934 INFO [stdout] (main)
> {code}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Igor Shulika commented on WFLY-2898:
------------------------------------
I don’t have the javax.naming.NameNotFoundException, just simply the(DataSource) initContext.lookup("java:/MyDataSource") statement returns NULL.
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2881) org.jboss.as.ejb3.timer.schedule.CalendarBasedTimeoutTestCase#testCalendarBasedTimeout
by Cody Lerum (JIRA)
[ https://issues.jboss.org/browse/WFLY-2881?page=com.atlassian.jira.plugin.... ]
Cody Lerum commented on WFLY-2881:
----------------------------------
Build just succeeded on ae65313
> org.jboss.as.ejb3.timer.schedule.CalendarBasedTimeoutTestCase#testCalendarBasedTimeout
> --------------------------------------------------------------------------------------
>
> Key: WFLY-2881
> URL: https://issues.jboss.org/browse/WFLY-2881
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: EJB
> Affects Versions: 8.0.0.Final
> Reporter: Frank Langelage
> Assignee: Tomaz Cerar
> Attachments: org.jboss.as.ejb3.timer.schedule.CalendarBasedTimeoutTestCase.txt, TEST-org.jboss.as.ejb3.timer.schedule.CalendarBasedTimeoutTestCase.xml
>
>
> Running build with smoke tests on current github sources I get failure in this test case.
> HOUR_OF_DAY is not 0 as expected but 1.
> I changed the Assert in the test case to print out firstTimeout.toString() instead of only timeZoneDisplayName.
> See attached files for more.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Eduardo Martins (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Eduardo Martins edited comment on WFLY-2898 at 2/11/14 11:02 AM:
-----------------------------------------------------------------
I tried to replicate your use case through:
{code:xml}
<datasource jndi-name="java:/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
{code}
and
{code}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
try { System.out.println(String.valueOf(InitialContext.doLookup("java:/MyDataSource")));
} catch (NamingException e) {
throw new ServletException(e);
}
}
{code}
and found no issue:
{code}
15:50:36,995 INFO [stdout] (default task-3) org.jboss.jca.adapters.jdbc.WrapperDataSource@66ff90bd
{code}
Do you have anything else suspicious in the server log?
Note that what is in JNDI is an object factory, my guess is that the datasource setup is not ok and then the object factory bound is not creating the datasource instances as expected.
Please provide a standalone.xml and a web app maven project that can be used to replicate your issue.
was (Author: emmartins):
I tried to replicate your use case through:
{code:xml}
<datasource jndi-name="java:/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
{code}
and
{code}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
try { System.out.println(String.valueOf(InitialContext.doLookup("java:/MyDataSource")));
} catch (NamingException e) {
throw new ServletException(e);
}
}
{code}
and found no issue:
{code}
15:50:36,995 INFO [stdout] (default task-3) org.jboss.jca.adapters.jdbc.WrapperDataSource@66ff90bd
{code}
Do you have anything else suspicious in the server log?
Note that what is in JNDI is an object factory, my guess is that the datasource setup is not ok and then the object factory bound is not create the datasource instances as expected.
Please provide a standalone.xml and a web app maven project that can be used to replicate your issue.
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Eduardo Martins (JIRA)
[ https://issues.jboss.org/browse/WFLY-2898?page=com.atlassian.jira.plugin.... ]
Eduardo Martins commented on WFLY-2898:
---------------------------------------
I tried to replicate your use case through:
{code:xml}
<subsystem xmlns="urn:jboss:domain:datasources:2.0">
<datasources>
<!-- ... -->
<datasource jndi-name="java:/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">
<connection-url>jdbc:h2:mem:test;DB_CLOSE_DELAY=-1;DB_CLOSE_ON_EXIT=FALSE</connection-url>
<driver>h2</driver>
<security>
<user-name>sa</user-name>
<password>sa</password>
</security>
</datasource>
<!-- ... -->
</datasources>
</subsystem>
{code}
and
{code}
@Override
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException {
try { System.out.println(String.valueOf(InitialContext.doLookup("java:/MyDataSource")));
} catch (NamingException e) {
throw new ServletException(e);
}
}
{code}
and found no issue:
{code}
15:50:36,995 INFO [stdout] (default task-3) org.jboss.jca.adapters.jdbc.WrapperDataSource@66ff90bd
{code}
Do you have anything else suspicious in the server log?
Note that what is in JNDI is an object factory, my guess is that the datasource setup is not ok and then the object factory bound is not create the datasource instances as expected.
Please provide a standalone.xml and a web app maven project that can be used to replicate your issue.
> JNDI Name lookup of the DataSource returns NULL
> -----------------------------------------------
>
> Key: WFLY-2898
> URL: https://issues.jboss.org/browse/WFLY-2898
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming, Web (Undertow)
> Affects Versions: 8.0.0.CR1, 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: Eduardo Martins
>
> 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).
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
12 years, 3 months