|
I have a grails 2.0.1 project and using STS 2.9.1. This is really odd
and I am wondering if anyone has experienced the following behavior.. When I perform a grails run-war or war and deploy to a remote tomcat server all is well with the project, the configuration data is current with the contents of the Config.groovy file. When I perform a grails run-app or Debug as run-app from STS, the instance of the app has some outdated Config.groovy and some old controller code. The application configuration data does not agree with the contents of the file in the application directory. I've tried various iterations of clean and compile to no avail. I've even created a brand new app with a different name and the run-app still shows the wrong data in the grailsApplication.config Has anyone seen this behavior? Any suggestions? Where to look? Thanks much, -marty --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
On Wed, Apr 18, 2012 at 12:42 PM, Martin McLaughlin <[hidden email]> wrote:
I have a grails 2.0.1 project and using STS 2.9.1. This is really odd and I am wondering if anyone has experienced the following behavior..
There were some pretty significant problems with early grails 2 releases and STS 2.9.1. I thought 2.0.1 actually worked OK, but I'd try 2.0.3 before doing just about anything in order to make sure you have a grails release that is actually compatible with STS.
|
|
I've updated the project to 2.0.3 as you suggest.
I still get properties in the grailsApplication.config that are artifacts from a different app when I perform a run-app or debug as run-app. When I perform a run-war, I am getting the data I expect from the Config.groovy file. It looks self inflicted. I don't know where it is picking up Config data in the run-app. I can see from the atime that the Config.groovy I expect is being read. It's like there is some artifact somewhere on the disk that I can't find and clean. I've been scouring the disk, but coming up empty. -marty |
|
On 19/04/2012 13:46, Marty McLaughlin wrote:
> I've updated the project to 2.0.3 as you suggest. > > I still get properties in the grailsApplication.config that are artifacts > from a different app when I perform a run-app or debug as run-app. When I > perform a run-war, I am getting the data I expect from the Config.groovy > file. > > It looks self inflicted. I don't know where it is picking up Config data in > the run-app. I can see from the atime that the Config.groovy I expect is > being read. It's like there is some artifact somewhere on the disk that I > can't find and clean. Are you doing the run-war in dev or prod mode? Do you have any environments {} blocks in Config.groovy or any external config files that might be messing things up? Ian -- Ian Roberts | Department of Computer Science [hidden email] | University of Sheffield, UK --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
I've done the run-war in both dev and prod modes. No external configs.
================================ This is the contents of the Config.groovy in it's current incarnation: The place where I'm getting funky is in the uvm and rnt section at the bottom. Config.groovy: // locations to search for config files that get merged into the main config // config files can either be Java properties files or ConfigSlurper scripts // grails.config.locations = [ "classpath:${appName}-config.properties", // "classpath:${appName}-config.groovy", // "file:${userHome}/.grails/${appName}-config.properties", // "file:${userHome}/.grails/${appName}-config.groovy"] // if (System.properties["${appName}.config.location"]) { // grails.config.locations << "file:" + System.properties["${appName}.config.location"] // } grails.project.groupId = appName // change this to alter the default package name and Maven publishing destination grails.mime.file.extensions = true // enables the parsing of file extensions from URLs into the request format grails.mime.use.accept.header = false grails.mime.types = [ html: ['text/html','application/xhtml+xml'], xml: ['text/xml', 'application/xml'], text: 'text/plain', js: 'text/javascript', rss: 'application/rss+xml', atom: 'application/atom+xml', css: 'text/css', csv: 'text/csv', all: '*/*', json: ['application/json','text/json'], form: 'application/x-www-form-urlencoded', multipartForm: 'multipart/form-data' ] // URL Mapping Cache Max Size, defaults to 5000 //grails.urlmapping.cache.maxsize = 1000 // What URL patterns should be processed by the resources plugin grails.resources.adhoc.patterns = ['/images/*', '/css/*', '/js/*', '/plugins/*'] // The default codec used to encode data with ${} grails.views.default.codec = "none" // none, html, base64 grails.views.gsp.encoding = "UTF-8" grails.converters.encoding = "UTF-8" // enable Sitemesh preprocessing of GSP pages grails.views.gsp.sitemesh.preprocess = true // scaffolding templates configuration grails.scaffolding.templates.domainSuffix = 'Instance' // Set to false to use the new Grails 1.2 JSONBuilder in the render method grails.json.legacy.builder = false // enabled native2ascii conversion of i18n properties files grails.enable.native2ascii = true // packages to include in Spring bean scanning grails.spring.bean.packages = [] // whether to disable processing of multi part requests grails.web.disable.multipart=false // request parameters to mask when logging exceptions grails.exceptionresolver.params.exclude = ['password'] // enable query caching by default grails.hibernate.cache.queries = true // set per-environment serverURL stem for creating absolute links environments { development { grails.logging.jul.usebridge = true } production { grails.logging.jul.usebridge = false // TODO: grails.serverURL = "http://www.changeme.com" } } // log4j configuration log4j = { // Example of changing the log pattern for the default console // appender: // //appenders { // console name:'stdout', layout:pattern(conversionPattern: '%c{2} %m%n') //} error 'org.codehaus.groovy.grails.web.servlet', // controllers 'org.codehaus.groovy.grails.web.pages', // GSP 'org.codehaus.groovy.grails.web.sitemesh', // layouts 'org.codehaus.groovy.grails.web.mapping.filter', // URL mapping 'org.codehaus.groovy.grails.web.mapping', // URL mapping 'org.codehaus.groovy.grails.commons', // core / classloading 'org.codehaus.groovy.grails.plugins', // plugins 'org.codehaus.groovy.grails.orm.hibernate', // hibernate integration 'org.springframework', 'org.hibernate', 'net.sf.ehcache.hibernate' } uvm{ queries{ student_info=''' select SPRIDEN_PIDM, SPRIDEN_ID, SPRIDEN_LAST_NAME, SPRIDEN_FIRST_NAME, SPRIDEN_MI , SPBPERS_PREF_FIRST_NAME, spbpers_confid_ind, spbpers_birth_date, gwbntid_netid , SPRADDR_STREET_LINE1, SPRADDR_STREET_LINE2, SPRADDR_STREET_LINE3, SPRADDR_STREET_LINE4 , SPRADDR_CITY, SPRADDR_STAT_CODE,SPRADDR_ZIP -- Get CSO first, else get most recent 'student' email address , NVL((select goremal_email_address from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code = 'CSO') ,(select goremal_email_address from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code NOT IN ('FAP', 'AUTH', 'FWSS', 'PY') and goremal_activity_date = (select max(goremal_activity_date) from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code NOT IN ('FAP', 'AUTH', 'FWSS', 'PY') ))) "GOREMAL_EMAIL_ADDRESS" --Dummy for testing because AIST is full of crap data..... -- , SPRIDEN_FIRST_NAME || '.' || SPRIDEN_LAST_NAME || '-' || gwbntid_netid || '@uvm.edu' "GOREMAL_EMAIL_ADDRESS" , CASE WHEN gwbntid_netid is null then null ELSE gwbntid_netid || '@uvm.edu' END "alternateEmail" from spriden, spbpers, gwbntid, spraddr where spriden_change_ind is null and SPRIDEN_ENTITY_IND = 'P' and spriden_pidm = ? and spriden_pidm = spbpers_pidm and spriden_pidm = gwbntid_pidm (+) and spraddr.rowid = rowidtochar(swf_addr_row(spriden_pidm, 'AP,AL', sysdate)) ''' student_email=''' select goremal_emal_code, goremal_email_address from goremal where goremal_pidm = ? and goremal_status_ind = 'A' ''' //student_pidm="select spriden_pidm from spriden where spriden_id = ? and spriden_change_ind is null" student_pidm="select gb_common.f_get_pidm(?) pidm from dual" fetch_population = ''' select glbextr_key from glbextr where glbextr_application = ? and glbextr_selection = ? and glbextr_creator_id = ? and glbextr_user_id = ? ''' } } rnt{ uid = "IDID" pwd = "PWD" appid = "MLM Tester" buff_size = 500 } Snippet from render(text: grailsApplication.config, contentType: "text/plain", encoding: "UTF-8") when doing a run-app from the command line: (Sorry it is verbose) but the uvm={queries={student_info= query is wrong as is the rnt.buff_size log4j=Config$_run_closure2@27222045, uvm={queries={student_info= select SPRIDEN_PIDM, SPRIDEN_ID, SPRIDEN_LAST_NAME, SPRIDEN_FIRST_NAME, SPRIDEN_MI , SPBPERS_PREF_FIRST_NAME, spbpers_confid_ind, spbpers_birth_date, gwbntid_netid , SPRADDR_STREET_LINE1, SPRADDR_STREET_LINE2, SPRADDR_STREET_LINE3, SPRADDR_STREET_LINE4 , SPRADDR_CITY, SPRADDR_STAT_CODE,SPRADDR_ZIP -- Get CSO first, else get most recent 'student' email address -- , NVL((select goremal_email_address from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code = 'CSO') -- ,(select goremal_email_address from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code NOT IN ('FAP', 'AUTH', 'FWSS', 'PY') -- and goremal_activity_date = (select max(goremal_activity_date) from goremal where goremal_pidm = spriden_pidm and goremal_status_ind = 'A' and goremal_emal_code NOT IN ('FAP', 'AUTH', 'FWSS', 'PY') ))) "GOREMAL_EMAIL_ADDRESS" --Dummy for testing because AIST is full of crap data..... , SPRIDEN_FIRST_NAME || '.' || SPRIDEN_LAST_NAME || '-' || gwbntid_netid || '@uvm.edu' "GOREMAL_EMAIL_ADDRESS" , CASE WHEN gwbntid_netid is null then null ELSE gwbntid_netid || '@uvm.edu' END "alternateEmail" from spriden, spbpers, gwbntid, spraddr where spriden_change_ind is null and SPRIDEN_ENTITY_IND = 'P' and spriden_pidm = ? and spriden_pidm = spbpers_pidm and spriden_pidm = gwbntid_pidm and spraddr.rowid = rowidtochar(swf_addr_row(spriden_pidm, 'AP,AL', sysdate)) ...... }}, rnt={uid=MartyM, pwd=password, appid=MLM Tester, buff_size=3}, dataSource=....... ================================ If I do a find in the project for "and spriden_pidm = gwbntid_pidm" and it finds grails-app/conf/Config.groovy and target/classes/Config$_run_closure3_closure7.class. and the do have the (+) in the text. I recognize the data that is showing in the run-app. But that was another project (and an old version of the config in that project as well. |
|
On 19/04/2012 14:41, Marty McLaughlin wrote:
> I recognize the data that is showing in the run-app. But that was > another project (and an old version of the config in that project as well. At this point my usual recourse is to completely delete ~/.grails and the target directory under each grails application, and rebuild everything from scratch... Ian -- Ian Roberts | Department of Computer Science [hidden email] | University of Sheffield, UK --------------------------------------------------------------------- To unsubscribe from this list, please visit: http://xircles.codehaus.org/manage_email |
|
I deleted all the subdirectories under ~/.grails
made sure clean removed everything from the target directory rebuilt Same behavior... no change. This is really frustrating. |
|
Are you injecting any properties as Config object by ConfigSlurper at boot strapping or any other ways?
|
|
> Are you injecting any properties as Config object by ConfigSlurper at boot strapping or any other ways? I am not using the ConfigSlurper in any code. I do have a bean being initialized in the grails-app/conf/spring/resources.groovy that refers to application.config (but commenting tat out doesn't change the behavior. import edu.uvm.rightnow.Rnt beans = { rnt(Rnt){ uid = application.config.rnt?.uid pwd = application.config.rnt?.pwd appid = application.config.rnt?.appid buff_size = application.config.rnt?.buff_size RntSession = 'init' } } |
|
This post has NOT been accepted by the mailing list yet.
In reply to this post by Marty McLaughlin
I'm seeing something similar, with an extra twist.
I have a basic Grails-2.0.3 project and have not modified the generated Config.groovy. The database is Oracle 11g. I modified DataSource.groovy to change the driverClassName, username, password, and url (I'm using ojdbc6.jar). I addeddialect = org.hibernate.dialect.Oracle10gDialect Development dataSource = 'create-drop' (no change) and the configuration is Development. The project is in SVN and I have checked it out cleanly to two different machines. One is Windows 7. The other is Ubuntu 10.10 When I run-app or run-war on the Ubuntu system everything works as I would expect When I run-app or run-war on the Windows 7 system the tables in the database are not dropped. When I copy the .war to a Tomcat 6028 instance on a Windows Server2003 box, everything works as I would expect and the tables get dropped when I shut down the web application from the Tomcat Manager |
|
I'm going against Oracle 11g using ojdbc6 as well.
I just moved a copy of my project onto another OSX machine and replicated the issue there. On 4/19/12 3:09 PM, Don A [via Grails] wrote: I'm seeing something similar, with an extra twist. |
| Powered by Nabble | Edit this page |
