productionURL and dependencies

» Back to forum topics
  1 post   Feedicon  
Replies: 0 - Last Post: October 22, 2012 07:48
by: dr.piefel
showing 1 - 1 of 1
Posted: October 22, 2012 07:48 by dr.piefel
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?
Replies: 0 - Last Post: October 22, 2012 07:48
by: dr.piefel