gwt-dispatch + WebSphere 7

140 views
Skip to first unread message

gktcs

unread,
Oct 26, 2010, 11:56:58 PM10/26/10
to GWT Dispatch
Just curious if anyone has had any luck getting gwt-dispatch/Guice
deployed under WebSphere 7 (7.0.0.11)? I've got the following project
setup and working wonderfully under JBoss but have been forced to move
to WebSphere. From the WAS trace logs I can tell that the Guice
filter is being called, but the URIs defined in the ServletModule
appear not to be mapping to the servlet I have declared. WebSphere
ends up receiving the request and treating it as a file request and a
404 is returned. I feel like something simple is missing, but I've
come up empty so far. The configuration below works without issue
under JBoss 5.1. We're runing gwt-dispatch 1.1.0 and Guice 2.0.

web.xml entries
============
<filter>
<display-name>Guice Filter</display-name>
<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>test.dispatch.TestGuiceServletConfig</listener-
class>
</listener>

I have a ServerModule extends ActionHandlerModule class defined that
maps all of our actions to their handlers via the bindHandler call
inside of the configureHandlers method.

TestGuiceServletConfig extends GuiceServletContextListener
============================================
protected Injector getInjector() {
return Guice.createInjector(new ServerModule(), new
ServerDispatchModule(), new DispatchServletModule());
}

DispatchServletModule extends ServletModule
=================================
@Override
public void configureServlets() {
serve("/testapp/
dispatch").with(TestSecureDispatchServlet.class);
}

TestSecureDispatchServlet extends RemoteServiceServlet implements
SecureDispatchService and has the execute method to process the
incoming action.

I can see the guiceFilter being initialized and called in the WAS
traces, but the end result is the URI is treated as a file request and
a 404 is generated--the TestSecureDispatchServlet is never called to
process the request from the client. These entries are from the WAS
trace.log:
getRequestURI uri --> /context/testapp/dispatch
...
com.ibm.ws.webcontainer.webapp.WebAppErrorReport: SRVE0190E: File not
found: /testapp/dispatch

Any ideas would be greatly appreciated. Thanks.

David Peterson

unread,
Oct 27, 2010, 1:42:17 AM10/27/10
to gwt-di...@googlegroups.com
I haven't tested it I'm afraid, but I've generally avoided WebSphere - it seems to cause the most problems of all the containers I've come across. Not sure why exactly...

David

gktcs

unread,
Oct 27, 2010, 5:13:37 PM10/27/10
to GWT Dispatch
Well, in case anyone else runs into a similar issue, this link had a
solution that worked:
http://groups.google.com/group/google-guice/browse_thread/thread/493af2e2d5f0ea16/4971253e99f4a202

For some reason I misread/misunderstood and assumed the issue had been
modified in WebSphere 7; this was not the case.
I was unable to get the custom WAS properties to have any affect, and
declaring a SimpleFileServlet didn't make any difference for us
either.

Looks like it was an issue between Guice and WebSphere; Guice was
expecting a value for the servlet path and WebSphere was returning an
empty string, so the filter didn't match and the request wasn't passed
to our dispatch servlet.

Adding a filter that set the servlet path and having that filter
called before the guice filter fixed the issue.

Hope that helps.

On Oct 27, 1:42 am, David Peterson <da...@randombits.org> wrote:
> I haven't tested it I'm afraid, but I've generally avoided WebSphere - it
> seems to cause the most problems of all the containers I've come across. Not
> sure why exactly...
>
> David
>

lucabu

unread,
Nov 10, 2010, 10:02:02 AM11/10/10
to GWT Dispatch
Hello,

I have your very same problem using dispatcher, but with WS 6.1. You
told that:

"Adding a filter that set the servlet path and having that filter
called before the guice filter fixed the issue."

Can you please explain it in more detail? Whould be also useful if you
post some code.

Thank you in advance.


On 27 Ott, 22:13, gktcs <tdotstew...@gmail.com> wrote:
> Well, in case anyone else runs into a similar issue, this link had a
> solution that worked:http://groups.google.com/group/google-guice/browse_thread/thread/493a...
Reply all
Reply to author
Forward
0 new messages