FAQ Database Discussion Community


Unable to run Application.groovy from IntelliJ IDEA

intellij-idea,grails-3.0
I have a new grails 3 project that I created using the grails create-app command. When I try to run Application.main() from IntelliJ IDEA I get the following error Exception in thread "main" java.lang.ExceptionInInitializerError at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:264) at com.intellij.rt.execution.application.AppMain.main(AppMain.java:122) Caused by: java.lang.NullPointerException at grails.dev.Support.enableAgentIfNotPresent(Support.groovy:54) at...

Grails 3.0.0M1 - running war standalone - no main class in MANIFEST.MF

grails,grails-3.0
Grails 3: Trying the example from the docs to run the war file standalone: $ java -Xmx768M -XX:MaxPermSize=256m -jar test-0.1.war Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=256m; support was removed in 8.0 no main manifest attribute, in test-0.1.war So which is the main class I must start? Thanks...

3.0.0.M1 how to run on https connection

grails,grails-3.0
Trying Grails 3.0.0.M1, a lot has changed! How would I run-app --https and how would I configure it that way also for the production-environment-war? Many thanks!...

Recommended approach to multi-threading in Grails 3

grails,grails-3.0
In Grails 2 I used the Executor plugin to perform multi-threading operations in services and it worked very well. Like most Grails plugins it hasn't been ported over to Grails 3 yet. The GPars library is/was another option for multi-threading, but with Codehaus shutdown I am reluctant to use it....

How does one add mongodb and/or postgresql-extension plugins to Grails 3.0.0+?

grails,gradle,gorm,grails-3.0
I played with Grails 3.0.0.M1 today and tried to make a small application using mongodb, however I couldn't manage to add it correctly to my build.gradle file. What is the correct syntax? I tried (excerpt): repositories { mavenLocal() maven { url "http://repo.grails.org/grails/core" } } dependencyManagement { imports { mavenBom "org.grails:grails-bom:$grailsVersion"...

Storing Spring Boot users in a database with Grails 3.0

mongodb,grails,spring-security,spring-boot,grails-3.0
How do you store users in a database with a new plain vanilla Grails 3.0 application? Background: The Shiro and Spring Security plugins are not yet available for Grails 3.0 (and it sounds like Spring Boot is the future for Grails security). There are various examples out there showing how...

Grails 3.0.0.M1 - create-plugin - Could not find method bintray

grails,grails-plugin,grails-3.0
In the frustration, that I am not able to add a filter and mapping to the gone web.xml I wanted to create a plugin, only to be able to use doWithWebDescriptor() (My first plugin for my first application) I am not good enough to discern, if the following is worth...

Configuring Spring Boot Security to use BCrypt password encoding in Grails 3.0

grails,spring-security,spring-boot,bcrypt,grails-3.0
In Grails 3.0, how do you specify that Spring Boot Security should use BCrypt for password encoding? The following lines should provide a sense of what I think needs to be done (but I'm mostly just guessing): import org.springframework.security.crypto.password.PasswordEncoder import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder PasswordEncoder passwordEncoder passwordEncoder(BCryptPasswordEncoder) My application loads spring-boot-starter-security as a...

Grails Controller and URL Mapping Magic

grails,grails-controller,url-mapping,grails-3.0
Grails 3.0.1 here. I'm looking to accomplish a specific URL/controller structure. My app deploys at the root context (/), meaning locally it runs as http://localhost:8080, and non-locally as http://someserver.example.org. I want everything under /app/* to be authenticated and considered to be part of the "core app" (requires login). Anything outside...

Sorting on nullable fields in GORM

grails,gorm,grails-3.0
I'm trying to figure out how to sort on multiple fields in Grails 3, one of which may or may not be null. I have this Book domain: class Book { String title String sortTitle static constraints = { title blank: false sortTitle nullable: true } } Books with titles...

Grails 3.0 adding an inlace plugin

grails-plugin,grails-3.0
I created simple grails 3.0 applications using commands below: create-app admin --profile=web create-plugin core --profile=plugin Now, I wanted to use core as inlace plugin in admin build which is a web application. We can easily do that in grails version < 3.0 in buildconfig. Where can I do that in...

convert configuration file application.yml to application.groovy in Grails 3.x

grails,grails-3.0
I am trying to create a simple Grails 3 project and got stuck with something really simple. So I want my data source properties to come from VM options that I set in my IntelliJ IDE. Before in Grails 2.x, I just used to do something like: environments { development{...

how can I disable reloading in a grails 3.0.0 app?

grails,spring-loaded,grails-3.0
It appears that the spring reloading causes errors with JDK 8u40 in Grails 3.0.0.M2. Can I disable the reloading in development mode? Is there a key to set in the build.gradle or in the application.yml?

Where to place resources in Grails 3 project?

grails,grails-3.0
This answer addresses this problem for a Grails 2 project, but does not work for a Grails 3 project. For instance, in a Grails 2 project I was able to put an xsl file in /src/groovy/myapp/resources/ and load it similar to what the linked answer suggested... this.class.getClassLoader().getResourceAsStream("myapp/resources/my_xsl.xsl") // Returns an...