Check out some of the acceptance tests in Sitebricks, they all use Guice
Servlet + Jetty.

http://code.google.com/p/google-sitebricks/source/checkout

On Fri, Sep 17, 2010 at 7:57 AM, batkins <[email protected]> wrote:

> I have an app build into a war file, and would like to use embedded
> jetty to run it.  In eclipse dev mode, everything works as expected,
> but when I try to use it standalone with embedded jetty, I get 404s on
> each of the servlets.  When I go to the context root (/jost), I get
> the HTML welcome page, as expected.
>
> The gwt.xml file has rename-to="jost".  My ServletModule is:
>
>    public void configureServlets() {
>        serve("/jost/test").with(TestServlet.class);
>        serve("/jost/register").with(RegServlet.class);
>    }
>
> web.xml is:
>
>    <filter>
>        <filter-name>guiceFilter</filter-name>
>        <filter-class>com.google.inject.servlet.GuiceFilter</filter-
> class>
>    </filter>
>
>    <filter-mapping>
>        <filter-name>guiceFilter</filter-name>
>        <url-pattern>/*</url-pattern>
>    </filter-mapping>
>
>    <listener>
>        <listener-
> class>com.netapp.rre.jost.server.guice.JostServletContextListener
>        </listener-class>
>    </listener>
>
>    <welcome-file-list>
>        <welcome-file>Jost.html</welcome-file>
>    </welcome-file-list>
>
> My jetty server is launched as follows:
>
>        Server server = new Server(8080);
>
>        WebAppContext webapp = new WebAppContext();
>        webapp.setContextPath("/jost");
>        webapp.setTempDirectory(new File("."));
>        webapp.setWar("jost.war");
>
>        server.setHandler(webapp);
>        server.start()
>        server.join();
>
> Here's output from my jetty launch:
>
> 2010-09-17 09:14:51.749:DBUG::STARTED
> [email protected]:8080
> org.eclipse.jetty.server.ser...@dc840f STOPPED
>  +-webappcont...@a56a7c@a56a7c/jost,file:/C:/p4/jost/server/
> webapp/,jost.war sta
> rted
>    +-sessionhand...@107ebe1 started
>       +-constraintsecurityhand...@544ec1 started
>          +-servlethand...@10f11b8 started
>             +-[/*]/[]==0=>guiceFilter{}
>             +-[/]=>default{maxCacheSize=256000000, dirAllowed=true,
> gzip=true,
> maxCachedFileSize=10000000, redirectWelcome=false, cacheType=both,
> acceptRanges=
> true, welcomeServlets=false, aliases=false, useFileMappedBuffer=true,
> maxCachedF
> iles=1000}
>             +-[*.jsp, *.jspf, *.jspx, *.xsp, *.JSP, *.JSPF, *.JSPX,
> *.XSP]=>jsp
> {logVerbosityLevel=DEBUG, fork=false, xpoweredBy=false, scratchdir=C:
> \p4\jost\se
> rver\jsp}
>             +-[/jost/gwt-log]=>remoteLoggerServiceImpl{}
>          +=roles=[]
>          +=/={TRACE={RoleInfo,F,C[]}}
>
> When request  http://localhost:8080/jost/register, I get
>
> 2010-09-17 09:23:22.383:DBUG::call servlet default
> 2010-09-17 09:23:22.383:DBUG::RESOURCE /register=null
> 2010-09-17 09:23:22.383:DBUG::RESOURCE /register=null
> 2010-09-17 09:23:22.383:DBUG::resource=null
> 2010-09-17 09:23:22.399:DBUG::RESPONSE /jost/register  404
> 2010-09-17 09:23:22.446:DBUG::EXCEPTION
>
> This is probably something right in front of me, but I've been banging
> my head against this wall for awhile now, and could use other eyes on
> it.  Any help would be most appreciated.
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "google-guice" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to
> [email protected]<google-guice%[email protected]>
> .
> For more options, visit this group at
> http://groups.google.com/group/google-guice?hl=en.
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"google-guice" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-guice?hl=en.

Reply via email to