in Education by
I've a little problem with Websphere application server 7.0 (WAS7) and the reading of Environment Varaibles. With TomCat, I've defined a variable as <Environment name="myVar" type="java.lang.String" value="myVarOnServeur" and I read it with a lookup on the initialContext : Context ctx = new InitialContext(); String myVar = (String) ctx.lookup( "java:comp/env/myVar" ); and it works! But with Websphere, I define a environment variable on the GUI but I can't read it in my java code. I've a NamingException. (source: fullahead.org) How can I do to fix my problem? JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
to define inside web.xml varName 56 java.lang.String to see with java Context envEntryContext = (Context) new InitialContext().lookup("java:comp/env"); String mydata = (String)envEntryContext.lookup("varName");

Related questions

0 votes
    This question already has answers here: How to deal with "java.lang.OutOfMemoryError: Java heap space" error ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 14, 2022 in Education by JackTerrance
0 votes
    I need to use environment variable "PATH" in yaml file which needs to be parsed with a script. ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked May 10, 2022 in Education by JackTerrance
0 votes
    I have a Jenkins Slave (A Windows PC) which has the JAVA_HOME environment variable. I updated the Java ... Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Feb 19, 2022 in Education by JackTerrance
0 votes
    Which environment variable is used to specify the path to maven? (a) JAVA_HOME (b) PATH (c) MAVEN_HOME (d) ... & Annotations of Java Select the correct answer from above options...
asked Feb 16, 2022 in Education by JackTerrance
0 votes
    Which environment variable is used to specify the path to maven? (a) JAVA_HOME (b) PATH (c) ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Oct 24, 2021 in Education by JackTerrance
0 votes
    What is the purpose of PYTHONHOME environment variable?...
asked Nov 23, 2020 in Technology by JackTerrance
0 votes
    What is the purpose of PYTHONCASEOK environment variable?...
asked Nov 23, 2020 in Technology by JackTerrance
0 votes
    What is the purpose of PYTHONSTARTUP environment variable?...
asked Nov 23, 2020 in Technology by JackTerrance
0 votes
    What is the purpose of PYTHONPATH environment variable?...
asked Nov 23, 2020 in Technology by JackTerrance
0 votes
    What is the environment variable in Blue-Prism?...
asked Nov 6, 2020 in Technology by JackTerrance
0 votes
    I make a website on php and want to read some information from text file. the reason is if, i ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jul 8, 2022 in Education by JackTerrance
0 votes
    I make a website on php and want to read some information from text file. the reason is if, i ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 8, 2022 in Education by JackTerrance
0 votes
    Tell the user to enter your name then read in and assign to a variable a string typed in by the user Select the correct answer from above options...
asked Dec 5, 2021 in Education by JackTerrance
0 votes
    Tell the user to enter your name then read in and assign to a variable a string typed in by the user Select the correct answer from above options...
asked Nov 26, 2021 in Education by JackTerrance
0 votes
    This question already has answers here: Saving path in String (4 answers) Closed 5 years ago. I'm ... JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)...
asked Jun 30, 2022 in Education by JackTerrance
...