Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

groovyserver's original CWD is used for ResourceBundle #65

Open
nobeans opened this issue Mar 8, 2016 · 0 comments
Open

groovyserver's original CWD is used for ResourceBundle #65

nobeans opened this issue Mar 8, 2016 · 0 comments

Comments

@nobeans
Copy link
Member

nobeans commented Mar 8, 2016

  • /tmp/rbundle/rbundle.groovy
//def b1 = ResourceBundle.getBundle("message", Locale.getDefault(), this.getClass().getClassLoader()) // --> OK

def b1 = ResourceBundle.getBundle("message") // -->NG

println b1.getString("key1")
  • /tmp/rbundle/message.properties
key1 = Hello!!!
key2 = World!!!
  • How to reproduce
$ (cd /Users && groovyserver -r)
$ groovyclient rbundle.groovy 
Caught: java.util.MissingResourceException: Can't find bundle for base name message, locale ja_JP
at rbundle.run(rbundle.groovy:6)
at org.jggug.kobo.groovyserv.GroovyInvokeHandler.invokeGroovy(GroovyInvokeHandler.groovy:120)
at org.jggug.kobo.groovyserv.GroovyInvokeHandler.this$2$invokeGroovy(GroovyInvokeHandler.groovy)
at org.jggug.kobo.groovyserv.GroovyInvokeHandler.run(GroovyInvokeHandler.groovy:54)

$ (cd /tmp/rbundle && groovyserver -r)
$ groovyclient rbundle.groovy 
Hello!!!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant