Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jetty-users] Setting up basic server problem

Hi,

You don't say how you are enabling your special server.xml file? Can you post your full run line? And the output of --list-config and --list-modules?

Also, you seem to have a bit of a mish-mash between jetty modules and rolling-your-own xml files.  For example, if you have all those other modules enabled, why don't you also just enable the http module, and set the jetty.http.port property to what you want in start.ini? In addition, are you sure you want to replace the handler structure set up in jetty.xml? You could instead add a handler to the ContextHandlerCollection.

That said, I tested a setup similar to yours (but using http module :)) placing your server.xml file onto the start line like so:  java -jar ../start.jar etc/server.xml  and I was able to deploy a very simple webapp and access it at "/". So I suspect the answer lies somewhere in the configuration and enablement of your server.xml file that you haven't shown us.

regards
Jan

On 19 April 2016 at 17:13, dairyman <dairyman@xxxxxxx> wrote:
Hello everybody,

this might be a ridiculously simple question for you but I'm stuck.

I want to setup a simple jetty server deploying a single .war webapp.
Using the Java code from the documentation's embedded examples
I cooked my own server.xml file, see below.
When starting up the server the log tells

Started o.e.j.w.WebAppContext@5b7a8434{/,file: /// tmp/ jetty-0.0.0.0-10912-
server.war-_-any-1474031351742553967.dir/webapp/,AVAILABLE}{/secret/jetty-
base/wars/server.war}
Started ServerConnector@352c1b98{HTTP/1.1,[http/1.1]}{0.0.0.0:10912}

which makes me believe the war file is found and read, as well as the port
open.  When connecting to a URL of the war in the browser however, I always
yield 404s. The only config files (listed in --list-config) are jetty-home/etc/
jetty.xml and my server.xml. Active modules are: ext, resources, server,
servlet, servlets, security, webapp. No other stuff in start.ini.

I know that the war is sane, because when I drop it into demo-base/webapps I
can easily access the war content in the browser.

What am I missing to access the war in the standalone setting?
Thanks for any hint!

Best Regards
dairyman

==== Workaround attachement ====

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

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

    <Call name="addConnector">
        <Arg>
            <New class="org.eclipse.jetty.server.ServerConnector">
                <Arg name="server"><Ref refid="mainServer" /></Arg>
                <Arg name="acceptors" type="int"><Property
name="jetty.http.acceptors" default="-1"/></Arg>
                <Arg name="selectors" type="int"><Property
name="jetty.http.selectors" default="-1"/></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>
                                <Arg name="compliance">
                                    <Call
class="org.eclipse.jetty.http.HttpCompliance" name="valueOf">
                                        <Arg>
                                            <Property
name="jetty.http.compliance" default="RFC7230"/>
                                        </Arg>
                                    </Call>
                                </Arg>
                            </New>
                        </Item>
                    </Array>
                </Arg>

                <Set name="host"><Property name="jetty.http.host"/></Set>
                <Set name="port"><Property name="jetty.http.port"
default="10912" /></Set>
                <Set name="idleTimeout"><Property
name="jetty.http.idleTimeout" default="5000"/></Set>
            </New>
        </Arg>
    </Call>

    <New id="webapp" class="org.eclipse.jetty.webapp.WebAppContext">
        <Set name="contextPath">/</Set>
        <Set name="war"><Property name="jetty.base" default="." />/wars/
server.war</Set>
    </New>

    <Set name="handler">
        <Ref refid="webapp"/>
    </Set>

</Configure>
_______________________________________________
jetty-users mailing list
jetty-users@xxxxxxxxxxx
To change your delivery options, retrieve your password, or unsubscribe from this list, visit
https://dev.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