aspose file tools*
The moose likes Struts and the fly likes [Solved] Upgrading to Struts 2... nothing happens Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "[Solved] Upgrading to Struts 2... nothing happens" Watch "[Solved] Upgrading to Struts 2... nothing happens" New topic
Author

[Solved] Upgrading to Struts 2... nothing happens

Ryan Silva
Greenhorn

Joined: Nov 04, 2009
Posts: 7
Hi, I've read multiple tutorials on struts 2 and looked at multiple helloWorld apps. I'm sure I have everything set up right but I'm getting 404 File Not Found errors every time I try to access a URL that I think should go through struts. So obviously it's not set up right. I must not even have logging configured properly because I don't even see struts mentioned in the logs. All my search results for struts logging show me how to print log messages in a struts app but that's not what I need. I already have a log4j.properties file.

Here's my setup

web.xml has the following:

I have a struts.xml inside web-inf/classes:


and there is a struts2.jsp which I can access in the browser at the context root of the app.

This is a preexisting web app which is running in WebSphere and I have commented out every other filter and filter mapping in web.xml including even struts1.

I'm pretty stuck here because like I said I can't even see any errors in SystemOut.log--it's as if I didn't have the filter in web.xml in the first place.

Ryan Silva
Greenhorn

Joined: Nov 04, 2009
Posts: 7
Solved... it's a nasty Websphere bug.

Struts 2 uses a filter instead of a servlet, and apparently there is a WAS bug that prints 404 errors instead of letting the filter control things. The fix is to set

com.ibm.ws.webcontainer.invokefilterscompatibility

to true in Application Servers > server1 > Web container > Custom Properties

I found this here:
http://old.nabble.com/-S2--Websphere-6.1-Showcase-application%2C-Response-already-committed-warning-in-logs-td9679630.html#a9831115

Also, a sort of related fixpack is listed on the IBM site here:
http://www-01.ibm.com/support/docview.wss?uid=swg24014758

More specifically,

PROBLEM CONCLUSION:
The Webcontainer code has been modified to not send back a 404 FileNotFoundException, in response to a request for a nonexistent static file, if a filter effectively completes the request by not calling the next filter in the chain. Note that for the filters to be called when a static file which is a target of a request and does not exist, the following Webcontainer custom property must be set to 'true':

com.ibm.ws.webcontainer.invokefilterscompatibility
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: [Solved] Upgrading to Struts 2... nothing happens