[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 updated WFLY-2899:
--------------------------------
Description:
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}
was: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.
> 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, 2 months
[JBoss JIRA] (WFLY-2899) Help and error messages in Main classes should be printed raw
by James Perkins (JIRA)
James Perkins created WFLY-2899:
-----------------------------------
Summary: 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.
--
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, 2 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:
------------------------------------
Yes, by using the standalone.xml file.
<datasource jndi-name="java:/MyDataSource" pool-name="<<datasource.name>>" enabled="true" use-java-context="true">
> 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, 2 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/10/14 6:43 PM:
-------------------------------------------------------------
Yes, by using the standalone.xml file.
<datasource jndi-name="java:/MyDataSource" pool-name="MyDataSource" enabled="true" use-java-context="true">
was (Author: eagleigor):
Yes, by using the standalone.xml file.
<datasource jndi-name="java:/MyDataSource" pool-name="<<datasource.name>>" enabled="true" use-java-context="true">
> 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, 2 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:
---------------------------------------
How are you binding the datasource to java:/MyDataSource, through datasources subsystem?
> 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, 2 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 updated WFLY-2898:
----------------------------------
Priority: Major (was: Blocker)
> 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: Stuart Douglas
>
> 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, 2 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 reassigned WFLY-2898:
-------------------------------------
Assignee: Eduardo Martins (was: Stuart Douglas)
> 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, 2 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 updated WFLY-2898:
----------------------------------
Component/s: Naming
> 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: Stuart Douglas
> Priority: Blocker
>
> 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, 2 months
[JBoss JIRA] (WFLY-2898) JNDI Name lookup of the DataSource returns NULL
by Igor Shulika (JIRA)
Igor Shulika created WFLY-2898:
----------------------------------
Summary: 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: Web (Undertow)
Affects Versions: 8.0.0.CR1, 8.0.0.Final
Reporter: Igor Shulika
Assignee: Stuart Douglas
Priority: Blocker
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, 2 months
[JBoss JIRA] (WFLY-2896) Cannot obtain DataSource using JNDI Name lookup
by Igor Shulika (JIRA)
[ https://issues.jboss.org/browse/WFLY-2896?page=com.atlassian.jira.plugin.... ]
Igor Shulika edited comment on WFLY-2896 at 2/10/14 5:53 PM:
-------------------------------------------------------------
I'm doing initContext.lookup from a servlet, would be that is Undertow issue, because everything is working on JBoss EAP 6.2.0.GA (AS 7.3.0.Final-redhat-14)?
was (Author: eagleigor):
I'm doing initContext.lookup from a servlet, would be that is Undertow issue, because everything is working on JBoss EAP 6.2?
> Cannot obtain DataSource using JNDI Name lookup
> -----------------------------------------------
>
> Key: WFLY-2896
> URL: https://issues.jboss.org/browse/WFLY-2896
> Project: WildFly
> Issue Type: Bug
> Security Level: Public(Everyone can see)
> Components: Naming
> Affects Versions: 8.0.0.Final
> Reporter: Igor Shulika
> Assignee: David Lloyd
> Priority: Blocker
> Fix For: 8.0.0.Final
>
>
> Hi,
> I'm having a problem to obtain DataSource using JNDI Name lookup.
> Please see my code and error 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);
> }
> Caused by: javax.naming.NamingException: JBAS011832: Could not dereference object [Root exception is java.lang.NullPointerException]
> at org.jboss.as.naming.NamingContext.getObjectInstance(NamingContext.java:526)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:236)
> at org.jboss.as.naming.InitialContext$DefaultInitialContext.lookup(InitialContext.java:233)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:188)
> at org.jboss.as.naming.NamingContext.lookup(NamingContext.java:184)
> at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]
> at javax.naming.InitialContext.lookup(InitialContext.java:411) [rt.jar:1.7.0_45]
> ... 10 more
> Caused by: java.lang.NullPointerException
> at org.jboss.as.naming.NamingContext.getObjectInstance(NamingContext.java:522)
> ... 17 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, 2 months