Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tridion CWA 2011 Binaries Return 404 Until Refreshed

My client is having an issue after upgrading from CWA 1.5 to CWA 2011 running on WebSphere. The issue is that any binary resources requested return a 404. When the request is resubmitted (i.e. the page is refreshed/reloaded), then they load.

I have no access to their environment and have to get all the config files via third party. I was wondering if anyone has any ideas off the top of their heads on what could be causing these 404s on binaries?

like image 677
Nickoli Roussakov Avatar asked Feb 06 '13 13:02

Nickoli Roussakov


3 Answers

Starting with Websphere 6.1, IBM changed the behavior of filters and these will not be executed if the URL you're calling doesn't actually exist on the server.

This means that a request for /somefile.png that is still on the DB will result in a (technically correct) 404 but completely not what you expect with a CWA enabled web application.

The solution is to make the filter invoke on a request without a servlet mapping and you should be able to do the following in the WebSphere Admin Console:

  1. Click Servers -> Server Types -> Websphere Application Server -> -> Web Container Settings -> Web Container
  2. Under additional settings click on custom properties
  3. On custom properties page, click New and then enter "com.ibm.ws.webcontainer.invokefilterscompatibility" as the property name and "true" as the value
  4. Save the update and restart the server
like image 170
Elena Serghie Avatar answered Sep 28 '22 11:09

Elena Serghie


It is a long time since I have used CWA, but IIRC it serializes the binaries to disk on request, and caches them for future requests. It sounds like that process is just taking too long, so you get a 404 the first request for a binary. I have heard of this before on WebSphere, are you sure it was not happening with the old CWA also?

If the issue continues, I suggest contacting SDL Customer Support.

like image 32
Chris Summers Avatar answered Sep 28 '22 12:09

Chris Summers


In the cd_cwa_conf.xml file, you can also add the following parameter:

<configuration>
... 
   <!-- Number of seconds to wait for the default Servlet to pick up changes on the file-system -->
    <file-synchronization delay="..." />
...
</configuration>

As Chris has said, the first time a binary is requested then the file is serialized and cached on the disk. If the process is too long then the app server will return a 404.

With this parameter, the system will wait for few seconds (ie the specified value) before accessing the file.

We had the same issue with a Tomcat server and this has fixed the pb.

like image 43
Sébastien PRAT Avatar answered Sep 28 '22 13:09

Sébastien PRAT