Whenever there is some problem during the startup of Jawr, you will get an exception whe accessing a JSP that contains jawr tags. The trace will look as follows:
java.lang.IllegalStateException: ResourceBundlesHandler not present in servlet context. Initialization of Jawr either failed or never occurred.
To fix this problem, you must carefully check the console while the server is starting up, since surely there will be some kind of problem in the initialization process. If you can't see anything, ry and set the log level to debug for jawr so you see all that is being done. The cause for failure can be anything, but most likely there is something wrong with your configuration.
Sometimes, the error will come from a failure in a minifier. See below for solutions for this problem.
Ocasionally you might get an exception at startup with a trace similar to this:
FATAL net.jawr.web.servlet.JawrServlet - Cause: java.lang.RuntimeException [JSMin failed to minify the bundle with id: '[...]'.
To fix the syntax, check the full stacktrace of the exception, since an indication of where the error was encountered will be shown. Also, you can use JSLint, which is an online tool that checks the syntax of your scripts.
You may want to switch to a different minifier. JSLint, while normally efficient enough, is more prone to fail on valid-yet-weird syntax than other alternatives such as the YUI compressor (which is also more efficient anyway). To switch to a different minifier, follow instructions at the postprocessors guide.
However, you might also want to use the uncompressed version of the library so that you can use it in your debugging sessions. Doing this with Jawr is actually pretty simple. All you need to do is to declare two bundles, one for debug mode and another for production mode, then combine both into a composite. The composite can also contain additional scripts which you may want to combine with the library, aiming for minimal HTTP request overhead in your pages. This is an example configuration in which the SoundManager2 and JQuery libraries are both used this way:
jawr.js.bundle.lib.id=/bundles/myLibAndSomeStuff.js jawr.js.bundle.lib.composite=true jawr.js.bundle.lib.child.names=uncompressedLibrary,compressedLibrary,additionalScripts # A bundle with your own scripts jawr.js.bundle.additionalScripts.mappings=/myScript.js, [...] # The uncompressed library scripts jawr.js.bundle.uncompressedLibrary.mappings=/js/soundmanager2.js,/js/jquery.js jawr.js.bundle.uncompressedLibrary.debugonly=true # Will show only in debug mode # The compressed library scripts jawr.js.bundle.compressedLibrary.mappings=/js/final/soundmanager2.min.js,/js/final/jquery.min.gz.js jawr.js.bundle.compressedLibrary.debugnever=true # Will show only in production mode jawr.js.bundle.compressedLibrary.bundlepostprocessors=none # This line avoids minification of these scripts