jawr
  1. jawr
  2. JAWR-239

Issue with productionURL and dependencies

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 3.3.3
    • Fix Version/s: 3.5.1
    • Component/s: None
    • Labels:
      None
    • Environment:

      Java 7, Tomcat 7

      Description

      We use JAWR to serve content, but would like to also make use of a CDN to distribute scripts. For instance, to use jQuery, we have:

      jawr.js.bundle.jquery.id=/bundles/jquery.js
      jawr.js.bundle.jquery.mappings=/js/lib/.license,/js/lib/jquery-1.8.2.js
      jawr.js.bundle.jquery.productionURL=http://ajax.googleapis.com/ajax/libs/jquery/1.8.2/jquery.min.js
      

      That works great. We get the local library in debug mode, and the one from CDN in production mode. However, let's add:

      jawr.js.bundle.bootstrap.id=/bundles/bootstrap.js
      jawr.js.bundle.bootstrap.mappings=/js/lib/bootstrap-2.1.0/js/.license,/js/lib/bootstrap-2.1.0/js/bootstrap.js
      jawr.js.bundle.bootstrap.dependencies=jquery
      

      Now, upon access (not upon startup) of a page using /bundles/bootstrap.js, JAWR throws a nasty exception:

      java.lang.IllegalStateException: The bundleDataHashCode must be set before accessing the url prefix.
          at net.jawr.web.resource.bundle.JoinableResourceBundleImpl.getURLPrefix(JoinableResourceBundleImpl.java:560)
          ...
          at net.jawr.web.taglib.AbstractResourceBundleTag.doStartTag(AbstractResourceBundleTag.java:68)
          ...
      

      Does that mean I cannot depend on a bundle with a productionURL?

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            icefox
            Reporter:
            dr.piefel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: