grails

Grails - Class “org.grails.tomcat.TomcatLoader” was not found in the CLASSPATH

放肆的年华 提交于 2020-01-04 05:33:10
问题 grails run-app from within Eclipse is currently giving me the exception below for my Google App Engine/Grails test application: Enhancing JDO classes [enhance] DataNucleus Enhancer (version 1.1.4) : Enhancement of classes [enhance] Jan 24, 2010 5:11:42 AM org.datanucleus.metadata.MetaDataManager loadClasses [enhance] SEVERE: Class "org.grails.tomcat.TomcatLoader" was not found in the CLASSPATH. Please check your specification and your CLASSPATH. [enhance] org.datanucleus.exceptions

Is it possible to use proguard with Grails

有些话、适合烂在心里 提交于 2020-01-04 05:20:14
问题 Even if it is not possible to use proguard for an entire grails app would it be possible to just use it for the src/java folder? 回答1: I don't know either Proguard or Grails in depth, but I do know that: Grails uses Groovy Groovy compiles down to bytecode Proguard operates on bytecode (not source code) Thus my intuition is yes, ProGuard can shrink/obfuscate grails apps. Your question asks about using ProGuard on the src/java folder. It's important to understand that ProGuard operates on .class

grails spring security core - adding security to the hidden scaffolded actions

血红的双手。 提交于 2020-01-04 05:11:06
问题 One can use things annotations like: @Secured(['ROLE_ADMIN']) on an actions or on an entire class (seems to work fine), to apply the security control provided by spring security core. Is there a way to apply security to the hidden scaffolded actions, without applying the security constraint to the whole class? I want to use one security constraint for some actions, and a different one for the hidden scaffolded actions. NOTE: if this isn't immediately do-able/answerable, please disregard, as I

Error PayPal plugin on grails 2.0.0.RC3

江枫思渺然 提交于 2020-01-04 05:08:24
问题 I use grails 2.0.0.rc3, when I install PayPal plugin I have this error: Error Compilation error: startup failed: /Users/sartre/.grails/2.0.0.M1/projects/testapp/plugins/paypal-0.6.4/grails-app/controllers/org/grails/paypal/PaypalController.groovy: -1: The return type of java.lang.Object notify() in org.grails.paypal.PaypalController is incompatible with void notify() in java.lang.Object . At [-1:-1] @ line -1, column -1. 1 error How can I fix it? Many thanks for any idea 回答1: Incompatibility

Error PayPal plugin on grails 2.0.0.RC3

≯℡__Kan透↙ 提交于 2020-01-04 05:08:08
问题 I use grails 2.0.0.rc3, when I install PayPal plugin I have this error: Error Compilation error: startup failed: /Users/sartre/.grails/2.0.0.M1/projects/testapp/plugins/paypal-0.6.4/grails-app/controllers/org/grails/paypal/PaypalController.groovy: -1: The return type of java.lang.Object notify() in org.grails.paypal.PaypalController is incompatible with void notify() in java.lang.Object . At [-1:-1] @ line -1, column -1. 1 error How can I fix it? Many thanks for any idea 回答1: Incompatibility

Grails 3 mail plugin not working

回眸只為那壹抹淺笑 提交于 2020-01-04 05:05:12
问题 Using Grails 3 it's impossible to get an instance of mailService object, DI is not working: build.gradle compile "org.grails.plugins:mail:1.0.7" testCompile "org.grails.plugins:mail:1.0.7" application.groovy environments { development { //grails.logging.jul.usebridge = true grails.plugin.springsecurity.debug.useFilter = true grails { mail { host = "main.mydomain.com" port = 25 username = "login" password = "password" props = ["mail.smtp.auth":"true"] } } grails.mail.default.from="noreply

understanding withNewSession in Grails

风流意气都作罢 提交于 2020-01-04 04:46:10
问题 First of all the documentation of grails explains withNewSession as follows: https://grails.github.io/grails-doc/latest/ref/Domain%20Classes/withNewSession.html Defn: Provides a way to execute code within the context of a new Hibernate session which shares the same transactional (JDBC Connection) resource as the currently bound session. I am an intermediate grails user so i am not comfortable with the above definition although i understand how grails make use of sessions. Can you provide an

How to add custom “-Djava” arguments to Grails app?

一笑奈何 提交于 2020-01-04 04:40:10
问题 Say I wanted to run a Grails (2.3+) app with an extra " -Djava.fizz.buzz=3 " JVM arg. Is it as simple as: grails run-app -Djava.fizz.buzz=3 Or is there special config (say, in BuildConfig.groovy ) that would need to take place? 回答1: The answer to your question is yes, that will work. JVM args work a bit differently. Both are in the docs about the command line. 回答2: That should work. And to have access to the arg you just created, you may call System.properties[] anywhere in your code: if

Grails datasource becoming null in Service

眉间皱痕 提交于 2020-01-04 04:39:22
问题 I am using Grails 2.2.1, and I have a custom dataSource injected into the service so that I can execute some SQL queries. Upon first execution, there is a dataSource, but on each subsequent call, the reference to the dataSource has become null. class ReportService { def dataSource_myds Object[] reportRecords(int a) { String query = "SELECT ..." Object[] resultSet; Sql sql = new Sql(dataSource_myds) // ^ Here the NullPointerException is thrown // But it always works at the first execution sql

How to load datasource configuration from external file in grails 3.1.8?

一世执手 提交于 2020-01-04 04:34:15
问题 I am writing a grails 3.1.8 application. My datasource written in application.groovy file. I want to load datasource configuration like username,password,DB from an external file. Is there any way to do it in grails 3+ versions. Here is my datasource configuration in application.groovy:- hibernate { cache { queries = false use_second_level_cache = true use_query_cache = false region.factory_class = 'org.hibernate.cache.ehcache.EhCacheRegionFactory' } } dataSource { pooled = true jmxExport =