Compile error in Grails ehcache plugin - grails

Have just added to BuildConfig.groovy:
compile ":cache-ehcache:1.0.1"
I'm using Eclipse/Spring Tool Suite v 3.5.0.RELEASE
JAVA_HOME set to: E:\Program Files\Java\jdk1.7.0_17
I get the following compilation errors when I run grails runApp.
Compilation error: startup failed:
Compile error during compilation with javac.
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:195: error: ReloadableCacheManager.ProxyEhcache is not abstract and does not override abstract method getSearchesPerSecond() in Ehcache
protected class ProxyEhcache implements Ehcache {
^
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:798: error: getStatistics() in ReloadableCacheManager.ProxyEhcache cannot implement getStatistics() in Ehcache
public StatisticsGateway getStatistics()
^
return type StatisticsGateway is not compatible with Statistics
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:656: error: cannot find symbol
return getUnderlyingEhcache(name).getSearchAttributes();
^
symbol: method getSearchAttributes()
location: interface Ehcache
C:\Documents and Settings\pagendg\.grails\2.3.8\projects\osrpms\plugins\cache-ehcache-1.0.1\src\java\grails\plugin\cache\ehcache\GrailsEhCacheManagerFactoryBean.java:653: error: method does not override or implement a method from a supertype
#Override
^

try to delete the project’s folder under the .grails directory, e.g. ‘~/.grails/2.3.8/projects/osrpms’.
and the commands
grails clean-all
grails clean
then run the project

Related

Error after add simple_permission or permission_handler on flutter

I want to create a folder to try downloading files. so I added simple_permission but I got an error migrating to androidX even though I migrated to androidX. how can I resolve this error?
Launching lib\main.dart on Coolpad E502 in debug mode...
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:9: error: cannot find symbol
import android.support.v4.app.ActivityCompat;
^
symbol: class ActivityCompat
location: package android.support.v4.app
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:10: error: package android.support.v4.content does not exist
import android.support.v4.content.ContextCompat;
^
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:156: error: cannot find symbol
ActivityCompat.requestPermissions(activity, perm, 0);
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:163: error: cannot find symbol
return PackageManager.PERMISSION_GRANTED == ContextCompat.checkSelfPermission(activity, permission);
^
symbol: variable ContextCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:171: error: cannot find symbol
if (ActivityCompat.shouldShowRequestPermissionRationale(registrar.activity(), permission)) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
D:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\simple_permissions-0.1.9\android\src\main\java\com\ethras\simplepermissions\SimplePermissionsPlugin.java:175: error: cannot find symbol
if (ActivityCompat.checkSelfPermission(registrar.context(), permission) == PackageManager.PERMISSION_GRANTED) {
^
symbol: variable ActivityCompat
location: class SimplePermissionsPlugin
6 errors
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':simple_permissions:compileDebugJavaWithJavac'.
Compilation failed; see the compiler error output for details.
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 45s
The Gradle failure may have been because of AndroidX incompatibilities in this Flutter app.\
Exited (sigterm)
I had the same error and what I did was change the version of klotin in the build.gradle file I have it as follows
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}
}

Getting unable to resolve class org.apache.commons.configuration.PropertiesConfiguration

Iam new to groovy on grails.
In my grails application i have to edit a property file without deleting other key values for that Iam using apache commons following code
PropertiesConfiguration conf = new PropertiesConfiguration("config.properties");
props.setProperty("key", "value");
conf.save();
In BuildConfig.groovy I have included the depentencies
dependencies {
compile 'org.apache.commons:commons-configuration2:2.2'
compile 'org.apache.commons:commons-lang3:3.1'
}
While executing grails compile the dependencies seems to be downloaded without any error, but that Iam getting the compilation error
unable to resolve class org.apache.commons.configuration.PropertiesConfiguration
[groovyc] # line 5, column 1.
[groovyc] import org.apache.commons.configuration.PropertiesConfiguration;
[groovyc] ^
[groovyc]
What additional settings that i need to do in grails please suggest
Use
import org.apache.commons.configuration2.PropertiesConfiguration;
Note the 2 at the end of configuration!

Does bazel support public.xml when build an android project

I'm migrating from gradle, and I'm using public.xml on my android project, it works fine with gradle, but when I build it with bazel, it failed with the following error:
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6772: error: Public symbol drawable/skin_at declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6774: error: Public symbol drawable/skin_at_click declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6776: error: Public symbol drawable/skin_face declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6778: error: Public symbol drawable/skin_face_click declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6780: error: Public symbol drawable/skin_keyboard declared here is not defined.
Error: /var/folders/th/cxy34j2x0vq9zzdh8qstx5jr0000gn/T/android_resources_tmp2185237642135735709/merged_resources/values/values.xml:6782: error: Public symbol drawable/skin_keyboard_click declared here is not defined.
What should I do here to solve this problem?
Thanks very much for any help!
Bazel 0.4.5 (the current version at time of writing) does not support private resources and public.xml files. This is because this functionality is implemented by Gradle, not the underlying tools (aapt). There is an open feature request for Bazel to reimplement this feature of Gradle here: https://github.com/bazelbuild/bazel/issues/2124.

Compile error with grails 2.4.1 and plugin joda-time 1.5

When compiling a grails 2.4.1 project I get the following error:
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] /home/omarques/ws1/sigob/target/work/plugins/joda-time-1.5/src/groovy/grails/plugin/jodatime/simpledatastore/SimpleMapJodaTimeMarshaller.groovy: 44: Apparent variable 'MonthDay' was found in a static scope but doesn't refer to a local variable, static field or class. Possible causes:
[groovyc] You attempted to reference a variable in the binding or an instance variable from a static context.
[groovyc] You misspelled a classname or statically imported field. Please check the spelling.
[groovyc] You attempted to use a method 'MonthDay' but left out brackets in a place not allowed by the grammar.
[groovyc] # line 44, column 87.
[groovyc] me, LocalDate, LocalDateTime, MonthDay,
[groovyc] ^
I've tried to upgrade the project to 2.4.3 and got the same error
Add the following to application.properties and try
plugins.joda-time=1.3.1
the problem was solved by including on BuildConfig an explicit dependency to joda-time-2.3 because another dependency(net.objectlab.kit:datecalc-joda:1.2.0) was causing the use of an outdated version of joda-time that is incompatible with the joda-time grails plugin

STS - Can't Find Grails Library

I am porting over Grails project to STS and I don't know much about the project nor about STS, so I am a little lost. Also of note is that the project was previously in Grails 1.0.3 and I am upgrading it to 1.3.7.
After loading in the existing code, I configured my project to use Grails 1.3.7. When I attempt to build the project I get a bunch of errors relating to what appears to be just basic grails code that should come with 1.3.7:
e.g. Groovy:unable to resolve class org.codehaus.groovy.grails.commons.ConfigurationHolder
Also, when I open STS I am asked to run an "upgrade" for grails, which fails with the following:
Command terminated with an error code (see details for output)
------System.out:-----------
Welcome to Grails 1.3.7 - http://grails.org/
Licensed under Apache Standard License 2.0
Grails home is set to: /home/devon/springsource/grails-1.3.7/
Base Directory: /home/devon/Documents/Source/trunk
Resolving dependencies...
Dependencies resolved in 2458ms.
Running script /home/devon/springsource/grails-1.3.7/scripts/Compile.groovy
Environment set to development
Setting non-interactive mode
[groovyc] Compiling 110 source files to /home/devon/.grails/1.3.7/projects/trunk/classes
[groovyc] org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
[groovyc] Compile error during compilation with javac.
[groovyc] /tmp/groovy-generated-1742177078522700179-java-source/com/pps/domain/User.java:62: package org.grails.plugins.springsecurity.service does not exist
[groovyc] public org.grails.plugins.springsecurity.service.AuthenticateService getAuthenticateService() { return (org.grails.plugins.springsecurity.service.AuthenticateService)null;}
[groovyc] ^
[groovyc] /tmp/groovy-generated-1742177078522700179-java-source/com/pps/domain/User.java:63: package org.grails.plugins.springsecurity.service does not exist
[groovyc] public void setAuthenticateService(org.grails.plugins.springsecurity.service.AuthenticateService value) { }
[groovyc] ^
[groovyc] /home/devon/Documents/Source/trunk/src/java/com/pps/util/MarketplaceWidgetUtils.java:24: warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release
[groovyc] import sun.misc.BASE64Encoder;
[groovyc] ^
[groovyc] /tmp/groovy-generated-1742177078522700179-java-source/com/pps/domain/User.java:62: package org.grails.plugins.springsecurity.service does not exist
[groovyc] public org.grails.plugins.springsecurity.service.AuthenticateService getAuthenticateService() { return (org.grails.plugins.springsecurity.service.AuthenticateService)null;}
[groovyc] ^
[groovyc] /home/devon/Documents/Source/trunk/src/java/com/pps/util/MarketplaceWidgetUtils.java:170: warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release
[groovyc] BASE64Encoder encoder = new BASE64Encoder();
[groovyc] ^
[groovyc] /home/devon/Documents/Source/trunk/src/java/com/pps/util/MarketplaceWidgetUtils.java:170: warning: sun.misc.BASE64Encoder is Sun proprietary API and may be removed in a future release
[groovyc] BASE64Encoder encoder = new BASE64Encoder();
[groovyc] ^
[groovyc] 3 errors
[groovyc] 3 warnings
[groovyc]
[groovyc]
[groovyc] 1 error
Compilation error: Compilation Failed
------System.err:-----------
In my Java Build Path I have a 'Grails Dependencies' folder, but I don't know how to change it to make sure it is pointing to the right dependencies. There is also 'Groovy Libraries' and a bunch of random '.jar' dependencies.
What am I doing wrong?
It looks like it wasn't finding it because required dependencies to plugins were not resolving correctly. Once I got the plugins it worked correctly.

Resources