Grails: Native2ascii error when I add a new property to message.properties
Asked Answered
P

7

12

I get a strange error when I add a new property to message.properties file in my grails application during runtime. When I restart the application via the command line, or restart STS, this error disappears. I am on version 2.0.1 and until a week ago, I was able to add new properties to message.properties file during runtime. Here is the stacktrace of the error

| Error 2012-06-18 16:54:58,702 [Thread-38] ERROR plugins.AbstractGrailsPluginManager  - Plugin [i18n:2.0.1] could not reload changes to file [/home/project/grails-app/i18n/messages.properties]: Error starting Sun's native2ascii: 
Message: Error starting Sun's native2ascii: 

Any ideas?

Pylon answered 18/6, 2012 at 11:29 Comment(2)
Maybe this helps.Amiens
Tried it but it didn't help. I still get: Error Error packaging application: Error occurred processing message bundles: Error starting Sun's native2ascii: (Use --stacktrace to see the full trace)Pylon
L
19

cd to jdk path

cp lib/tools.jar jre/lib/ext/tools.jar

It solves the issue.

Note: to get correct jdk path, check GGTS --> Windows --> Preferences --> Java --> Installed JREs --> JREs Home Path

Lukewarm answered 25/9, 2013 at 4:55 Comment(1)
it works~! (BTW, I use Ubuntu 14.04/ JDK1.8/ Maven )Gillyflower
M
11

You should be using JDK rather than JRE.

Also, if you don't need the native2ascii (which you probably don't), in BuildConfig.groovy use: grails.enable.native2ascii = false

Moises answered 31/8, 2012 at 12:14 Comment(0)
D
4

Very frustrating bug.

After I executed all the steps suggested above in this thread, grails app was STILL not seeing tools.jar...

GRRR!

For anyone experiencing this problem in GGTS when pointing to the 1.7 jdk (when setting the jre) persisting afterwards, you MUST do the following:

  1. Pick the correct jdk (1.7) in the "JRE Definition" panel within "Installed JRE's" in the GGTS Preferences panels.
  2. Watch the jars from that jdk populate in the JRE definition window panel at the bottom "JRE System Libraries".
  3. Check for tools.jar (mine DID NOT show up as recognized within the jdk lib or, after i tried 'zawmn83's post above) in /lib/ext.
  4. If tools.jar does not show up as recognized in the jdk, click the "Add External JARs..." button, find it, add it.

That completely solve my problem - THANK GOD!!!!

p.s. i also had to set my JAVA_HOME to my 1.7 jdk correctly, in my .bash_profile but, that's already called out here as part of the solution.

Thanks everyone for contributing on this one - this bug has been causing me brain damage whilst tinkering with it today, and the above suggestions got me 99% of the way there!

Define answered 30/10, 2013 at 23:36 Comment(0)
F
1

I had a similar problem, in the end I

  1. Removed the Debug Config for the Project
  2. Deleted the project (but NOT the files)
  3. Removed the .settings directory
  4. Removed the .classpath and .project files from the project
  5. Created a New General Project with the same name in the workspace
  6. Recreated the Debug -> Run as Run-App

Hope this helps

Fadil answered 8/11, 2013 at 4:20 Comment(1)
I don't know what this is downvoted. I just had the exact same issue with a project in GGTS and this solution worked again for me.Fadil
P
1

This happened to me when I installed java 8 in parallel with java 7 on Ubuntu but didn't properly configure it with update-alternatives. Specifically, JAVA_HOME was not set properly.

Preparation answered 30/6, 2016 at 15:56 Comment(0)
L
1

I had a similar error when compiling Grails 2 from the command line under linux.

Error packaging application: Error occurred processing message bundles: Error starting Sun's native2ascii:
...
Caused by: : Error starting Sun's native2ascii: 
...
Caused by: java.lang.ClassNotFoundException: sun.tools.native2ascii.Main`

I solved it by setting JAVA_HOME to JDK as mentioned above, something like

JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-1.7.0.161.x86_64

and not:

JAVA_HOME=/usr/lib/jvm/jre-1.7.0-openjdk.x86_64

also include $JAVA_HOME/bin in the PATH variable

Luthern answered 22/2, 2018 at 3:6 Comment(0)
C
0

On linux, running grails war command, it solves the issue

 cp /usr/lib/jvm/java-1.8.0-openjdk/lib/tools.jar /usr/lib/jvm/java-1.8.0-openjdk/jre/lib/ext/
Cologarithm answered 20/3, 2021 at 0:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.