Hi Andy and Christian,

 

This is tangential to the original question, though I’ll share this in case it helps others.

 

I recently needed to solve “URI Too Long” errors that were encountered when the value of a query parameter in an HTTP GET request to a RESTXQ function exceeded a preset maximum length. Fortunately, there is a way to configure a higher limit by setting requestHeaderSize in jetty.xml as shown below.

 

I also wanted to be able to configure (and find out) the HTTP port for Jetty using a system property, and had to add a SystemProperty element in jetty.xml as shown below.

 

This is using BaseX version 11.9 which has Jetty version 11.0.25. I’ll have to try using BaseX 12 soon.

 

 

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

 

  <!-- increase max header size to resolve errors: "URI Too Long" and "WARN org.eclipse.jetty.http.HttpParser - URI is too large >8192" -->

  <New id="httpConfig" class="org.eclipse.jetty.server.HttpConfiguration">

    <Set name="requestHeaderSize">65536</Set>

  </New>

 

  <!-- Default connector. The Jetty stop port can be specified

       in the .basex or pom.xml configuration file.  -->

  <Call name="addConnector">

    <Arg>

      <New id="httpConnector" class="org.eclipse.jetty.server.ServerConnector">

        <Arg name="server"><Ref refid="Server"/></Arg>

        <Arg name="factories">

          <Array type="org.eclipse.jetty.server.ConnectionFactory">

            <Item>

              <New class="org.eclipse.jetty.server.HttpConnectionFactory">

                <Arg name="config">

                  <Ref refid="httpConfig"/>

                </Arg>

              </New>

            </Item>

          </Array>

        </Arg>

        <Set name="host">0.0.0.0</Set>

        <Set name="port"><SystemProperty name="jetty.http.port" default="8080"/></Set>

        <Set name="idleTimeout">60000</Set>

        <Set name="reuseAddress">true</Set>

      </New>

    </Arg>

  </Call>

</Configure>

 

 

I might have opted to use POST instead of GET for the RESTXQ function without needing to increase requestHeaderSize, but I was calling the RESTXQ function from XSLT using the doc() function.

 

Kind regards,

Vincent

 

 

_____________________________________________

Vincent M. Lizzi

Head of Information Standards | Taylor & Francis Group

vincent.lizzi@taylorandfrancis.com

Time zone: US Eastern  

 


Information Classification: General

From: Andy Bunce <bunce.andy@gmail.com>
Sent: Monday, August 4, 2025 5:55 PM
To: Christian Grün <cg@basex.org>
Cc: BaseX <basex-talk@mailman.uni-konstanz.de>
Subject: [basex-talk] Re: Websocket configuration Basex 12

 

Hi Christian,

 

Thanks for this. It sounds like a good approach and it is working for me with the latest release.

 

/Andy

 

On Mon, 4 Aug 2025 at 15:36, Christian Grün <cg@basex.org> wrote:

Hi Andy,

 

I wanted to introduce new options first, but I dropped this approach, and I decided to simulate the old behavior of Jetty. The init-param entries in the web.xml file are now parsed by BaseX and assigned to the WebSocket instance when the first WebSocket connection is created [1].

 

As a consequence, existing Jetty 9 web.xml WebSocket configurations should work again. Feel free to check out the latest snapshot [2] to verify if that’s true.

 

Best,

Christian

 

PS: The docs have been updated, too [3].

 

 


Von: Andy Bunce <bunce.andy@gmail.com>
Gesendet: Montag, 4. August 2025 00:39
An: BaseX <basex-talk@mailman.uni-konstanz.de>
Betreff: [basex-talk] Websocket configuration Basex 12

 

Hi,

 

I would like to increase the websocket message length from the default of 64 KB. 

The websocket documentation implies this can be done via web.xml [1] 

However, while searching for the syntax I came across the suggestion it is different with the Jetty version 12 API [2]

 

The Jetty docs have this example [3]

// Configure the ServerContainer.
            container.setDefaultMaxTextMessageBufferSize(128 * 1024);

but my quick code search of the BaseX source found nothing similar.

 

Is it possible to configure the webSocket  MaxTextMessageBufferSize in BaseX 12.0?


/Andy