Skip to main content

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

The method in now call setBaseResourceAsString, so use name=baseResourceAsString

Note this is a slightly strange style mixing an EE10 WebAppContext with a core ResourceHandler.    Typically if you are not using Servlets, just use a ContextHandler.  If you are using Servlet, then use a DefaultServlet to serve static content.



On Mon, 28 Oct 2024 at 06:32, Alexander Farber via jetty-users <jetty-users@xxxxxxxxxxx> wrote:
Good evening, could someone please help me with the syntax?

I am trying to migrate the following XML file from Jetty 10 to Jetty 12, but get the error:

Config error java.lang.NoSuchMethodException:
class org.eclipse.jetty.server.handler.ResourceHandler.setResourceBase(class java.lang.String)
at <Set name="handler">|       
<New class="org.eclipse.jetty.server.handler.ResourceHandler"><Set name="resourceBase">

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Configure PUBLIC "-//Jetty//Configure//EN" "https://jetty.org/configure_10_0.dtd">
<Configure class="org.eclipse.jetty.ee10.webapp.WebAppContext">
    <Set name="contextPath">/</Set>
    <Set name="welcomeFiles">
        <Array type="string">
            <Item>index.html</Item>
        </Array>
    </Set>
    <Set name="handler">
        <New class="org.eclipse.jetty.server.handler.ResourceHandler">
            <Set name="resourceBase">/var/www/html/wordsbyfarber.com</Set>
            <Set name="directoriesListed">true</Set>
        </New>
    </Set>
    <Get name="mimeTypes">
        <Call name="addMimeMapping">
            <Arg>js</Arg>
            <Arg>text/_javascript_;charset=utf-8</Arg>
        </Call>
    </Get>
</Configure>
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To unsubscribe from this list, visit https://www.eclipse.org/mailman/listinfo/jetty-users


--

Back to the top