Gaelyk i18n plugin 0.2 issue with Gaelyk 2.1.2

32 views
Skip to first unread message

Adrian Wijasa

unread,
May 15, 2014, 12:10:18 AM5/15/14
to gae...@googlegroups.com
Hello,

One of my Gaelyk projects uses gaelyk-i18n-plugin (https://github.com/sergerehem/gaelyk-i18n-plugin). When I run the local dev server using Gaelyk 2.1.2, I received an error message:

HTTP ERROR 500

Problem accessing /. Reason:

    access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.resources")

Caused by:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.resources")
    at groovyx.gaelyk.plugins.i18n.I18nPlugin$_run_closure2.doCall(I18nPlugin.groovy:85)
    at groovyx.gaelyk.plugins.i18n.I18nPlugin$_run_closure2.doCall(I18nPlugin.groovy)
    at groovyx.gaelyk.plugins.PluginsHandler.cloneDelegateAndExecute(PluginsHandler.groovy:244)
    at groovyx.gaelyk.plugins.PluginsHandler.cloneDelegateAndExecute(PluginsHandler.groovy)
    at groovyx.gaelyk.plugins.PluginsHandler.this$2$cloneDelegateAndExecute(PluginsHandler.groovy)
    at groovyx.gaelyk.plugins.PluginsHandler$_executeBeforeActions_closure5.doCall(PluginsHandler.groovy:207)
    at groovyx.gaelyk.plugins.PluginsHandler.executeBeforeActions(PluginsHandler.groovy:206)

I have tried putting gaelyk-i18n-plugin-0.2.jar in /lib and /src/main/webapp/WEB-INF/lib. Both yield the same error.

My other Gaelyk project that doesn't use gaelyk-i18n-plugin-0.2.jar compiles and runs just fine in local dev and Google App Engine's server.

gaelyk-i18n-plugin-0.2.jar runs just fine with Gaelyk 2.1. So, my project that uses i18n will just stick with 2.1 for now.

Thanks,

Adrian

Vladimír Oraný

unread,
May 15, 2014, 4:55:18 AM5/15/14
to gae...@googlegroups.com
HI Adrian,

this error usually happened with Groovy 2.1.x to 2.2.x. what jars do you have in your WEB-INF/lib? How do you run the application?


Vlad 


--
--
You've received this message because you've subscribed to the Gaelyk Google Group.
To send an email to the group, please write to: gae...@googlegroups.com
To unsuscribe from this group: gaelyk+un...@googlegroups.com
To show more options: http://groups.google.fr/group/gaelyk?hl=en

---
You received this message because you are subscribed to the Google Groups "Gaelyk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gaelyk+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Adrian Wijasa

unread,
May 15, 2014, 9:21:17 AM5/15/14
to gae...@googlegroups.com, vlad...@orany.cz
Hello Vlad,

I only have gaelyk-i18n-plugin-0.2.jar under WEB-INF/lib.

Under build\exploded-app\WEB-INF\lib, I have:
appengine-api-1.0-sdk-1.9.4.jar
appengine-api-labs-1.9.4.jar
commons-fileupload-1.3.1.jar
commons-io-2.4.jar
commons-lang3-3.3.2.jar
gaelyk-2.1.2.jar
gaelyk-i18n-plugin-0.2.jar
groovy-all-2.3.0.jar
http-builder-0.7.1.jar
httpclient-4.3.3.jar
httpcore-4.3.2.jar
jsp-api-2.2.jar
servlet-api-2.5.jar
sitemesh-3.0-alpha-2.jar

Here is how I ran the application:
1. Execute gradlew appengineRun using the command line (cmd)
2. Open localhost:8080 using Firefox
3. It then fails as soon as I reach this line of code in index.gtpl:
meta( "http-equiv": "content-language", content: i18n.getProperty( "locale" ) )

The error message refers to I18nPlugin.groovy:85. That line has "request.locale.toString()", which seems to be the source of the problem. I get the same error in urfschools, my Gaelyk web app that doesn't use i18n, when I add <% log.info request.locale.toString() %> on top of its index.gtpl.

Here is the version of the error message that I managed to reproduce in a non-i18n web app:

HTTP ERROR 500

Problem accessing /. Reason:

    access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.resources")
Caused by:

java.security.AccessControlException: access denied ("java.lang.RuntimePermission" "accessClassInPackage.sun.util.resources")
at SimpleTemplateScript2.run(SimpleTemplateScript2.groovy:1)

I bet there is something wrong with request.locale.toString(). Are you able to execute request.locale.toString() in your environment?

Thanks!

Adrian

Adrian Wijasa

unread,
Jun 24, 2014, 10:52:08 AM6/24/14
to gae...@googlegroups.com, vlad...@orany.cz
After upgrading my Java from 7 Update 60 to 8 Update 5, I don't see any i18n error anymore.

Sorry, I just noticed yesterday that Groovy 2.3 plays well with Java 8.

Thanks,

Adrian

Vladimír Oraný

unread,
Jun 26, 2014, 9:28:18 AM6/26/14
to gae...@googlegroups.com
nps, I'm glad it works for you again

Guus Vorsterman

unread,
Mar 5, 2015, 4:04:55 AM3/5/15
to gae...@googlegroups.com, vlad...@orany.cz
I have the i18n plugin 0.2 working with Gaelyk 2.1.2 an Java 8.

How do you change the locale? The doc says "You can change locale manually using session "locale' attribute"

In a groovlet I tried:

session.setAttribute("locale", "nl")
session.setAttribute("locale", new Locale("nl", "NL"))
session['locale'] = new Locale("nl", "NL")
session['locale'] = "nl"

I have messages_nl.properties and messages_nl_NL.properties

But in my template it always gets the translation from messages_en.properties





Op donderdag 26 juni 2014 15:28:18 UTC+2 schreef Vladimír Oraný:

Adrian Wijasa

unread,
Mar 6, 2015, 12:19:43 PM3/6/15
to gae...@googlegroups.com, vlad...@orany.cz
Hello Guus,

Sorry, I don't know the answer even though I use the i18n plugin. I used it just as a storage for my Strings, so that they will be easy to change later. I only have one messages.properties file.

As Vlad suggested, probably contacting the i18n plugin author will be the best approach for you.

Thanks,

Adrian
Reply all
Reply to author
Forward
0 new messages