History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: GRAILS-770
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Blocker Blocker
Assignee: Graeme Rocher
Reporter: Scott Davis
Votes: 1
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
Grails

"grails dev war" produces a WAR that runs in Production instead of Dev

Created: 13/Feb/07 05:10 PM   Updated: 17/Apr/07 08:09 AM
Component/s: Configuration
Affects Version/s: 0.4.1
Fix Version/s: 0.5-RC1

Time Tracking:
Not Specified

Environment:
Mac OS X 10.4.8
Grails 0.4.1
Java 1.5.0_06


 Description  « Hide
I have MySQL configured in DevelopmentDataSource, HSQL configured in ProductionDataSource. When I run "grails dev war", the output says:

$ grails dev war
Welcome to Grails 0.4.1 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /opt/grails
Base Directory: /Users/sdavis/Documents/presentations/grails/src/bookstore
Environment set to development

But catalina.out in Tomcat 5.5.20 reports:

Feb 13, 2007 3:49:52 PM org.apache.catalina.startup.HostConfig deployWAR
INFO: Deploying web application archive bookstore.war
Attempting to load [13] core plugins
Grails plug-in [i18n] with version [0.4.1] loaded successfully
Grails plug-in [quartz] with version [0.4.1] loaded successfully
Grails plug-in [core] with version [0.4.1] loaded successfully
Grails plug-in [domainClass] with version [0.4.1] loaded successfully
Grails plug-in [controllers] with version [0.4.1] loaded successfully
Attempting to load [0] user defined plugins
Grails plug-in [dataSource] with version [0.4.1] loaded successfully
Grails plug-in [codecs] with version [0.4.1] loaded successfully
Grails plug-in [hibernate] with version [0.4.1] loaded successfully
Grails plug-in [services] with version [0.4.1] loaded successfully
Grails plug-in [scaffolding] with version [0.4.1] loaded successfully
[RuntimeConfiguration] Configuring for environment: Production
Building new Hibernate SessionFactory
58 beans defined in application context [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext;hashCode=7587680]
Using MessageSource [org.springframework.context.support.ReloadableResourceBundleMessageSource: basenames=[WEB-INF/grails-app/i18n/messages]]
Unable to locate ApplicationEventMulticaster with name 'applicationEventMulticaster': using default [org.springframework.context.event.SimpleApplicationEventMulticaster@4806d3]
[GrailsContextLoader] Grails application loaded.
Initializing filter 'reloadFilter'
Filter 'reloadFilter' configured successfully
Initializing filter 'grailsWebRequest'
Filter 'grailsWebRequest' configured successfully
Initializing servlet 'grails'
FrameworkServlet 'grails': initialization started
Using context class [org.codehaus.groovy.grails.commons.spring.GrailsWebApplicationContext] for servlet 'grails'
Using MultipartResolver [org.springframework.web.multipart.commons.CommonsMultipartResolver@3b43d0]
Using LocaleResolver [org.springframework.web.servlet.i18n.CookieLocaleResolver@e10d51]
Unable to locate ThemeResolver with name 'themeResolver': using default [org.springframework.web.servlet.theme.FixedThemeResolver@ba648]
No HandlerAdapters found in servlet 'grails': using default
Unable to locate RequestToViewNameTranslator with name 'viewNameTranslator': using default [org.springframework.web.servlet.view.DefaultRequestToViewNameTranslator@809b0d]
FrameworkServlet 'grails': initialization completed in 74 ms
Servlet 'grails' configured successfully

Data is not going to MySQL.



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Marc Palmer - 06/Apr/07 02:14 PM
The grails environment is not passed into WARs, it assumes WARs will only be production.

I think we need to put the environment specified when the WAR is built into the application.properties files copied into the WAR, and read it from there perhaps. Bit ugly with non-war execution which would check grails.env var.

This actually might be better tackled by fixing deployment so it doesn't include all the files for each environment, and the datasources are therefore renamed to DataSource.groovy as appropriate, similar to what happens to log files.

This should be easy now that I changed the War target to copy all files to ./staging so that we can do the file modifications in there.