Have you tried just setting the environment variable in the shell script 
.../bin/setenv.sh ?

Darryl Baker, GSEC, GCLD (he/him/his) 
Sr. System Administrator 
Distributed Application Platform Services 
Northwestern University 
4th Floor 
2020 Ridge Avenue 
Evanston, IL 60208-0801 
darryl.ba...@northwestern.edu <mailto:darryl.ba...@northwestern.edu> 
(847) 467-6674 <tel:+18474676674> 




On 3/17/23, 3:52 PM, "Kevin Huntly" <kmhun...@gmail.com 
<mailto:kmhun...@gmail.com>> wrote:


Hello,


I am unable to start my application on Tomcat 9.0.73 with JDK19 on RHEL
8.7. It appears to be ignoring everything in my context.xml, for example:


<Environment name="environment" value="dev" type="java.lang.String"
override="false" />


Code:


try


{


Context initContext = new InitialContext();


environment = (String) initContext.lookup("environment");


}


catch (final NamingException nx)


{


ERROR_RECORDER.error(nx.getMessage(), nx);


}


Exception:


[2023-03-17T16:47:54.663-0400] GC(3) Concurrent Mark Cycle 89.898ms
SecurityService: xmlURL provided was valid and found, continuing
configuration
Name [jdbc/cwssec] is not bound in this Context. Unable to find [jdbc].
eSolutionsCore: xmlURL provided was valid and found, continuing
configuration
Name [jdbc/esolutions] is not bound in this Context. Unable to find [jdbc].
[Time: 17 Mar 2023 16:47:55,836][Thread: main][Log: ERROR_RECORDER.][Level:
ERROR] - [File: ResponseTimeFilter.java:80] - Name [environment] is not
bound in this Context. Unable to find [environment].
javax.naming.NameNotFoundException: Name [environment] is not bound in this
Context. Unable to find [environment].






This code works just fine in other containers (for example, IBM WebSphere),


so I must be doing something wrong with the context file. Can anyone assist?



Reply via email to