My system default to the Locale: "iw", I created a few Locale files:
messages_iw.properties,
messages.properties
I check that grails indeed change the language file depending on the system locale and it did.
after this test i deleted the first file(messages_iw.properties) and lunched the grails server again (With IntelliJ + tomcat 8).
For some reason grails still referencing the file that i DELETED! how is it possible? i looked for this file everywhere and it doesn't exists. why does grails use a file i already deleted?
They're probably cached in a subdirectory of the target directory. Run
grails clean
and you should be all set; if that doesn't work, delete the entire target directory.
Related
I'm running a Grails build. For some reason, the .war file created sometimes does not get the appropriate .jar files loaded into the WEB-INF/lib folder. A subsequent Tomcat deployment fails. A co-worker that encountered this issue said to get rid of the .slcache in the user home folder on my windows server. I deleted the folder under c:/Users/myuser/.grails/.slcache. I re-ran a build and the .slcache is not getting recreated and I am still missing the .jar files.
Any idea what is happening and how to resolve?
Did you try changing the spark plugs (or at a minimum cleaning and re-gapping them) in your car? That'll be about as helpful.
The .slcache directory is created by spring-loaded, which Grails uses for class reloading when running the app with grails run-app. It has absolutely nothing to do with creating war files.
I am attempting to get a Grails project working but need help setting it up. I have an Ubuntu server running on a VM that has Redis installed. The project won't run unless I create a config file that can use Redis on the Ubuntu server. This is the settings I pulled down from GitHub located in the grails-app/conf/Config.groovy file.
http://snag.gy/eYhUY.jpg
I was told I need to create a separate config file that will override these parameters so my project will talk to the ubuntu server on my machine. This is a noob question but where do I create a config file? I can't seem to find a .grails folder. I know I'm suppose to reference my config file, once i've created one, in the grails-app/conf/Config.groovy file
http://snag.gy/SpGGt.jpg
Look at the grails.config.locations specified in your Config.grooy and you can create any of those locations for creating the external Config file.
I prefer using the classpath route. Here is what I would do.
Create a folder (say appConfig) and place it in the tomcat/conf folder.
Add the application config file (proghorn-config.groovy in your case) to the folder, with the required configurations in the file.
Add the folder to the Tomcat classpath by updating either the tomcat/conf/catalina.properties or by creating the tomcat/bin/setenv.sh
The location of the .grails folder depends upon the user account running the container (Tomcat, Jetty, etc.) which hosts your Grails application.
For example on Debian 6 running Tomcat 6.x the location is:
/usr/share/tomcat6/.grails/
You can also use static paths as well:
file:/usr/local/tomcat/conf/myspecific-config.groovy
I am using Grails 2.3.2 with GGTS and am doing development on two different machines (Mac and Windows). Each time I commit my project from one machine and update the other I have to refresh my dependencies. Is there a way I can set this to some sort of relative path? That way it doesn't have to change each time I do an update from my repository.
It seems that a full path is being included in my .project file as shown below.
<linkedResources>
<link>
<name>.link_to_grails_plugins</name>
<type>2</type>
<location>C:/Users/michael/workspace/myproject/target/work/plugins</location>
</link>
</linkedResources>
I changed it manually in the file, but GGTS seemed to change it back when I did the refresh. Has anyone else run into this problem?
After some looking around it looks like I can specify a path relative to my workspace using the WORKSPACE_LOC and building up a path relative to that within my .project file.
<linkedResources>
<link>
<name>.link_to_grails_plugins</name>
<type>2</type>
<location>WORKSPACE_LOC/myproject/target/work/plugins
</location>
</link>
</linkedResources>
The better is to not commit files generated by the GGTS and that are S.O. dependent.
If you're using git, there's a command to generate the file:
grails integrate-with --eclipse
If not, you can see the git file and ignore those files in the SVN.
I have an example Grails application (from Grails in Action) that was created a while ago under version 1.1.1 on a different PC.
I am now loading Grails 1.2.0 and want to revisit the app. However, when I try to run it I get this message:
Application expects grails version [1.1.1], but GRAILS_HOME is version [1.2.0] - use the correct Grails version or run 'grails upgrade' if this Grails version is newer than the version your application expects.
After reading around a bit I cleared out the 1.2.0 folder under .grails in my home directory (from previous attempts while exploring the issue), ran "grails clean" and "grails upgrade" (answering "y" where prompted).
However, I consistently get "Invalid duplicate class definition" conflicts between classes in \grails\qotd\src\java and \grails\qotd\grails-app{controllers,services,conf}.
Are there any additional manual steps that I need to perform?
I understood your problem.
The solution is just modify the grails vesion to 1.2.0 in application.properties file in your application
If, as you pointed out in the comments, your /src/java contains .groovy files - that could definitely cause unexpected behavior. I haven't hit your particular issue, but any time I had a .groovy file mismatched with the class name inside it, I'd get strange compilation issues - so I guess you could be having a similar issue.
If you have files / classes with the same names in two locations, that's the likely culprit. If you have .groovy files in /src/java, that's another potential source.
Also, putting BootStrap, Config, DataSource and URLMappings into /src/java, that's another potential source of issues. I'd clear out your /src/java by making sure all the files are in their appropriate places under grails-app.
You can upgrade grails version with 5 steps
Project -> Clean
application.properties -> Change app.grails.version
Your project -> Properties -> Grails -> Change grails installation
to new grails version.
Your project -> Grails tools -> Refresh Dependencies
I think this may be help you
Anyone knows how to fix this ?
It works fine on my env (Me being the developer) and doesn't work on my colleagues machine who unzips the whole
Welcome to Grails null - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: C:\abc\products\grails-1.1
Base Directory: C:\abc\products\foo\bar
Running script C:\abc\products\grails-1.1\scripts\RunApp.groovy
Environment set to development
Application expects grails version [1.1], but GRAILS_HOME is version [null] - us
e the correct Grails version or run 'grails upgrade' if this Grails version is n
ewer than the version your application expects.
Some clarifications
1) There has been no Grails version change , either on my machine or my colleagues machine. In fact some of them are installing for the first time
2) Under C:\Documents and Settings\myfriend.grails I can see a folder called 'null'
I tried removing this folder - but it gets created he runs my application
3) The way I am giving him the release is- I unzip the whole folder and he unzips it
SO there are three steps
A_ grails create-app to create the APp
B_ Unzip my folder to replace the generated folder
C_ Grails run-app
Things are fine after the step A- but degenerate after Step C
It appears that his Grails installation is corrupted or not set up correctly. I would have him reinstall a fresh copy of Grails - http://www.grails.org/Installation and try again.
The error that you are getting is telling us that the application that you are trying to run is identified as version 1.1 and I assume that this is correct. The fact that Grails is not able to identify what version is installed makes me point to a corrupted or mis-configured Grails installation
If he types 'grails' at the command line what does he see?
I found the problem.
This was because I had added a file- build.properties
And since the file was there- it was expecting it to have certain properties defined in it
Once I renamed it to something else- it started to work