Archive for the ‘Jetty’ Category

Jetty: Configuration, Web Application, Virtual Hosting

Thursday, July 22nd, 2010

Set a WebApp directly from directory (without .war file)

    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            -->
    <!-- =========================================================== -->
    <Set name="handler">
      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
             <New id="akuiContext" class="org.eclipse.jetty.webapp.WebAppContext">
                <Set name="contextPath">/mywebapp</Set>
                <Set name="resourceBase">/path/to/single/mywebapp</Set>

Remote Debuging

#format: -agentlib:jdwp=name1[=value1],name2[=value2]...
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n start.jar

help: prints a brief message on how to use it and exits the VM.

server: (“n” or “y”) If “y,” listen for a debugger application to attach; otherwise, attach to the debugger application at the specified address.

address: transport address for the connection. If server=n, attempt to attach to a debugger application at this address. If server=y, listen for a connection at this address.

timeout: If server=y, this specifies the timeout, in milliseconds, to wait for the debugger to attach. If server=n, this specifies the timeout, in milliseconds, to use when attaching to the debugger.

suspend: If “y,” JVM suspends the execution until a debugger connects to the debuggee JVM.

More info: Techrepublic and Source: StackOverflow

Other links

Jetty: Files locked on Windows

Sunday, March 14th, 2010

On Windows the Jetty buffers locks file. To fix that, set the following in the application servlet context xml or webdefault.xml.

  <!-- default is true (you might want to keep it to true on your linux/production system) -->