grails

How to start Grails as a web app when runnning integration tests

I'm trying to test my grails app using integration test that makes http requests. Actually it's a selenium/tellurium test, but it doesn't matter. But as i see when i running grails tests it doesn't starts web container, the same time i see many examples in blog articles that people tests grails app using selenium and other test tools tha...

Error received when installing Grails birt-report plugin

Hi all, I want to use BIRT Report on Grails, but when I install the birt-report plugin, it is not complete and returns an error. Can you help me with BIRT Reports and showing the BIRT Report Viewer on a GSP Page? This error : Installing BIRT v2.5.0 OSGI Platform libraries into C:/Users/Dev/.grails/1.3.4/projects/TestBirt/plugins/birt-r...

Grails + WS Client throw an CXF exception

I'm new in grails, and trying to build a backend for my webservice, the apps only access the webservice provided not access to databases directly. package backend import org.grails.plugins.wsclient.service.WebService class BackendController { WebService webService def index = { def wsdlUrl = "http://localhost8080/Ba...

Grails with GSP or JSF.

I am thinking of learning java web applications preferably grails but I like jsf as well especially primefaces. However currently I've not being able to successfully use grails with jsf 2+, if I can do that, that's all I need. Thus I would the experts out there those who know both technologies I mean and not a flame war, point out to me ...

groovy static blocks for relationship definition

I have a couple of domain classes defined, Employee and EmployeeDesiredSkill, Employee has static hasMany = [employeeSkill:EmployeeDesiredSkill] and EmployeeDesiredSkill has static belongsTo = [employee:Employee] Yet groovyc is giving me a bunch of errors like the following: [groovyc] Compiling 15 source files to C:\dev\JavaTes...

How do I stream large datasets in grails?

Application requires a large download ( a recordset sourced from SQL server with ~200K rows or ~5MB) from a grails application. In c# I would use a dataReader but gorm with a hasMany defaults to sets and list that must be populated before using them. What is the grails way to handle larger datasets that should be streamed? ...

Using groupProperty and countDistinct in Grails Criteria

I'm using Grails 1.2.4. I would like to know on how can I sort by "countDistinct" (descending) and with groupProperty inside a projections. Here are my domains: class Transaction { static belongsTo = [ customer : Customer, product : Product ] Date transactionDate = new Date() static constraints = { transactionDat...

groovy / grails / unit testing / createCriteria.get

I can mock calls to: MyDomainClass.createCriteria().list{ eq('id',id) eq('anotherParameter',anotherParameterId) } with: def myCriteria = [ list : {Closure cls -> returnThisObject} ] MyDomainClass.metaClass.static.createCriteria = { myCriteria } as advised at: http://davistechyinfo.blogspot.com/2010/01/mocking-hibernat...

grails - how to force download file with its extension

Hi, I have the following code def fileDoc = new File(document.documentLocation); if(fileDoc.exists()){ // force download def fileName = fileDoc.getName(); response.setContentType("application/octet-stream") response.setHeader "Content-disposition", "attachment; filename=${fileName}" ; re...

Grails test-app: How can I disable junitreport?

Hello, I am trying to run some unit tests for my grails app, via "grails test-app -unit". This works as expected. However, when the tests are done, junitreport takes way too long to generate the HTML results, eg: [junitreport] Transform time: 33294ms 33 seconds (on top of the rest of the time) is ridiculous when I want to rapidly mak...

Grails domain class query - how can I find by fields that link to another domain class?

Hello, Lets say I have two domain classes: class User { String name Role role } class Role { String name static belongsTo = [user: User] } and I create some records: def r1 = new Role(name: "role1").save() def r2 = new Role(name: "role2").save() new User(name: "user1", role: r1).save() new User(name: "user2", role: r2).save...

IncompleteAnnotationException when accessing an annotation in groovy

I defined an annotation as follows import java.lang.annotation.ElementType import java.lang.annotation.Inherited import java.lang.annotation.Retention import java.lang.annotation.RetentionPolicy import java.lang.annotation.Target /** * Annotation for any object that exposed a remote interface */ @Target({ElementType.TYPE}) @Retention(...

grails domain class validator + set unique constraint according to field values ?

Hi, Is there a way to write a custom validator that will perform different validations according to field values? For example class myModel{ A a; B b; String prop static belongsTo:[m:myModel] constraints{ prop(validator:{ val,obj-> if (obj.a== null){ unique:[b,prop] ...

deploying my grails WAR into EATJ free host trail don't work

i've deployed my grails WAR into EATJ.com free host trail but when i enter the url he give me which is http://emadhegab.s23.eatj.com/ it gives me 404 error i've deployed the war as ROOT.war and it's fully grails app. is there a problem with eajt or something?? or it's just me i'm still newbie at this ...

Need help improving the performance of large datasets in grails.

This solution works but performance is lower than expected. A query returning 200K rows takes several minutes and pegs the CPU on my dev box. Running the same* query in query analyzer returns all results in < 1 minute. Class MyController { def index = {...} ... def csv = { ... def rs = DomainClass.createCritera().scroll {} ...

XML unmarshalling with Castor and Grails

I have a grails project that contains a few domain objects. I am using a java project in this code which can parse a document for me. The controller that calls that Java project is using JAXB to generate XML from the object returned by the Java project. I want to use this XML document (which is generated after some text parsing, using J...

Grails: WAR file question

Hi, I am using Grails 1.3.4. Using grails WAR command, I build the war and deploy it to Tomcat 6.0.20. When tomcat is started, the war gets exploded and application works fine as required. The questions, if I make any changes to say for example a .js file in the exploded war package , the change never gets reflected in the front end e...

Get the ServletContext in Config.groovy (or how to get the real path of the current context)

The question is in the title - how to obtain the ServletContext in Config.groovy. The purpose is to get the real (absolute) path of the current context. ...

Configuring Grails Plugins with Nexus Repository

Hi, I'm searching for a longer time, but without any solution. My problem: I configured my Grails project (1.2.4) with Maven and my own Nexus Repo. That seems to be working well. But can I also put the Grails plugins, which I am using, also to the Nexus Repo? At the momement the plugin dependencies are resolved over the Grails Plugin...

Is it possible to run a grails single grails unit test class from NetBeans?

I've been unable to find a way to run a single grails test class (which extend GrailsUnitTestClass) from the command line. (I currently have a question out with a decent bounty, if you are interested.) I'd be even happier if I could do the same from within NetBeans, but I haven't been able to do that either. Any ideas? ...