Quantcast

JAWR Causing functional tests to fail in jenkins

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

JAWR Causing functional tests to fail in jenkins

rsom@certifydatasystems.com
I included the JAWR plugin in my project to help with i18n in javascript.

When I run this locally, everything runs as expected.

    grails test-app functional:

However when I run this on jenkins, I'm running into an exception during startup:

2012-08-01 11:45:33,609 [pool-6-thread-1] FATAL      servlet.JawrGrailsServlet  - Jawr servlet with namejawrJavascriptServlet failed to initialize properly. 
2012-08-01 11:45:33,609 [pool-6-thread-1] FATAL      servlet.JawrGrailsServlet  - Cause: 
2012-08-01 11:45:33,610 [pool-6-thread-1] FATAL      servlet.JawrGrailsServlet  - 
java.lang.reflect.UndeclaredThrowableException
	at $Proxy127.getResource(Unknown Source)
	at net.jawr.web.resource.handler.reader.ServletContextResourceReaderHandler.getResource(ServletContextResourceReaderHandler.java:192)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostprocessBundle(ResourceBundlesHandlerImpl.java:892)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostProcessBundle(ResourceBundlesHandlerImpl.java:835)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndStoreBundle(ResourceBundlesHandlerImpl.java:766)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.initAllBundles(ResourceBundlesHandlerImpl.java:542)
	at net.jawr.web.resource.bundle.handler.CachedResourceBundlesHandler.initAllBundles(CachedResourceBundlesHandler.java:126)
	at net.jawr.web.resource.bundle.factory.BundlesHandlerFactory.buildResourceBundlesHandler(BundlesHandlerFactory.java:233)
	at net.jawr.web.resource.bundle.factory.PropertiesBasedBundlesHandlerFactory.buildResourceBundlesHandler(PropertiesBasedBundlesHandlerFactory.java:204)
	at net.jawr.web.servlet.JawrRequestHandler.initializeJawrConfig(JawrRequestHandler.java:349)
	at net.jawr.web.servlet.JawrRequestHandler.initRequestHandler(JawrRequestHandler.java:262)
	at net.jawr.web.servlet.JawrRequestHandler.<init>(JawrRequestHandler.java:200)
	at net.jawr.web.servlet.JawrGrailsServlet.init(JawrGrailsServlet.java:65)
	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)
Caused by: java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderProxyFactory$ResourceGeneratorReaderWrapperInvocationHandler.invoke(ResourceGeneratorReaderProxyFactory.java:167)
	... 27 more
Caused by: java.util.MissingResourceException: Can't find bundle for base name grails-app.i18n.messages, locale en_US
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
	at net.jawr.web.resource.bundle.locale.message.GrailsMessageBundleScriptCreator.createScript(GrailsMessageBundleScriptCreator.java:88)
	at net.jawr.web.resource.bundle.locale.ResourceBundleMessagesGenerator.createResource(ResourceBundleMessagesGenerator.java:96)
	at net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderWrapper.getResource(ResourceGeneratorReaderWrapper.java:135)
	... 32 more
2012-08-01 11:45:33,627 [pool-6-thread-1] ERROR      [localhost].[/healthdock]  - Servlet /healthdock threw load() exception
java.util.MissingResourceException: Can't find bundle for base name grails-app.i18n.messages, locale en_US
	at java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
	at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
	at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
	at net.jawr.web.resource.bundle.locale.message.GrailsMessageBundleScriptCreator.createScript(GrailsMessageBundleScriptCreator.java:88)
	at net.jawr.web.resource.bundle.locale.ResourceBundleMessagesGenerator.createResource(ResourceBundleMessagesGenerator.java:96)
	at net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderWrapper.getResource(ResourceGeneratorReaderWrapper.java:135)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	at java.lang.reflect.Method.invoke(Method.java:597)
	at net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderProxyFactory$ResourceGeneratorReaderWrapperInvocationHandler.invoke(ResourceGeneratorReaderProxyFactory.java:167)
	at $Proxy127.getResource(Unknown Source)
	at net.jawr.web.resource.handler.reader.ServletContextResourceReaderHandler.getResource(ServletContextResourceReaderHandler.java:192)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostprocessBundle(ResourceBundlesHandlerImpl.java:892)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostProcessBundle(ResourceBundlesHandlerImpl.java:835)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndStoreBundle(ResourceBundlesHandlerImpl.java:766)
	at net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.initAllBundles(ResourceBundlesHandlerImpl.java:542)
	at net.jawr.web.resource.bundle.handler.CachedResourceBundlesHandler.initAllBundles(CachedResourceBundlesHandler.java:126)
	at net.jawr.web.resource.bundle.factory.BundlesHandlerFactory.buildResourceBundlesHandler(BundlesHandlerFactory.java:233)
	at net.jawr.web.resource.bundle.factory.PropertiesBasedBundlesHandlerFactory.buildResourceBundlesHandler(PropertiesBasedBundlesHandlerFactory.java:204)
	at net.jawr.web.servlet.JawrRequestHandler.initializeJawrConfig(JawrRequestHandler.java:349)
	at net.jawr.web.servlet.JawrRequestHandler.initRequestHandler(JawrRequestHandler.java:262)
	at net.jawr.web.servlet.JawrRequestHandler.<init>(JawrRequestHandler.java:200)
	at net.jawr.web.servlet.JawrGrailsServlet.init(JawrGrailsServlet.java:65)
	at javax.servlet.GenericServlet.init(GenericServlet.java:160)
	at org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
	at org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
	at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
	at org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
	at org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
	at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
	at org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
	at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
	at java.util.concurrent.FutureTask.run(FutureTask.java:138)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
	at java.lang.Thread.run(Thread.java:662)

That causes all functional tests to fail.

Has anyone run into something similar? Does anyone have any suggestions on how to debug it?

This is the jawr configuration in Config.groovy:
jawr {
  js {
    // Specific mapping to disable resource handling by plugin.
    mapping = '/jawr/'

    bundle {
      lib {
        // Bundle id is used in views.
        id = '/i18n/messages.js'

        // Tell which messages need to localized in Javascript.
        mappings = 'messages:grails-app.i18n.messages'
      }
    }
  }
  locale {
    // Define resolver so ?lang= Grails functionality works with controllers.
    resolver = 'net.jawr.web.resource.bundle.locale.SpringLocaleResolver'
  }
}


R,
rahul

smime.p7s (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JAWR Causing functional tests to fail in jenkins

Antony Jones
Hi There,

I'm not sure what your exact situation is with regards to the JAWR
plugin, but we used to use it on a very large and complex project at a
client. Without any disrespect to the original author - we found it to
be an absolute pain in the ass. It only took me one day to move our
entire project from JAWR to the resources plugin, which is much easier
to use, cleaner, and less complicated, in addition to being ultimately
reliable.

If at all possible, I'd personally recommend that you drop JAWR and
move your project to use the resources plugin sooner rather than
later.

The only clue to fixing your issue I have is the following line:

Caused by: java.util.MissingResourceException: Can't find bundle for
base name grails-app.i18n.messages, locale en_US

Sounds like that file isn't found - I'd consider debugging your app to
find exactly how it is trying to load that file and where from.

Cheers,
Antony

On 1 August 2012 21:37, Rahul Somasunderam <[hidden email]> wrote:

> I included the JAWR plugin in my project to help with i18n in javascript.
>
> When I run this locally, everything runs as expected.
>
>     grails test-app functional:
>
> However when I run this on jenkins, I'm running into an exception during
> startup:
>
> 2012-08-01 11:45:33,609 [pool-6-thread-1] FATAL
> servlet.JawrGrailsServlet  - Jawr servlet with namejawrJavascriptServlet
> failed to initialize properly.
> 2012-08-01 11:45:33,609 [pool-6-thread-1] FATAL
> servlet.JawrGrailsServlet  - Cause:
> 2012-08-01 11:45:33,610 [pool-6-thread-1] FATAL
> servlet.JawrGrailsServlet  -
> java.lang.reflect.UndeclaredThrowableException
> at $Proxy127.getResource(Unknown Source)
> at
> net.jawr.web.resource.handler.reader.ServletContextResourceReaderHandler.getResource(ServletContextResourceReaderHandler.java:192)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostprocessBundle(ResourceBundlesHandlerImpl.java:892)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostProcessBundle(ResourceBundlesHandlerImpl.java:835)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndStoreBundle(ResourceBundlesHandlerImpl.java:766)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.initAllBundles(ResourceBundlesHandlerImpl.java:542)
> at
> net.jawr.web.resource.bundle.handler.CachedResourceBundlesHandler.initAllBundles(CachedResourceBundlesHandler.java:126)
> at
> net.jawr.web.resource.bundle.factory.BundlesHandlerFactory.buildResourceBundlesHandler(BundlesHandlerFactory.java:233)
> at
> net.jawr.web.resource.bundle.factory.PropertiesBasedBundlesHandlerFactory.buildResourceBundlesHandler(PropertiesBasedBundlesHandlerFactory.java:204)
> at
> net.jawr.web.servlet.JawrRequestHandler.initializeJawrConfig(JawrRequestHandler.java:349)
> at
> net.jawr.web.servlet.JawrRequestHandler.initRequestHandler(JawrRequestHandler.java:262)
> at
> net.jawr.web.servlet.JawrRequestHandler.<init>(JawrRequestHandler.java:200)
> at net.jawr.web.servlet.JawrGrailsServlet.init(JawrGrailsServlet.java:65)
> at javax.servlet.GenericServlet.init(GenericServlet.java:160)
> at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
> Caused by: java.lang.reflect.InvocationTargetException
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderProxyFactory$ResourceGeneratorReaderWrapperInvocationHandler.invoke(ResourceGeneratorReaderProxyFactory.java:167)
> ... 27 more
> Caused by: java.util.MissingResourceException: Can't find bundle for base
> name grails-app.i18n.messages, locale en_US
> at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
> at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
> at
> net.jawr.web.resource.bundle.locale.message.GrailsMessageBundleScriptCreator.createScript(GrailsMessageBundleScriptCreator.java:88)
> at
> net.jawr.web.resource.bundle.locale.ResourceBundleMessagesGenerator.createResource(ResourceBundleMessagesGenerator.java:96)
> at
> net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderWrapper.getResource(ResourceGeneratorReaderWrapper.java:135)
> ... 32 more
> 2012-08-01 11:45:33,627 [pool-6-thread-1] ERROR
> [localhost].[/healthdock]  - Servlet /healthdock threw load() exception
> java.util.MissingResourceException: Can't find bundle for base name
> grails-app.i18n.messages, locale en_US
> at
> java.util.ResourceBundle.throwMissingResourceException(ResourceBundle.java:1427)
> at java.util.ResourceBundle.getBundleImpl(ResourceBundle.java:1250)
> at java.util.ResourceBundle.getBundle(ResourceBundle.java:705)
> at
> net.jawr.web.resource.bundle.locale.message.GrailsMessageBundleScriptCreator.createScript(GrailsMessageBundleScriptCreator.java:88)
> at
> net.jawr.web.resource.bundle.locale.ResourceBundleMessagesGenerator.createResource(ResourceBundleMessagesGenerator.java:96)
> at
> net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderWrapper.getResource(ResourceGeneratorReaderWrapper.java:135)
> at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
> at
> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
> at
> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
> at java.lang.reflect.Method.invoke(Method.java:597)
> at
> net.jawr.web.resource.bundle.generator.ResourceGeneratorReaderProxyFactory$ResourceGeneratorReaderWrapperInvocationHandler.invoke(ResourceGeneratorReaderProxyFactory.java:167)
> at $Proxy127.getResource(Unknown Source)
> at
> net.jawr.web.resource.handler.reader.ServletContextResourceReaderHandler.getResource(ServletContextResourceReaderHandler.java:192)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostprocessBundle(ResourceBundlesHandlerImpl.java:892)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndPostProcessBundle(ResourceBundlesHandlerImpl.java:835)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.joinAndStoreBundle(ResourceBundlesHandlerImpl.java:766)
> at
> net.jawr.web.resource.bundle.handler.ResourceBundlesHandlerImpl.initAllBundles(ResourceBundlesHandlerImpl.java:542)
> at
> net.jawr.web.resource.bundle.handler.CachedResourceBundlesHandler.initAllBundles(CachedResourceBundlesHandler.java:126)
> at
> net.jawr.web.resource.bundle.factory.BundlesHandlerFactory.buildResourceBundlesHandler(BundlesHandlerFactory.java:233)
> at
> net.jawr.web.resource.bundle.factory.PropertiesBasedBundlesHandlerFactory.buildResourceBundlesHandler(PropertiesBasedBundlesHandlerFactory.java:204)
> at
> net.jawr.web.servlet.JawrRequestHandler.initializeJawrConfig(JawrRequestHandler.java:349)
> at
> net.jawr.web.servlet.JawrRequestHandler.initRequestHandler(JawrRequestHandler.java:262)
> at
> net.jawr.web.servlet.JawrRequestHandler.<init>(JawrRequestHandler.java:200)
> at net.jawr.web.servlet.JawrGrailsServlet.init(JawrGrailsServlet.java:65)
> at javax.servlet.GenericServlet.init(GenericServlet.java:160)
> at
> org.apache.catalina.core.StandardWrapper.initServlet(StandardWrapper.java:1266)
> at
> org.apache.catalina.core.StandardWrapper.loadServlet(StandardWrapper.java:1185)
> at org.apache.catalina.core.StandardWrapper.load(StandardWrapper.java:1080)
> at
> org.apache.catalina.core.StandardContext.loadOnStartup(StandardContext.java:5015)
> at
> org.apache.catalina.core.StandardContext.startInternal(StandardContext.java:5302)
> at org.apache.catalina.util.LifecycleBase.start(LifecycleBase.java:150)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1568)
> at
> org.apache.catalina.core.ContainerBase$StartChild.call(ContainerBase.java:1558)
> at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
> at java.util.concurrent.FutureTask.run(FutureTask.java:138)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
> at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
> at java.lang.Thread.run(Thread.java:662)
>
>
> That causes all functional tests to fail.
>
> Has anyone run into something similar? Does anyone have any suggestions on
> how to debug it?
>
> This is the jawr configuration in Config.groovy:
> jawr {
>   js {
>     // Specific mapping to disable resource handling by plugin.
>     mapping = '/jawr/'
>
>     bundle {
>       lib {
>         // Bundle id is used in views.
>         id = '/i18n/messages.js'
>
>         // Tell which messages need to localized in Javascript.
>         mappings = 'messages:grails-app.i18n.messages'
>       }
>     }
>   }
>   locale {
>     // Define resolver so ?lang= Grails functionality works with
> controllers.
>     resolver = 'net.jawr.web.resource.bundle.locale.SpringLocaleResolver'
>   }
> }
>
>
> R,
> rahul



--
________________________________
ꜽ . antony jones . http://www.enzy.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JAWR Causing functional tests to fail in jenkins

Zachlendon
We use the jawr plugin in Grails 2 for the same use case - wanting to expose our i18n message properties to javascript.  I'm unaware of a way to do this via the resources plugin, but if someone has done it that'd be great - we'd switch too.  We pluck internationalized messages from the messages.js with DustJS (mustache-like) client-side templates (using the DustJS Grails Resources Plugin).  The same type of helpers could be created with the Handlebars Grails Plugin as well pretty easily.  I demoed such a helper recently at Gr8ConfUS.

We have seen the error messages you have also but typically they only happen after a 'clean', and if we restart the application once again they work.  Be careful that you don't have CI jobs that are stomping on your .grails directory where the JS files are getting bundled by JAWR.  As the previous reply suggested, going into the .grails project directory and ensuring the message files are then is probably a good safe step.  You - perhaps - can also, if worst comes to worst, set up a hook to copy the messages.js file that gets created into your WAR file via something like what is noted in the configuration options here:

http://grails.org/doc/2.0.x/guide/deployment.html

I've not tried this or really evaluated what the best options might be within Grails 2 to do these type of file move shenanigans, but it might be an option to consider if keeping JAWR is really the only option for this (as we've believed it to be).

Ultimately I agree with the previous poster that the Jawr plugin is sub-optimal and this type of trickery is less than ideal.  But it's where we're at until someone suggests an alternative approach or someone writes a plugin to do this specific type of functionality...(*hint* *hint*)
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JAWR Causing functional tests to fail in jenkins

Antony Jones
> Ultimately I agree with the previous poster that the Jawr plugin is
> sub-optimal and this type of trickery is less than ideal.  But it's where
> we're at until someone suggests an alternative approach or someone writes a
> plugin to do this specific type of functionality...(*hint* *hint*)

Sounds like a good candidate for a resources-plugin plugin!

On 2 August 2012 00:37, Zachlendon <[hidden email]> wrote:

> We use the jawr plugin in Grails 2 for the same use case - wanting to expose
> our i18n message properties to javascript.  I'm unaware of a way to do this
> via the resources plugin, but if someone has done it that'd be great - we'd
> switch too.  We pluck internationalized messages from the messages.js with
> DustJS (mustache-like) client-side templates (using the DustJS Grails
> Resources Plugin).  The same type of helpers could be created with the
> Handlebars Grails Plugin as well pretty easily.  I demoed such a helper
> recently at Gr8ConfUS.
>
> We have seen the error messages you have also but typically they only happen
> after a 'clean', and if we restart the application once again they work.  Be
> careful that you don't have CI jobs that are stomping on your .grails
> directory where the JS files are getting bundled by JAWR.  As the previous
> reply suggested, going into the .grails project directory and ensuring the
> message files are then is probably a good safe step.  You - perhaps - can
> also, if worst comes to worst, set up a hook to copy the messages.js file
> that gets created into your WAR file via something like what is noted in the
> configuration options here:
>
> http://grails.org/doc/2.0.x/guide/deployment.html
>
> I've not tried this or really evaluated what the best options might be
> within Grails 2 to do these type of file move shenanigans, but it might be
> an option to consider if keeping JAWR is really the only option for this (as
> we've believed it to be).
>
> Ultimately I agree with the previous poster that the Jawr plugin is
> sub-optimal and this type of trickery is less than ideal.  But it's where
> we're at until someone suggests an alternative approach or someone writes a
> plugin to do this specific type of functionality...(*hint* *hint*)
>
>
>
> --
> View this message in context: http://grails.1312388.n4.nabble.com/JAWR-Causing-functional-tests-to-fail-in-jenkins-tp4632566p4632571.html
> Sent from the Grails - user mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>



--
________________________________
ꜽ . antony jones . http://www.enzy.org

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: JAWR Causing functional tests to fail in jenkins

rsom@certifydatasystems.com
I'm trying to get this together. How do I load the resource bundle from a controller?
I want to access message.properties as a file or a stream.

R,
rahul

On Aug 2, 2012, at 8:00 AM, Antony Jones wrote:

>> Ultimately I agree with the previous poster that the Jawr plugin is
>> sub-optimal and this type of trickery is less than ideal.  But it's where
>> we're at until someone suggests an alternative approach or someone writes a
>> plugin to do this specific type of functionality...(*hint* *hint*)
>
> Sounds like a good candidate for a resources-plugin plugin!
>
> On 2 August 2012 00:37, Zachlendon <[hidden email]> wrote:
>> We use the jawr plugin in Grails 2 for the same use case - wanting to expose
>> our i18n message properties to javascript.  I'm unaware of a way to do this
>> via the resources plugin, but if someone has done it that'd be great - we'd
>> switch too.  We pluck internationalized messages from the messages.js with
>> DustJS (mustache-like) client-side templates (using the DustJS Grails
>> Resources Plugin).  The same type of helpers could be created with the
>> Handlebars Grails Plugin as well pretty easily.  I demoed such a helper
>> recently at Gr8ConfUS.
>>
>> We have seen the error messages you have also but typically they only happen
>> after a 'clean', and if we restart the application once again they work.  Be
>> careful that you don't have CI jobs that are stomping on your .grails
>> directory where the JS files are getting bundled by JAWR.  As the previous
>> reply suggested, going into the .grails project directory and ensuring the
>> message files are then is probably a good safe step.  You - perhaps - can
>> also, if worst comes to worst, set up a hook to copy the messages.js file
>> that gets created into your WAR file via something like what is noted in the
>> configuration options here:
>>
>> http://grails.org/doc/2.0.x/guide/deployment.html
>>
>> I've not tried this or really evaluated what the best options might be
>> within Grails 2 to do these type of file move shenanigans, but it might be
>> an option to consider if keeping JAWR is really the only option for this (as
>> we've believed it to be).
>>
>> Ultimately I agree with the previous poster that the Jawr plugin is
>> sub-optimal and this type of trickery is less than ideal.  But it's where
>> we're at until someone suggests an alternative approach or someone writes a
>> plugin to do this specific type of functionality...(*hint* *hint*)
>>
>>
>>
>> --
>> View this message in context: http://grails.1312388.n4.nabble.com/JAWR-Causing-functional-tests-to-fail-in-jenkins-tp4632566p4632571.html
>> Sent from the Grails - user mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>    http://xircles.codehaus.org/manage_email
>>
>>
>
>
>
> --
> ________________________________
> ꜽ . antony jones . http://www.enzy.org
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>    http://xircles.codehaus.org/manage_email
>
>


smime.p7s (6K) Download Attachment
Loading...