Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error encountered with Jetty 9.4.57.v20241219 for type ID must be unique even though the type ID is unique in jetty.xml #12881

Closed
chetanlanje74 opened this issue Mar 6, 2025 · 11 comments
Labels
Bug For general bugs on Jetty side Unsupported Release For releases that are no longer supported

Comments

@chetanlanje74
Copy link

Jetty version(s)
9.4.57

Jetty Environment

Java version/vendor
openjdk version "1.8."

OS type/version
Ubuntu 20

Description
In below Jetty.xml

Getting Above Errors there When upgraded Jetty 9.4.57.v20241219, The errors mostly related to Make ID Unique

Usage: java -jar $JETTY_HOME/start.jar [options] [properties] [configs] java -jar $JETTY_HOME/start.jar --help # for more information [0.006s][info][gc] Using G1 OpenJDK 64-Bit Server VM warning: .hotspot_compiler file is present but has been ignored. Run with -XX:CompileCommandFile=.hotspot_compiler to load the file. 2025-03-06 08:17:34.102:INFO::main: Logging initialized @690ms to org.eclipse.jetty.util.log.StdErrLog 2025-03-06 08:17:34.297:WARN:oejx.XmlParser:main: ERROR@null line:26 col:24 : org.xml.sax.SAXParseException; lineNumber: 26; columnNumber: 24; Attribute value "pool" of type ID must be unique within the document. 2025-03-06 08:17:34.305:WARN:oejx.XmlParser:main: ERROR@null line:712 col:89 : org.xml.sax.SAXParseException; lineNumber: 712; columnNumber: 89; Attribute value "Handlers" of type ID must be unique within the document. 2025-03-06 08:17:34.306:WARN:oejx.XmlParser:main: ERROR@null line:744 col:32 : org.xml.sax.SAXParseException; lineNumber: 744; columnNumber: 32; Attribute value "Contexts" of type ID must be unique within the document. 2025-03-06 08:17:34.306:WARN:oejx.XmlParser:main: ERROR@null line:747 col:62 : org.xml.sax.SAXParseException; lineNumber: 747; columnNumber: 62; Attribute value "plusConfig" of type ID must be unique within the document. 2025-03-06 08:17:34.306:WARN:oejx.XmlParser:main: ERROR@null line:766 col:32 : org.xml.sax.SAXParseException; lineNumber: 766; columnNumber: 32; Attribute value "Contexts" of type ID must be unique within the document. 2025-03-06 08:17:34.306:WARN:oejx.XmlParser:main: ERROR@null line:769 col:62 : org.xml.sax.SAXParseException; lineNumber: 769; columnNumber: 62; Attribute value "plusConfig" of type ID must be unique within the document. 2025-03-06 08:17:34.307:WARN:oejx.XmlParser:main: ERROR@null line:795 col:32 : org.xml.sax.SAXParseException; lineNumber: 795; columnNumber: 32; Attribute value "Contexts" of type ID must be unique within the document. 2025-03-06 08:17:34.307:WARN:oejx.XmlParser:main: ERROR@null line:798 col:62 : org.xml.sax.SAXParseException; lineNumber: 798; columnNumber: 62; Attribute value "plusConfig" of type ID must be unique within the document. 2025-03-06 08:17:34.307:WARN:oejx.XmlParser:main: ERROR@null line:822 col:32 : org.xml.sax.SAXParseException; lineNumber: 822; columnNumber: 32; Attribute value "Contexts" of type ID must be unique within the document. 2025-03-06 08:17:34.307:WARN:oejx.XmlParser:main: ERROR@null line:825 col:62 : org.xml.sax.SAXParseException; lineNumber: 825; columnNumber: 62; Attribute value "plusConfig" of type ID must be unique within the document. 2025-03-06 08:17:34.309:WARN:oejx.XmlParser:main: ERROR@null line:944 col:26 : org.xml.sax.SAXParseException; lineNumber: 944; columnNumber: 26; Attribute value "RequestLog" of type ID must be unique within the document. 2025-03-06 08:17:34.309:WARN:oejx.XmlParser:main: ERROR@null line:993 col:51 : org.xml.sax.SAXParseException; lineNumber: 993; columnNumber: 51; Attribute value "oldhandler" of type ID must be unique within the document. 2025-03-06 08:17:34.310:WARN:oejx.XmlParser:main: ERROR@null line:1021 col:26 : org.xml.sax.SAXParseException; lineNumber: 1021; columnNumber: 26; Attribute value "http_local" of type ID must be unique within the document. 2025-03-06 08:17:34.310:WARN:oejx.XmlParser:main: ERROR@null line:1027 col:19 : org.xml.sax.SAXParseException; lineNumber: 1027; columnNumber: 19; Attribute value "ssl" of type ID must be unique within the document. 2025-03-06 08:17:34.310:WARN:oejx.XmlParser:main: ERROR@null line:1038 col:21 : org.xml.sax.SAXParseException; lineNumber: 1038; columnNumber: 21; Attribute value "admin" of type ID must be unique within the document. 2025-03-06 08:17:34.310:WARN:oejx.XmlConfiguration:main: java.security.PrivilegedActionException: org.xml.sax.SAXParseException; Unable to parse: file:///opt/zimbra/jetty_base/etc/jetty.xml at java.base/java.security.AccessController.doPrivileged(AccessController.java:573)

@chetanlanje74 chetanlanje74 added the Bug For general bugs on Jetty side label Mar 6, 2025
@joakime
Copy link
Contributor

joakime commented Mar 6, 2025

Jetty 9 is at End of Community Support.

Upgrade to a supported version of Jetty to get support.
Currently, that is Jetty 12.

Note: your errors are not coming from Jetty, they are coming from your JVM's XML implementation.
You have fundamental XML errors that need fixing.

https://jetty.org/docs/jetty/12/operations-guide/xml/index.html#syntax-ref

@joakime joakime closed this as completed Mar 6, 2025
@joakime joakime added the Unsupported Release For releases that are no longer supported label Mar 6, 2025
@prasads6971
Copy link

prasads6971 commented Mar 6, 2025

@chetanlanje74 I possibly have an answer. Since we resolved the unique id validation check issue with small change with one of the XML attributes - Ref.
if you see in the jetty.xml, that i had attached, we are using Ref with id as .
We replaced to in all places in the jetty xml. So basically replacing id with refid within Ref attribute.
eg.

<Ref refid="DefaultTimeZone">

With this change, the unique id validation check was successful.

@chetanlanje74
Copy link
Author

chetanlanje74 commented Mar 7, 2025

Thanks Much !!!! @prasads6971 & @joakime :)
in Jetty 9.4.57.v20241219

Above Error is Resolved now when replaced -->
<Arg><Ref id="pool"/></Arg> with <Arg><Ref refid="pool"/></Arg>

However i got another error as below ,Please give some suggestion on it --->

Caused by: org.xml.sax.SAXParseException; lineNumber: 8; columnNumber: 64; cvc-elt.1: Cannot find the declaration of element 'Configure'.

and code block in my Jetty.xml file is -->

?xml version="1.0" encoding="UTF-8"?
!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd"

!-- =============================================================== -->
!-- Configure the Jetty Server                                      -->
!--                                                                 -->
!-- Documentation of this file format can be found at:              -->
!-- http://docs.codehaus.org/display/JETTY/jetty.xml                -->
!--                                                                 -->
!-- =============================================================== -->


<Configure id="Server" class="org.eclipse.jetty.server.Server">

 <!-- =========================================================== -->
    <!-- Server Thread Pool                                          -->
    <!-- =========================================================== -->

    <Get name="ThreadPool" id="pool">
        <Set name="minThreads" type="int">10</Set>
        <Set name="maxThreads" type="int">%%zimbraHttpNumTh

i tried to replace http://www.eclipse.org/jetty/configure_9_3.dtd with https://jetty.org/configure_9_3.dtd
But did not work...

@prasads6971
Copy link

Before Configure it seems you are not correctly using the tag.
It should be with <Configure instead of only Configure

@chetanlanje74
Copy link
Author

Hi @prasads6971
No i am using --->
<Configure id="Server" class="org.eclipse.jetty.server.Server">
syntax only, Please find attached screenshot and error that i am getting ,(that was snippet issue so i write Configure instead of <Configure initially)

Image Image

@janbartel
Copy link
Contributor

@chetanlanje74 the file that is failing is file:///opt/zimbra/jetty-base/etc/jetty-setuid.xml . The snippet you posted looks more like a jetty.xml file.

@chetanlanje74
Copy link
Author

Hi @janbartel
Ohh , But i thought jetty-setuid.xml only throwing warning, Whereas severe issue is with Jetty.xml file which causing Above error
Anyway below is content of my Jetty-setuid.xml file , PFB Attached screenshot
Help me if any change need to do in above file...

Image

@janbartel
Copy link
Contributor

You are missing the DOCTYPE header from this file. Please check all your xml files against those in the jetty distribution to ensure they are of the correct form.

@prasads6971
Copy link

prasads6971 commented Mar 7, 2025

Verify below to check any missing dependencies of jetty
java -jar $JETTY_HOME/start.jar --list-modules

And also run in debug mode as well once to get detailed logs.
java -jar $JETTY_HOME/start.jar --debug

@prasads6971
Copy link

prasads6971 commented Mar 7, 2025

yes as @janbartel pointed out, you are missing the DOCTYPE. You may copy that from the one in jetty.xml

<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "http://www.eclipse.org/jetty/configure_9_3.dtd">

@chetanlanje74
Copy link
Author

chetanlanje74 commented Mar 7, 2025

Hi, @janbartel , @prasads6971
Yes i modified my Header in jetty-setuid.xml file and error/warning regarding setuid.xml file is solved,PFB
But still getting same error But this time in another line

Image Image

Code Block at line 24 in jetty.xml file

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug For general bugs on Jetty side Unsupported Release For releases that are no longer supported
Projects
None yet
Development

No branches or pull requests

4 participants