Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] NoSuchMethodException at ResourceHandler

Hi Alex,

Have a read of the jetty-12.0 deployment documentation, I think it will fix your problem:

https://jetty.org/docs/jetty/12/operations-guide/deploy/index.html#rules-environment

cheers
Jan

On Sun, 3 Nov 2024 at 20:22, Alexander Farber via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
Hi Greg,

> From: Greg Wilkins <gregw@xxxxxxxxxxx>
> Here is an example from jetty-ee10/jetty-ee10-demos/jetty-ee10-demo-embedded/src/main/resources/fileserver.xml
> Note that whilst it is in ee10, it doesn't actually use a servlet context or any servlet stuff, as it is pure core Jetty:

the following  XML file unfortunately results in:

2024-11-03 10:17:16.189:WARN :oejx.XmlConfiguration:main: Unable to execute XmlConfiguration
java.lang.IllegalStateException: Unknown context type of oejs.Server@773cbf4f{STOPPED}[12.0.14,sto=0]
        at org.eclipse.jetty.deploy.providers.ContextProvider.createContextHandler(ContextProvider.java:465)
        at org.eclipse.jetty.deploy.App.getContextHandler(App.java:108)


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://jetty.org/configure_10_0.dtd">
<Configure id="FileServer" class="org.eclipse.jetty.server.Server">
  <Set name="handler">
    <New class="org.eclipse.jetty.server.handler.ContextHandler">
    <Set name="contextPath">/</Set>
    <Set name="baseResourceAsString"><SystemProperty name="jetty.base"/>/../wordsbyfarber.com</Set>
    <Set name="handler">
        <New class="org.eclipse.jetty.server.handler.ResourceHandler">
        <Set name="dirAllowed">true</Set>
        </New>
    </Set>
    </New>
    </Set>
</Configure>

I have set up Jetty 12 as: --add-module=http,server,resources,ee10-deploy,ee10-websocket-jetty

Best regards
Alex


_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users


--
Jan Bartel <janb@xxxxxxxxxxx>
www.webtide.com
Expert assistance from the creators of Jetty and CometD


Back to the top