> On 2025 Dec 12, at 16:11, Mark Foley <[email protected]> wrote:
> 
> On Fri Dec 12 14:08:03 2025 Chuck Caldarale <[email protected]> wrote:
>> 
>>> On 2025 Dec 12, at 12:02, Mark Foley <[email protected]> wrote:
>>> 
>>> On Fri Dec 12 06:54:21 2025 Mark Thomas <[email protected]> wrote:
>>>> 
>>>> On 12/12/2025 05:17, Mark Foley wrote:
>>>> 
>>>> <snip/>
>>>> 
>>>>> The "source level is 1.5 or greater" is on the web page. Here are the 
>>>>> first
>>>>> several lines:
>>>>> 
>>>>> HTTP Status 500 - Internal Server Error
>>>>> 
>>>>> Type Exception Report
>>>>> 
>>>>> Message Unable to compile class for JSP:
>>>>> 
>>>>> Description The server encountered an unexpected condition that prevented 
>>>>> it from fulfilling the request.
>>>>> 
>>>>> Exception
>>>>> 
>>>>> org.apache.jasper.JasperException: Unable to compile class for JSP:
>>>>> 
>>>>> An error occurred at line: [17] in the jsp file: 
>>>>> [/include/homePageImage.inc]
>>>>> Syntax error, 'for each' statements are only available if source level is 
>>>>> 1.5 or greater
>>>> 
>>>> OK. We need to see CATALINA_BASE/conf/web.xml
>>>> 
>>>> It will be big but better we see the whole thing to be sure.
>>> 
>>> Here you go. I've omitted all the comments and the 1,012 <mime-mapping>s. 
>>> Note
>>> that compilerSourceVM is explicitly set to 11. I didn't do that. It was in 
>>> the
>>> installed web.xml:
>>> 
>>> <?xml version="1.0" encoding="UTF-8"?>
>>> <web-app xmlns="https://jakarta.ee/xml/ns/jakartaee";
>>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>>> xsi:schemaLocation="https://jakarta.ee/xml/ns/jakartaee
>>>                     https://jakarta.ee/xml/ns/jakartaee/web-app_6_0.xsd";
>>> version="6.0">
>>> 
>>> <request-character-encoding>UTF-8</request-character-encoding>
>>> <response-character-encoding>UTF-8</response-character-encoding>
>>> 
>>>   <servlet>
>>>       <servlet-name>default</servlet-name>
>>>       
>>> <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
>>>       <init-param>
>>>           <param-name>debug</param-name>
>>>           <param-value>0</param-value>
>>>       </init-param>
>>>       <init-param>
>>>           <param-name>listings</param-name>
>>>           <param-value>false</param-value>
>>>       </init-param>
>>>       <load-on-startup>1</load-on-startup>
>>>   </servlet>
>>> 
>>>   <servlet>
>>>       <servlet-name>jsp</servlet-name>
>>>       <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
>>>       <init-param>
>>>           <param-name>compilerSourceVM</param-name>
>>>           <param-value>11</param-value>
>>>       </init-param>
>>>       <init-param>
>>>           <param-name>fork</param-name>
>>>           <param-value>false</param-value>
>>>       </init-param>
>>>       <init-param>
>>>           <param-name>xpoweredBy</param-name>
>>>           <param-value>false</param-value>
>>>       </init-param>
>>>       <load-on-startup>3</load-on-startup>
>>>   </servlet>
>>> 
>>>   <servlet-mapping>
>>>       <servlet-name>default</servlet-name>
>>>       <url-pattern>/</url-pattern>
>>>   </servlet-mapping>
>>> 
>>>   <servlet-mapping>
>>>       <servlet-name>jsp</servlet-name>
>>>       <url-pattern>*.jsp</url-pattern>
>>>       <url-pattern>*.jspx</url-pattern>
>>>   </servlet-mapping>
>>> 
>>>   <session-config>
>>>       <session-timeout>30</session-timeout>
>>>   </session-config>
>>> 
>>>   <mime-mapping>
>>> [snip]
>>>   </mime-mapping>
>>> 
>>>   <welcome-file-list>
>>>       <welcome-file>index.html</welcome-file>
>>>       <welcome-file>index.htm</welcome-file>
>>>       <welcome-file>index.jsp</welcome-file>
>>>   </welcome-file-list>
>>> 
>>> <security-constraint>
>>>    <web-resource-collection>
>>>        <web-resource-name>Include files</web-resource-name>
>>>        <description>No direct access to include files.</description>
>>>        <url-pattern>/include/*</url-pattern>
>>>        <http-method>POST</http-method>
>>>        <http-method>GET</http-method>
>>>    </web-resource-collection>
>>> 
>>>    <auth-constraint>
>>>        <description>No direct browser access to include files.</description>
>>>        <role-name>NobodyHasThisRole</role-name>
>>>    </auth-constraint>
>>> </security-constraint>
>>> 
>>> </web-app>
>>> 
>>>> 
>>>> Also, the a web application with that error, we need to see WEB-INF/web.xml
>>> 
>>> <?xml version="1.0" encoding="ISO-8859-1"?>
>>> <web-app xmlns="http://xmlns.jcp.org/xml/ns/javaee";
>>> xmlns:xsi="http://www.w3.org/2001/xmlschema-instance";
>>> xsi:schemalocation="http://xmlns.jcp.org/xml/ns/javaee
>>>                     http://xmlns.jcp.org/xml/ns/javaee/web-app_3_1.xsd";
>>> version="3.1"
>>> metadata-complete="true">
>>> 
>>> <env-entry>
>>> <env-entry-name>connurl</env-entry-name>
>>> <env-entry-value>jdbc:mysql://localhost/members?</env-entry-value>
>>> <env-entry-type>java.lang.string</env-entry-type>
>>> </env-entry>
>>> 
>>> <env-entry>
>>> <env-entry-name>dbpassword</env-entry-name>
>>> <env-entry-value>obfuscated</env-entry-value>
>>> <env-entry-type>java.lang.string</env-entry-type>
>>> </env-entry>
>>> 
>>> <env-entry>
>>> <env-entry-name>webuser</env-entry-name>
>>> <env-entry-value>user</env-entry-value>
>>> <env-entry-type>java.lang.string</env-entry-type>
>>> </env-entry>
>>> 
>>> </web-app>
>>> 
>>>> 
>>>> <snip/>
>>>> 
>>>>> i don't know that i have "junk" in the conf files. i don't tend to be 
>>>>> inventive
>>>>> with these things myself. here's my whole server.xml file, sans comments. 
>>>>> please
>>>>> let me know if you see anything wrong.
>>>> 
>>>> <snip/>
>>>> 
>>>> 
>>>>>      <host name="www.horeb-wright3.org" appbase="webapps"
>>>>>            unpackwars="true" autodeploy="true"
>>>>>            xmlvalidation="false" xmlnamespaceaware="false">
>>>> 
>>>> set autodeploy="false". i think you will be getting double deployment.
>>> 
>>> Done, although it doesn't seem to have cut down on the number of log 
>>> messages
>>> generated in catalina.out.
>>> 
>>>> Remove the 2 xml settings. a) the belong on the Context, not the Host 
>>>> and b) you are using the defaults so there is no need to include them at 
>>>> all.
>>> 
>>> Done.
>>> 
>>>>>            <Alias>horeb-wright3.org</Alias>
>>>>>            <Logger className="org.apache.catalina.logger.FileLogger" 
>>>>> directory="logs/" prefix="horeb_access_log" suffix=".log" 
>>>>> timestamp="true"/>
>>>> 
>>>> Remove the entire Logger element. It is unsupported and isn't doing 
>>>> anything.
>>> 
>>> Done.
>>> 
>>> None of the above have altered the source level is 1.5 error.
>> 
>> 
>> The unchanged number of log entries, coupled with the fact that modifying 
>> compilerSourceVM has no apparent effect, makes me wonder if this Tomcat 
>> instance is actually using the configuration files you think it is. It 
>> wouldn’t be the first time that kind of non-obvious mistake has occurred.
>> 
>>  - Chuck
> 
> So, how would I verify Tomcat is using the correct conf files? 


If you’re using a Tomcat downloaded from tomcat.apache.org, the startup 
directories are displayed by default by the startup.sh script. Also, the 
catalina.out and catalina.yyyy-mm-dd.log files show more extensive information, 
including whatever is being used for CATALINA_BASE and CATALINA_HOME. For 
example:

12-Dec-2025 18:12:09.237 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version name:   
Apache Tomcat/10.1.50
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server built:          
Dec 2 2025 22:57:41 UTC
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Server version number: 
10.1.50.0
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Name:               
Mac OS X
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log OS Version:            
26.2
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Architecture:          
aarch64
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log Java Home:             
/Library/Java/JavaVirtualMachines/temurin-24.jdk/Contents/Home
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Version:           
24.0.2+12
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log JVM Vendor:            
Eclipse Adoptium
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_BASE:         
/Users/chuck/Downloads/apache-tomcat-10.1.50
12-Dec-2025 18:12:09.239 INFO [main] 
org.apache.catalina.startup.VersionLoggerListener.log CATALINA_HOME:         
/Users/chuck/Downloads/apache-tomcat-10.1.50

(The above is from a completely stock fresh download of Tomcat 10.1.) If you’re 
using a 3rd-party repackaged version of Tomcat, things may well be a bit 
different...


> I am keeping separate directory links under /srv/tomcat and when I move the 
> link
> back to the 8.5 version everything work. When I move it to the 10.1 version I
> get the errors.


Can you elaborate on that a bit more? Precisely what is in /srv/tomcat and what 
“links” are you referring to? Also, can you explain exactly how you install and 
start your multiple Tomcat instances?

  - Chuck

Reply via email to