tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Christian Nutz (JIRA)" <...@tapestry.apache.org>
Subject [jira] Created: (TAPESTRY-2273) Websphere 6.1 ear asset problem
Date Tue, 18 Mar 2008 10:11:25 GMT
Websphere 6.1 ear asset problem

                 Key: TAPESTRY-2273
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-2273
             Project: Tapestry
          Issue Type: Bug
          Components: Framework
    Affects Versions: 4.1.5, 4.1.3, 4.1.2
         Environment: WinXP SP2, Java 1.5.14, Tapestry 4.1.2 (also  4.1.5), IBM Websphere
            Reporter: Christian Nutz
            Priority: Critical
             Fix For: 4.1.6

We are using Tapestry 4.0 for our project and all works fine.
Now we want migrate to Tapestry 4.1.5 but in our Websphere environment css-assets are not
loaded (The css is embedded via Asset in the html header of our page).
In the source of the generated html page the css is not correct resolved and looks like this:

  <link href="/xyz/app?digest=xxxxx&amp;service=asset&amp;path=%2Fpage_x%2Fpage_x.css"
type="text/css" rel="stylesheet" id="Any_0"></link>

The correspondending java class creates the css link via "AbstractComponent.getAsset("pageCss").buildURL()".

The Websphere log says:

SRTServletRes W   WARNING: Cannot set header. Response already committed.

After debugging, we found the reason for this issue.

If you deploy an war file in Websphere application server, Websphere creates an ear file with
the war included. The classpath is:


And our directory structure looks like this:


Tapestry tries to load an Asset with an AssetFactory.
In the class org.apache.tapestry.assetAssetSourceImpl the method findAssetFactory(IComponentSpecification
spec, Resource baseResource, String path, Locale locale) is used for this.

It looks up the factory in this way:

AssetFactory findAssetFactory(IComponentSpecification spec, Resource baseResource, String
path, Locale locale) {
   // need to check these two core factories in order first

   if (_classpathAssetFactory.assetExists(spec, baseResource, path, locale))
       return _classpathAssetFactory;

   if (_contextAssetFactory.assetExists(spec, baseResource, path, locale))
       return _contextAssetFactory;

As you can see for the ear file, the styles directory is visble from classpath and _classpathAssetFactory.assetExists()
will return true.
And this is the problem.
Like in Tapestry 4.0, you have to check first _contextAssetFactory.assetExists() and then

After applying the patch (changing the order to return the assetFactory), the problem was
solved for us.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
For additional commands, e-mail: dev-help@tapestry.apache.org

View raw message