FAQ Database Discussion Community


How to get Authenticated with spring security rest plugin in Grails

rest,grails,spring-security,grails-plugin,grails-2.4
I'm using Grails version 2.4.3 . I am creating an application that supports RESTful APIs. Since access to these APIs should be authenticated , I tried out the Spring Security REST plugin. I checked out this example and what I could understand is , the /api/login controller is the authentication...

Redirect Loop with Requestmap with grails spring security core 2.0RC4

grails,grails-plugin
I have been facing Failed to load resource: net::ERR_TOO_MANY_REDIRECTS with grails 2.4.4. I have User, Role and Requestmap in com.usermanagement.auth package(those were generated with s2-quickstart). Requestmaps, users and roles seem to be stored in the database(I am using mysql). BuildConfig.groovy compile ":spring-security-core:2.0-RC4" Bootstrap.groovy on init method User admin = new...

Error Failed to resolve dependencies grails

grails,grails-plugin
I get Error Failed to resolve dependencies error when I try to run, clean, or compile. My BuildConfig.groovy file is as follows: grails.servlet.version = "2.5" // Change depending on target container compliance (2.5 or 3.0) grails.project.class.dir = "target/classes" grails.project.test.class.dir = "target/test-classes" grails.project.test.reports.dir = "target/test-reports" grails.project.target.level = 1.6 grails.project.source.level = 1.6...

Grails 3: what is replacement for eventCreateWarStart in _Events.groovy

grails,grails-plugin
I am migrating a plugin from Grails 2.4 to Grails 3. I am facing to the following issue. I tried to use eventCreateWarStart in _Events.groovy. Like we used to compile widgetset in our plugin's _Events.groovy file. But it seems this approach is not allowed in Grails 3. I went through...

Grails mocking method in service which uses rest plugin

unit-testing,grails,grails-plugin
I'm very new to Grails but have been using Ruby on Rails for the past few months, I can't seem to get my head around how to correctly Mock some functionality within a Service I have so I can properly Unit Test it. I have a RestService which uses a...

Creating a Google Login using Grails

grails,spring-security,grails-plugin,google-login,spring-security-oauth2
I'm trying to create a Google Login option in a Grails project. I'm new to Grails and am using version 2.4.4 as this was the latest at the time of installing. After much searching of the Grails Plugins I've added the last 4 lines to my BuildConfig.groovy file: plugins {...

Grails-Camel Plugin won't install or run

grails,apache-camel,grails-plugin
Please note: Although this question involves a lib called Apache Camel I really think this is just a question about how modern Grails plugins work. I am on Grails 2.4.2 here, and I am trying to use Apache Camel with Grails and found the Grails Routing plugin annd cannot even...

Prevent Grails Asset-Pipeline from changing File Name?

grails,asset-pipeline,grails-plugin
I use Grails 2.4.4 and the asset-pipeline plugin. One of my assets is a PDF file. I want that the name someName.pdf while remain when a user downloads this file. In my GSP I use it as: <a href="${assetPath(src: 'someName.pdf', absolute:true)}" target="_blank">Download PDF</a> When I run in production the downloaded...

Accessing images from grails in-line plugin when deployed in a tomcat server

grails,grails-plugin
I have two grails applications and created an inline plugin named cmcore. I placed some images in cmcore/web-app/images so that both of my applications have access on the said images. Images are successfully accessed by both applications in development environment but whenever I build WAR files of my applications in...

How to declare javascript asset in the view to be rendered within the footer using Grails Asset Pipeline

grails,grails-plugin
Since there is no deferred option for: <asset:javascript src="custom_view_script.js"/> What else can be used, outside of resource plugin, to place view specific script right before the closing body tag and without declaring it globally in layout? I do know about: <asset:deferredScripts/> but that only handles on page script and not...

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...

Grails Render PDF Plugin returns NullPointerException

java,grails,pdf,grails-plugin,flying-saucer
I'm trying to render a pdf file with render plugin. My controller code is: def toPDF(){ DomainClass domainClass = DomainClass.get(params.id) try{ renderPdf(template: "/domainClass/pdf", model: [domain: domainClass], filename: System.currentTimeMillis().toString() + "_" + domainClass.id.toString() + ".pdf") }catch(e){ redirect action: "error" } } In development mode, it works properly. But in production, this...

Using grails datasources in quartz plugin

grails,quartz-scheduler,grails-plugin
I want to create quartz jobs that use a JdbcStore as described in the clustering section of the docs, in Burt's example. The example shows how to configure quartz using a quartz.properties file. Now, I'd like my jdbc store to be the same database as my grails application, so that...

Grails 2.3.9 - Error: ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType

grails,grails-plugin,spock,grails-2.3
Whenever I enter the grails command: test-app I get this error: Error executing script TestApp: java.lang.ClassNotFoundException: grails.plugin.spock.test.GrailsSpecTestType (Use --stacktrace to see the full trace) In my BuildConfig.groovy I have: grails.project.dependency.resolution = { ... plugins { ... test ":spock:0.7" } } I've tried replacing it with compile ":spock:0.7" . I've also...

Grails 2.2.1 app cannot resolve dependencies

maven,grails,grails-plugin
I am running into problems setting up an existing grails (2.2.1) project on a new mbp. I get dependency resolution errors whenever I try to run any grails command. It seems that it cannot resolve any grails plugins that are marked with the compile phase like below. compile ":cache:1.0.0" I've...

Grails Url shortener plugin not getting installed

grails,grails-plugin,grails-2.0,url-shortener
I am trying to add a new plugin mentioned here in my app but it is not been resolved and giving me a error i.e. :: problems summary :: :::: WARNINGS module not found: org.grails.plugins#url-shortener;0.2.1 ==== grailsPlugins: tried -- artifact org.grails.plugins#url-shortener;0.2.1!url-shortener.zip: ... ==== grailsHome: tried /opt/grails/lib/org.grails.plugins/url-shortener/ivy-0.2.1.xml -- artifact org.grails.plugins#url-shortener;0.2.1!url-shortener.zip: /opt/grails/lib/org.grails.plugins/url-shortener/jars/url-shortener-0.2.1.zip...

Class Not Found errors when upgrading grails to 2.5.0 for Grails database migrations files

grails,database-migration,grails-plugin
I am trying to upgrade Grails app from 2.4.3 to 2.5.0 version. Grails 2.5.0 contains fixes and improvements but doesn't have any breaking changes. Also, installed all 2.5.0 compatible plugin versions. Also gone through Grails Database Migration Plugin changelog and other plugin to support grails 2.5.0. Come across same JIRA...

Grails filter disables style/css

css,grails,grails-plugin
I made a security filter, following the book "Beginning Grails, Groovy and Griffon". Looks like the functionality works ok, but, for some reason, the only page that the filter allows to open without a logged in user, is lacking any style. Just textfields, labels and buttons. Also the simple capthca...

Getting Application Configuration in doWithSpring Colsure of Plugin Descriptor

grails,oauth,spring-security,grails-plugin
I am extending the Spring oauth Plugin and want to declare beans for some Classes I extended like the OAuthConfig class, I want to declare the extended class as a bean in the doWithSpring closure of the plugin Descriptor public class MyOAuthConfig extends org.scribe.model.OAuthConfig { public MyOAuthConfig(String key, String secret)...

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...

grails behind a proxy / redirected to https

grails,grails-plugin
I got an grails application created behind a proxy a few month ago (all worked fine i.e. the initial load of all dependencys via the proxy). Now I want to add some new plugins to it, and some other people should also bring the app up and running on their...

Decompression of GZIP:ed response (Grails / Groovy)

rest,groovy,gzip,grails-plugin,grails-2.0
I'm consuming a REST api using the RestBuilder plugin. I get a response where the body is compressed: Content-Encoding=[gzip] Does groovy/Grails provide any easy access / native methods for decoding gzip compression? The only thing I found is the native Java zip api (ex. GZIPInputStream). Does someone have a better...

Authentication using Grails Spring Security REST Plugin

grails,grails-plugin,spring-security-rest
I came across the Greach 2014 presentation of Alvaro. I downloaded the example from GitHub and started it. When I try to authenticate with curl -i -H "Content-Type: application/json" -X POST -d '{"username":"jimi","password":"jimispassword"}' http://localhost:8080/restful-grails-springsecurity-greach2014/api/login I am getting this on the curl side. HTTP/1.1 400 Bad Request Server: Apache-Coyote/1.1 Content-Length: 0...