ICEfaces
  1. ICEfaces
  2. ICE-9135

JavaScript errors when building 3.3.0 RC1 jars with Maven

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3
    • Fix Version/s: 3.3
    • Component/s: Release
    • Labels:
      None
    • Environment:
      ICEfaces 3.3.0 RC1

      Description

      When using Maven to build the jars and/or sample applications many JavaScript errors are thrown relating to not being able to find resources/code.

        Activity

        Hide
        Deryk Sinotte added a comment -

        Based on my initial analysis, there are a couple of issues with the Maven build of showcase:

        1) The minor issue (not related to the main problem reported in the forum) is that all the themes are not included. There was a property called "includeThemeJars" that was added to the Ant build file as per ICE-8921. However, the dependencies were never added to the Maven pom so the themes are not included. However, this only impacts the functionality of the showcase exception that the theme switcher won't work.

        2) The bigger problem is that the Maven builds are no longer including some important JavaScript resources. Turning on "Development" mode, the following is logged when running the version of showcase built with Maven:

        Apr 7, 2013 10:36:31 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
        WARNING: JSF1064: Unable to find or serve resource, bridge.uncompressed.js, from library, ice.core.
        Apr 7, 2013 10:36:31 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource
        WARNING: JSF1064: Unable to find or serve resource, icepush.uncompressed.js, from library, ice.push.

        Looking at the icefaces.jar and icepush.jar, I can see that the resources are not the same. In the Ant version of the iceface.jar:

        watnotte-pro:webapps deryk$ jar -tf icefaces.jar 
        ...
        META-INF/resources/ice.core/coallesced.js
        META-INF/resources/ice.core/bridge.js
        META-INF/resources/ice.core/bridge.uncompressed.js
        ...

        Whereas in the Maven build of the library, only the coalesced file is available:

        watnotte-pro:webapps deryk$ jar -tf icefaces-3.3.0-SNAPSHOT.jar 
        ...
        META-INF/resources/ice.core/coallesced.js
        ...

        I thought that another workaround that might work is setting the property that uses the coallesced versions of the javascript resources:

        <context-param>
            <param-name>org.icefaces.coalesceResources</param-name>
            <param-value>true</param-value>
        </context-param>

        However, the coallesced.js file is just a dummy file used as a placeholder so that JSF has a "real" resource to find when a request is made. We actually do the coalescing when the request is made. It has to be dynamic this way because we don't really know the extent of the resources that will be included. However, the base .js files are missing and need to be there in all cases so that's where I'm looking.

        Show
        Deryk Sinotte added a comment - Based on my initial analysis, there are a couple of issues with the Maven build of showcase: 1) The minor issue (not related to the main problem reported in the forum) is that all the themes are not included. There was a property called "includeThemeJars" that was added to the Ant build file as per ICE-8921 . However, the dependencies were never added to the Maven pom so the themes are not included. However, this only impacts the functionality of the showcase exception that the theme switcher won't work. 2) The bigger problem is that the Maven builds are no longer including some important JavaScript resources. Turning on "Development" mode, the following is logged when running the version of showcase built with Maven: Apr 7, 2013 10:36:31 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, bridge.uncompressed.js, from library, ice.core. Apr 7, 2013 10:36:31 AM com.sun.faces.application.resource.ResourceHandlerImpl logMissingResource WARNING: JSF1064: Unable to find or serve resource, icepush.uncompressed.js, from library, ice.push. Looking at the icefaces.jar and icepush.jar, I can see that the resources are not the same. In the Ant version of the iceface.jar: watnotte-pro:webapps deryk$ jar -tf icefaces.jar ... META-INF/resources/ice.core/coallesced.js META-INF/resources/ice.core/bridge.js META-INF/resources/ice.core/bridge.uncompressed.js ... Whereas in the Maven build of the library, only the coalesced file is available: watnotte-pro:webapps deryk$ jar -tf icefaces-3.3.0-SNAPSHOT.jar ... META-INF/resources/ice.core/coallesced.js ... I thought that another workaround that might work is setting the property that uses the coallesced versions of the javascript resources: <context-param> <param-name>org.icefaces.coalesceResources</param-name> <param-value> true </param-value> </context-param> However, the coallesced.js file is just a dummy file used as a placeholder so that JSF has a "real" resource to find when a request is made. We actually do the coalescing when the request is made. It has to be dynamic this way because we don't really know the extent of the resources that will be included. However, the base .js files are missing and need to be there in all cases so that's where I'm looking.
        Hide
        Deryk Sinotte added a comment -

        I've added a fix for the missing resources (problem #2 above). Basically adjusted the pons to look through the resources build dir recursively for .js files and make sure they were added. Not sure when this behaviour would have changed but it should be more forgiving now.

        Show
        Deryk Sinotte added a comment - I've added a fix for the missing resources (problem #2 above). Basically adjusted the pons to look through the resources build dir recursively for .js files and make sure they were added. Not sure when this behaviour would have changed but it should be more forgiving now.
        Hide
        Deryk Sinotte added a comment -

        Marking as fixed. I have opened a separate case, ICE-9141, for the themes problem.

        Show
        Deryk Sinotte added a comment - Marking as fixed. I have opened a separate case, ICE-9141 , for the themes problem.

          People

          • Assignee:
            Deryk Sinotte
            Reporter:
            Arran Mccullough
          • Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: