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

        Arran Mccullough created issue -
        Arran Mccullough made changes -
        Field Original Value New Value
        Assignee Deryk Sinotte [ deryk.sinotte ]
        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.
        Deryk Sinotte made changes -
        Fix Version/s 3.3 [ 10370 ]
        Repository Revision Date User Message
        ICEsoft Public SVN Repository #34267 Sun Apr 07 18:04:32 MDT 2013 deryk.sinotte ICE-9135: adjust poms to properly pick up .js resources
        Files Changed
        Commit graph MODIFY /icefaces3/trunk/icefaces/core/pom.xml
        Commit graph MODIFY /icepush/trunk/icepush/core/pom.xml
        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.
        Deryk Sinotte made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Ken Fyten made changes -
        Status Resolved [ 5 ] Closed [ 6 ]

          People

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

            Dates

            • Created:
              Updated:
              Resolved: