Great, thanks for this hint.
So the solution here is to set, in Karaf's "etc/custom.properties"

org.apache.felix.http.require.config=true

It's not documented at https://github.com/apache/felix-dev/tree/master/http one has to look at the source.

On 6/6/2026 8:49 AM, Grzegorz Grzybek wrote:
Hello

The thread names in your log output explain the "problem".
First the feature service starts Jetty server, but later, Configuration Admin updates `org.apache.felix.http` PID and CM's ManagedService from Felix restarts the server based on non-default configuration.

Usually this "problem" (actually it's an OSGi dynamism in action) is avoided with options like "waitForConfigurationAdmin", where the Activator does not start its service if the configuration does not come from ConfigurationAdmin. We do it in Pax URL Aether and Pax Web too.
I'm not sure if such option is configuration in Felix HTTP.

kind regards
Grzegorz Grzybek

pt., 5 cze 2026 o 22:29 Martin Lichtin via user <[email protected]> napisał(a):

    Hi

    when loading Felix Jetty12, i.e. using bundles

    
<bundle>mvn:org.apache.felix/org.apache.felix.http.servlet-api/6.1.0</bundle>
    <bundle>mvn:org.apache.felix/org.apache.felix.http.jetty12/1.1.10</bundle>

    I'm seeing a weird startup behaviour.
    First Jetty comes up on its default port, then immediately it
    stops and restarts on the configured port.

    2026-06-05T22:12:47,160 | INFO  | features-3-thread-1            |
    Server             | org.eclipse.jetty.server.Server   555 |
    jetty12 - 1.1.10 | jetty-12.0.35; built: 2026-05-01T05:38:52.785Z;
    git: ae9286497b46fd709861e330fb364408a946d6e5; jvm 21.0.7+8-LTS-245
    2026-06-05T22:12:47,214 | INFO  | features-3-thread-1           |
    DefaultSessionIdManager | .session.DefaultSessionIdManager  328 |
    jetty12 - 1.1.10 | Session workerName=node0
    2026-06-05T22:12:47,263 | INFO  | features-3-thread-1           |
    ContextHandler          | ty.server.handler.ContextHandler  795 |
    jetty12 - 1.1.10 | Started
    
oeje10s.ServletContextHandler@5ceabbe{ROOT,/,b=null,a=AVAILABLE,h=oeje10s.SessionHandler@7b853b1e{STARTED}}
    2026-06-05T22:12:47,266 | INFO  | features-3-thread-1           |
    ServletContextHandler   | 10.servlet.ServletContextHandler 1056 |
    jetty12 - 1.1.10 | Started
    
oeje10s.ServletContextHandler@5ceabbe{ROOT,/,b=null,a=AVAILABLE,h=oeje10s.SessionHandler@7b853b1e{STARTED}}
    2026-06-05T22:12:47,272 | INFO  | features-3-thread-1           |
    Server                  | org.eclipse.jetty.server.Server   612 |
    jetty12 - 1.1.10 | Started
    oejs.Server@36bd8b51{STARTING}[12.0.35,sto=0] @87943ms
    2026-06-05T22:12:47,363 | INFO  | features-3-thread-1           |
    AbstractConnector       | e.jetty.server.AbstractConnector  326 |
    jetty12 - 1.1.10 | Started ServerConnector@43bd20cc{HTTP/1.1,
    (http/1.1)}{0.0.0.0:8080 <http://0.0.0.0:8080>}
    2026-06-05T22:12:47,366 | INFO  | features-3-thread-1           |
    http                    | http.jetty.internal.JettyService  455 |
    jetty12 - 1.1.10 | Started Jetty 12.0.35 at port(s) HTTP:8080
    <HTTP:8080> on context path /
    
[minThreads=8,maxThreads=200,acceptors=1,selectors=6,virtualThreadsEnabled=false]
    2026-06-05T22:12:47,612 | INFO  | : pid=[org.apache.felix.http]) |
    Server | org.eclipse.jetty.server.Server   652 | jetty12 - 1.1.10
    | Stopped oejs.Server@36bd8b51{STOPPING}[12.0.35,sto=0]
    2026-06-05T22:12:47,618 | INFO  | : pid=[org.apache.felix.http]) |
    AbstractConnector  | e.jetty.server.AbstractConnector  381 |
    jetty12 - 1.1.10 | Stopped ServerConnector@43bd20cc{HTTP/1.1,
    (http/1.1)}{0.0.0.0:8080 <http://0.0.0.0:8080>}
    2026-06-05T22:12:47,624 | INFO  | : pid=[org.apache.felix.http]) |
    ServletContextHandler  | 10.servlet.ServletContextHandler 1118 |
    jetty12 - 1.1.10 | Stopped
    
oeje10s.ServletContextHandler@5ceabbe{ROOT,/,b=null,a=AVAILABLE,h=oeje10s.SessionHandler@7b853b1e{STOPPED}}
    2026-06-05T22:12:47,627 | INFO  | : pid=[org.apache.felix.http]) |
    http | http.jetty.internal.JettyService  275 | jetty12 - 1.1.10 |
    Stopped Jetty
    2026-06-05T22:12:47,629 | INFO  | : pid=[org.apache.felix.http]) |
    Server | org.eclipse.jetty.server.Server   555 | jetty12 - 1.1.10
    | jetty-12.0.35; built: 2026-05-01T05:38:52.785Z; git:
    ae9286497b46fd709861e330fb364408a946d6e5; jvm 21.0.7+8-LTS-245
    2026-06-05T22:12:47,631 | INFO  | : pid=[org.apache.felix.http]) |
    DefaultSessionIdManager | .session.DefaultSessionIdManager  328 |
    jetty12 - 1.1.10 | Session workerName=node0
    2026-06-05T22:12:47,632 | INFO  | : pid=[org.apache.felix.http]) |
    ContextHandler | ty.server.handler.ContextHandler  795 | jetty12 -
    1.1.10 | Started
    
oeje10s.ServletContextHandler@21abe183{ROOT,/,b=null,a=AVAILABLE,h=oeje10s.SessionHandler@248f5f41{STARTED}}
    2026-06-05T22:12:47,633 | INFO  | : pid=[org.apache.felix.http]) |
    ServletContextHandler  | 10.servlet.ServletContextHandler 1056 |
    jetty12 - 1.1.10 | Started
    
oeje10s.ServletContextHandler@21abe183{ROOT,/,b=null,a=AVAILABLE,h=oeje10s.SessionHandler@248f5f41{STARTED}}
    2026-06-05T22:12:47,633 | INFO  | : pid=[org.apache.felix.http]) |
    Server | org.eclipse.jetty.server.Server   612 | jetty12 - 1.1.10
    | Started oejs.Server@f7ae73d{STARTING}[12.0.35,sto=0] @88304ms
    2026-06-05T22:12:47,660 | INFO  | : pid=[org.apache.felix.http]) |
    AbstractConnector  | e.jetty.server.AbstractConnector  326 |
    jetty12 - 1.1.10 | Started ServerConnector@a4f7439{HTTP/1.1,
    (http/1.1)}{0.0.0.0:8188 <http://0.0.0.0:8188>}
    2026-06-05T22:12:47,661 | INFO  | : pid=[org.apache.felix.http]) |
    http | http.jetty.internal.JettyService  455 | jetty12 - 1.1.10 |
    Started Jetty 12.0.35 at port(s) HTTP:8188 <HTTP:8188> on context
    path /
    
[minThreads=8,maxThreads=200,acceptors=1,selectors=6,virtualThreadsEnabled=false]

    Anyone understands why this occurs, and how it can be avoided?

    - Martin

    Karaf 4.4.11

Reply via email to