Also, are you deploying a war file referenced outside of the tomcat
home folder, or are you referencing an expanded directory?

How much have you edited the default server.xml?

Were there xml structural changes in the server.xml file or Context
element from what you used to configure the server.xml and contex.xml
file(s)?

My gut is that there is a detail in your startup logs that will give
us a critical clue.


On 3/17/23, John Dale (DB2DOM) <jcdw...@gmail.com> wrote:
> Did you recursive file search "context.xml" in the tomcat root after
> deployment?
>
> Maybe we can help narrow things down for Chris et al with a little
> back and forth, or perhaps solve it ourselves. :)
>
> Try tailing the catalina, localhost, and other log files in the logs
> directory on startup .. usually it will give you some more detailed
> information about startup errors.
>
> I have luck killing the tomcat java process, then deleting everything
> in the logs folder between test runs.
>
> Sincerely,
>
> John
>
>
>
>
> On 3/17/23, Kevin Huntly <kmhun...@gmail.com> wrote:
>> There's no context.xml in the WAR
>> ________________________________________________
>>
>> Kevin Huntly
>> Email: kmhun...@gmail.com
>> Cell: 716/424-3311
>> ________________________________________________
>>
>> -----BEGIN GEEK CODE BLOCK-----
>> Version: 1.0
>> GCS/IT d+ s a C++ UL+++$ P+(++) L+++ E---
>> W+++ N+ o K(+) w--- O- M-- V-- PS+ PE Y(+)
>> PGP++(+++) t+ 5-- X-- R+ tv+ b++  DI++ D++
>> G++ e(+) h--- r+++ y+++*
>> ------END GEEK CODE BLOCK------
>>
>>
>> On Fri, Mar 17, 2023 at 5:00 PM John Dale (DB2DOM) <jcdw...@gmail.com>
>> wrote:
>>
>>> Dissect your deployment war, but also make sure you aren't defining a
>>> context element in server.xml.  Lastly, if memory serves, Tomcat also
>>> allows context overrides in expanded war files.  I eventually just
>>> started managing server.xml metadata (context etc) to avoid conflicts
>>> and simplify.  "Hope dat heps." -- Rizzo
>>>
>>> On 3/17/23, Kevin Huntly <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?
>>> >
>>>
>>> ---------------------------------------------------------------------
>>> To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
>>> For additional commands, e-mail: users-h...@tomcat.apache.org
>>>
>>>
>>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tomcat.apache.org
For additional commands, e-mail: users-h...@tomcat.apache.org

Reply via email to