Class duplication error while compiling project - Grails 2.3.11 - grails

I am updating a project from an old grails version, to 2.3.11, I am still in the step by step of solving each dependencies, and now I caught the following error down:
| Error Compilation error: startup failed:
Compile error during compilation with javac.
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\CurrentTenant.java:6: error: duplicate
class: grails.plugin.multitenant.core.CurrentTenant
public interface CurrentTenant {
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\CurrentTenantThreadLocal.java:3: error
: package com.infusion.util.event does not exist
import com.infusion.util.event.EventBroker;
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\CurrentTenantThreadLocal.java:20: erro
r: cannot find symbol
private EventBroker eventBroker;
^
symbol: class EventBroker
location: class CurrentTenantThreadLocal
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\CurrentTenantThreadLocal.java:62: erro
r: cannot find symbol
public void setEventBroker(EventBroker eventBroker)
^
symbol: class EventBroker
location: class CurrentTenantThreadLocal
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantDataSourcePostProcess
or.java:12: error: package org.apache.commons.dbcp does not exist
import org.apache.commons.dbcp.BasicDataSource;
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:4: error: package org.apache.commons.dbcp does not exist
import org.apache.commons.dbcp.BasicDataSource;
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:13: error: cannot find symbol
public class TenantPooledDataSource extends BasicDataSource implements TenantDat
aSource {
^
symbol: class BasicDataSource
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\CurrentTenantThreadLocal.java:12: erro
r: CurrentTenantThreadLocal is not abstract and does not override abstract metho
d isSet() in CurrentTenant
public class CurrentTenantThreadLocal implements CurrentTenant
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantDataSourcePostProcess
or.java:30: error: cannot find symbol
} else if (BasicDataSource.class.getName().equals(beanDefinition.getBean
ClassName())) {
^
symbol: class BasicDataSource
location: class TenantDataSourcePostProcessor
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:13: error: TenantPooledDataSource is not abstract and does not override abstrac
t method getUrl() in TenantDataSource
public class TenantPooledDataSource extends BasicDataSource implements TenantDat
aSource {
^
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:55: error: cannot find symbol
this.url = dataSourceUrl;
^
symbol: variable url
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:57: error: cannot find symbol
return super.createDataSource();
^
symbol: variable super
location: class TenantPooledDataSource
C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\multi-tenant-core-1.0.
3\src\java\grails\plugin\multitenant\core\datasource\TenantPooledDataSource.java
:51: error: method does not override or implement a method from a supertype
#Override
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: C:\Users\DEV005\.grails\2.3.11\projects\AtivasWeb\plugins\cxf-1.1.4\src\ja
va\org\grails\cxf\artefact\DefaultGrailsEndpointClass.java uses unchecked or uns
afe operations.
Note: Recompile with -Xlint:unchecked for details.
13 errors
1 error
It seems that the error is giving in the multi-tenant-core plugin, where it is giving an error of how to duplicate the classes of the plugin, this is my BuildConfig:
grails.project.class.dir = "target/classes"
grails.project.test.class.dir = "target/test-classes"
grails.project.test.reports.dir = "target/test-reports"
//grails.project.war.file = "target/${appName}-${appVersion}.war"
grails.project.dependency.resolution = {
// inherit Grails' default dependencies
inherits("global") {
// uncomment to disable ehcache
// excludes 'ehcache'
}
log "warn" // log level of Ivy resolver, either 'error', 'warn', 'info', 'debug' or 'verbose'
repositories {
grailsPlugins()
grailsHome()
grailsCentral()
// uncomment the below to enable remote dependency resolution
// from public Maven repositories
mavenLocal()
mavenCentral()
//mavenRepo "http://snapshots.repository.codehaus.org"
//mavenRepo "http://repository.codehaus.org"
//mavenRepo "http://download.java.net/maven/2/"
//mavenRepo "http://repository.jboss.com/maven2/"
}
dependencies {
// specify dependencies here under either 'build', 'compile', 'runtime', 'test' or 'provided' scopes eg.
// runtime 'mysql:mysql-connector-java:5.1.13'
// https://mvnrepository.com/artifact/org.gagravarr/vorbis-java-core
compile group: 'org.gagravarr', name: 'vorbis-java-core', version: '0.8'
}
plugins {
//build ":tomcat:7.0.52.1"
build ":tomcat:7.0.70"
runtime ":hibernate:3.6.10.9"
compile ':scaffolding:2.0.3'
runtime ":jquery:1.8.3"
compile ':cache:1.1.1'
runtime ':resources:1.2.8'
compile ":cache-headers:1.1.5"
runtime ":cached-resources:1.0"
runtime ":zipped-resources:1.0"
runtime ":yui-minify-resources:0.1.5"
// framework dependencies
compile ":mail:1.0.1"
compile ":fields:1.4"
compile ":runtime-logging:0.4"
compile ":burning-image:0.5.1"
compile ":twitter-bootstrap:2.3.2"
compile ":spring-security-core:2.0-RC4"
compile ":spring-security-rest:1.4.0.RC5", {
excludes: 'spring-security-core'
}
// multitenancy
compile ":multi-tenant-single-db:0.8.3"
// events to implement app hooks
compile ":platform-core:1.0.RC6"
// Para fazer upload de imagens
compile ":attachmentable:0.3.0"
// calendários para campos do tipo Date
compile ":calendar:1.2.1"
// exportar dados para Excel
compile ":excel-export:0.1.9", {
excludes: 'xerces'
}
// Jasper Reports
compile ":jasper:1.11.0"
// Export CSV
compile ":csv:0.3.1"
// Tests
test ":cucumber:0.6.2"
// Profiling
compile ":profiler:0.5"
//webservice SOAP
compile ":cxf:1.1.4"
compile ":cxf-client:2.0.3"
//cron job
compile ":quartz:1.0.2"
compile ":multi-tenant-core:1.0.3"
}
}
Does anyone know what I'm doing wrong? What is missing, or what plugin am I adding the most?

I checked the first error: duplicate class: grails.plugin.multitenant.core.CurrentTenant
so it seems that this class is in grails-multi-tenant-single-db: https://github.com/multi-tenant/grails-multi-tenant-single-db/blob/385950fd6f9f12a55eebb62105e0326e50cc6fdc/src/java/grails/plugin/multitenant/core/CurrentTenant.java
and in grails-multi-tenant-core: https://github.com/multi-tenant/grails-multi-tenant-core/blob/190bed38faa2b81074c7ce514e44e20243657e5e/src/java/grails/plugin/multitenant/core/CurrentTenant.java
and you try to use both plugins.

Related

Flutter ios app not building with razorpay plugin

I was unable to build my flutter app in ios as I was getting these error, again and again, everything is working well for android.I get these error after using razorpay plugin in my app for integrating payment gateway.
Error output from Xcode build:
↳
BUILD FAILED *
Xcode's output:
↳
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:44:1: error: unknown attribute '_hasMissingDesignatedInitializers'
#_hasMissingDesignatedInitializers #objc public class PluginPaymentModel : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:41: error: unknown attribute '_hasMissingDesignatedInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:7: error: unknown attribute '_inheritsConvenienceInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:35: error: unknown attribute '_hasMissingDesignatedInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:1: error: unknown attribute '_inheritsConvenienceInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.2/ios/Classes/RazorpayDelegate.swift:2:8: error: failed to load module 'Razorpay'
import Razorpay
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:44:1: error: unknown attribute '_hasMissingDesignatedInitializers'
#_hasMissingDesignatedInitializers #objc public class PluginPaymentModel : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:41: error: unknown attribute '_hasMissingDesignatedInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:51:7: error: unknown attribute '_inheritsConvenienceInitializers'
#objc #_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers public class Otpelf : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:35: error: unknown attribute '_hasMissingDesignatedInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/razorpay-pod/Pod/Razorpay.framework/Modules/Razorpay.swiftmodule/x86_64-apple-ios-simulator.swiftinterface:59:1: error: unknown attribute '_inheritsConvenienceInitializers'
#_inheritsConvenienceInitializers #_hasMissingDesignatedInitializers #objc final public class RazorpayCheckout : ObjectiveC.NSObject {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/razorpay_flutter-1.2.2/ios/Classes/RazorpayDelegate.swift:2:8: error: failed to load module 'Razorpay'
import Razorpay
^
Command CompileSwift failed with a nonzero exit code
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0/ios/Classes/strategies/NotificationPermissionStrategy.m:71:5: warning: 'UIRemoteNotificationType' is deprecated: first deprecated in iOS 8.0 - Use UserNotifications Framework's UNAuthorizationOptions for user notifications and registerForRemoteNotifications for receiving remote notifications instead. [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Users/ganpat/Desktop/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:69:32: note: 'UIRemoteNotificationType' has been explicitly marked deprecated here
typedef NS_OPTIONS(NSUInteger, UIRemoteNotificationType) {
^
/Users/ganpat/develop/flutter/.pub-cache/hosted/pub.dartlang.org/permission_handler-4.4.0/ios/Classes/strategies/NotificationPermissionStrategy.m:71:72: warning: 'enabledRemoteNotificationTypes' is deprecated: first deprecated in iOS 8.0 - Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings [-Wdeprecated-declarations]
UIRemoteNotificationType type = [[UIApplication sharedApplication] enabledRemoteNotificationTypes];
^
In module 'UIKit' imported from /Users/ganpat/Desktop/Flutter_Apps_Projects_2021/wsflutter/ios/Pods/Target Support Files/permission_handler/permission_handler-prefix.pch:2:
/Users/ganpat/Desktop/Xcode 2.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator13.2.sdk/System/Library/Frameworks/UIKit.framework/Headers/UIApplication.h:229:1: note: 'enabledRemoteNotificationTypes' has been explicitly marked deprecated here
(UIRemoteNotificationType)enabledRemoteNotificationTypes API_DEPRECATED("Use -[UIApplication isRegisteredForRemoteNotifications] and UserNotifications Framework's -[UNUserNotificationCenter getNotificationSettingsWithCompletionHandler:] to retrieve user-enabled remote notification and user notification settings", ios(3.0, 8.0)) API_UNAVAILABLE(tvos);
^
2 warnings generated.
note: Using new build system
note: Planning build
note: Constructing build description
Could not build the application for the simulator.
Error launching application on iPhone 11 Pro Max

Calling Dart from Javascript ... is it a bug?

When compiling the following beautiful piece of code ...
#JS()
library nodejs;
import 'package:js/js.dart';
#JS()
class Exports {
external set functionName(Function function);
}
#JS()
external Exports get exports;
void _someDartFunction(dynamic s) {
print('Hello from Dirt!');
}
void main(List<String> arguments) {
exports.functionName = allowInterop(_someDartFunction);
}
... from dart to js using the dart2js command like this:
dart2js -o node_modules/nodejs/index.js bin/main.dart
The nodule is called 'nodejs' (the name is not a problem in this context!). The module is initialised before by npm with an appropriate package.json.
Then I start nodejs and require the module
$ nodejs
> var n = require("nodejs")
ReferenceError: self is not defined
at Object.main (/home/buergerling/Schreibtisch/dart/nodejs1/node_modules/njs/index.js:2544:28)
at /home/buergerling/Schreibtisch/dart/nodejs1/node_modules/njs/index.js:3569:9
at init.currentScript (/home/buergerling/Schreibtisch/dart/nodejs1/node_modules/njs/index.js:3549:7)
at dartProgram (/home/buergerling/Schreibtisch/dart/nodejs1/node_modules/njs/index.js:3564:5)
getting an error. This problem can be solve be cancelling self from the compiled index.js file.
The problem can be spotted here:
...
main: function($arguments) {
var t1 = type$.Function;
J.set$functionName$x(self.exports, P.allowInterop(D.main___someDartFunction$closure(), t1));
J.set$functionName$x(self.module.exports, P.allowInterop(D.main___someDartFunction$closure(), t1));
self.functionName = P.allowInterop(D.main___someDartFunction$closure(), t1);
P.print("Hello from Dirt!");
},
Exports: function Exports() {
}
...
Changing self.exports into exports solves the problem and the module can be loaded and used as expected.
Is there a more elegant solution than editing the compiled file by hand?

resolving dependency error in intellij ide?

I created a new grails 2.2 app and added
compile ":spring-security-core:1.2.7.3"
in plugins inside BuildConfig.groovy. Please note that i am using grails 2.2.
I then ran > grails compile and it throws the following error.
|Loading Grails 2.2.0
|Configuring classpath
.
|Environment set to development
........
|Compiling 156 source files
.Error
|
Compilation error: startup failed:
Compile error during compilation with javac.
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\BCryptPasswordEncoder.java:20: error: package org.springframework.security.authentication.encoding does not exist
import org.springframework.security.authentication.encoding.PasswordEncoder;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\BCryptPasswordEncoder.java:30: error: cannot find symbol
public class BCryptPasswordEncoder implements PasswordEncoder {
^
symbol: class PasswordEncoder
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:21: error: package org.springframework.security.authentication.encoding does not exist
import org.springframework.security.authentication.encoding.PasswordEncoder;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:22: error: package org.springframework.security.core.codec does not exist
import org.springframework.security.core.codec.Hex;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\grails\plugins\springsecurity\DigestAuthPasswordEncoder.java:37: error: cannot find symbol
public class DigestAuthPasswordEncoder implements PasswordEncoder, InitializingBean {
^
symbol: class PasswordEncoder
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:31: error: package org.springframework.security.access does not exist
import org.springframework.security.access.AccessDecisionVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:32: error: package org.springframework.security.access does not exist
import org.springframework.security.access.ConfigAttribute;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:33: error: package org.springframework.security.access does not exist
import org.springframework.security.access.SecurityConfig;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:34: error: package org.springframework.security.access.vote does not exist
import org.springframework.security.access.vote.AuthenticatedVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:35: error: package org.springframework.security.access.vote does not exist
import org.springframework.security.access.vote.RoleVoter;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:36: error: package org.springframework.security.web does not exist
import org.springframework.security.web.FilterInvocation;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:37: error: package org.springframework.security.web.access.expression does not exist
import org.springframework.security.web.access.expression.WebSecurityExpressionHandler;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:38: error: package org.springframework.security.web.access.intercept does not exist
import org.springframework.security.web.access.intercept.FilterInvocationSecurityMetadataSource;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:39: error: package org.springframework.security.web.util does not exist
import org.springframework.security.web.util.AntUrlPathMatcher;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:40: error: package org.springframework.security.web.util does not exist
import org.springframework.security.web.util.UrlMatcher;
^
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:48: error: cannot find symbol
implements FilterInvocationSecurityMetadataSource, InitializingBean {
^
symbol: class FilterInvocationSecurityMetadataSource
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:50: error: cannot find symbol
private UrlMatcher _urlMatcher;
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:53: error: cannot find symbol
private RoleVoter _roleVoter;
^
symbol: class RoleVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:54: error: cannot find symbol
private AuthenticatedVoter _authenticatedVoter;
^
symbol: class AuthenticatedVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:55: error: cannot find symbol
private WebSecurityExpressionHandler _expressionHandler;
^
symbol: class WebSecurityExpressionHandler
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:57: error: cannot find symbol
private final Map<Object, Collection<ConfigAttribute>> _compiled = new LinkedHashMap<Object, Collection<ConfigAttribute>>();
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:61: error: cannot find symbol
protected static final Collection<ConfigAttribute> DENY = Collections.emptyList();
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:75: error: cannot find symbol
public Collection<ConfigAttribute> getAttributes(Object object) throws IllegalArgumentException {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:98: error: cannot find symbol
protected abstract String determineUrl(FilterInvocation filterInvocation);
^
symbol: class FilterInvocation
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:104: error: cannot find symbol
private Collection<ConfigAttribute> findConfigAttributes(final String url) throws Exception {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:158: error: cannot find symbol
public Collection<ConfigAttribute> getAllConfigAttributes() {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:178: error: cannot find symbol
public void setUrlMatcher(final UrlMatcher urlMatcher) {
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:209: error: cannot find symbol
protected UrlMatcher getUrlMatcher() {
^
symbol: class UrlMatcher
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:218: error: cannot find symbol
public Map<Object, Collection<ConfigAttribute>> getConfigAttributeMap() {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:254: error: cannot find symbol
protected Collection<ConfigAttribute> buildConfigAttributes(final Collection<String> tokens) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:269: error: cannot find symbol
protected boolean supports(final ConfigAttribute config) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:274: error: cannot find symbol
private boolean supports(final ConfigAttribute config, final AccessDecisionVoter voter) {
^
symbol: class ConfigAttribute
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-1.2.7.3\src\java\org\codehaus\groovy\grails\plugins\springsecurity\AbstractFilterInvocationDefinition.java:274: error: cannot find symbol
private boolean supports(final ConfigAttribute config, final AccessDecisionVoter voter) {
^
symbol: class AccessDecisionVoter
location: class AbstractFilterInvocationDefinition
C:\Users\sanjayg\.grails\2.2.0\projects\ACLTest\plugins\spring-security-core-
I appreciate any guide to why i am getting this error when compiling dependencies. Is it because it couldnt find the old plugin from the repository. I have also added the following repositories.
mavenRepo "http://repo.spring.io/milestone/"
mavenRepo "https://repo.grails.org/grails/plugins/org/grails/plugins/"
Thanks!
Add spring security plugin in BuildConfig.groovy as follws,
grails.project.dependency.resolver = "maven"
grails.project.dependency.resolution = {
dependencies {
//OTHER PLUGINS here
runtime "org.springframework:spring-test:4.0.7.RELEASE"
}
plugins {
//OTHER PLUGINS here
compile ':spring-security-core:2.0-RC5'
}
}
Do grails clean and grails compile or run-app

Grails 2.2.3 Can't Find Spock on Classpath

I just added spock to a Grails 2.2.3 project
I added the following dependency to Buildonfig.groovy:
plugins {
test(":spock:0.7")
}
Then created my Specification class, "test/unit/LocationSpec.groovy:
import grails.test.mixin.*
import org.junit.*
import spock.lang.*
/**
* See the API for {#link grails.test.mixin.support.GrailsUnitTestMixin} for usage instructions
*/
#TestFor(Location)
class LocationSpec extends Specification {
def setup() {
}
def cleanup() {
}
def "compare"() {
when:
def loc1 = new Location(description:descr1)
def loc2 = new Location(description:descr2)
then:
loc1.compareTo(loc2) == descr1.compareTo(descr2)
where:
descr1 | descr2 | pidm1 | pidm2
"foo" | "foo" | 1333868 | 1333868
}
}
However I am getting the following errors with the Specification import line:
Groovy:unable to resolve class spock.lang.Specification
Derp! R.T.F.M.
From http://grails.org/plugin/spock:
Grails 2.2 uses Groovy 2.0, which requires a special Spock
version. So to use the Spock plugin with Grails 2.2, modify you
BuildConfig.groovy file to include the following:
grails.project.dependency.resolution = {
repositories {
grailsCentral()
mavenCentral()
}
dependencies {
test "org.spockframework:spock-grails-support:0.7-groovy-2.0"
}
plugins {
test(":spock:0.7") { exclude "spock-grails-support" }
}
}

Unity, Prism, FSharp

I get a resolve error when I try to inject into a FSharp library but not wen I do so with a CSharp library.
I have 3 projects :
A main application in csharp
A CSharp project containing a class whose constructor requires a IUnityContainer that gets instantiated fine
A FSharp project containing a class whose constructor requires a IUnityContainer that can't instantiate with error
Resolution of the dependency failed, type =
"ModuleDBGraphFS.ModuleEntityGraphFS", name = "(none)". Exception
occurred while: while resolving. Exception is:
InvalidOperationException - The current type,
Microsoft.Practices.Unity.IUnityContainer, is an interface and cannot
be constructed. Are you missing a type mapping?
At the time of the exception, the container was:
Resolving ModuleDBGraphFS.ModuleEntityGraphFS,(none) Resolving
parameter "container" of constructor
ModuleDBGraphFS.ModuleEntityGraphFS(Microsoft.Practices.Unity.IUnityContainer
container, Microsoft.Practices.Prism.Regions.IRegionManager manager)
Resolving Microsoft.Practices.Unity.IUnityContainer,(none)
Application class in the 1st project (WPF project, you add prism, remove the startupuri from app.xaml, add on the code behind for the bootstrapper )
namespace WpfApplication
{
class Bootstrapper : UnityBootstrapper
{
protected override DependencyObject CreateShell()
{
return this.Container.Resolve<Shell>();
}
protected override void InitializeShell()
{
base.InitializeShell();
App.Current.MainWindow = (Window)this.Shell;
App.Current.MainWindow.Show();
}
protected override void ConfigureModuleCatalog()
{
base.ConfigureModuleCatalog();
ModuleCatalog moduleCatalog = (ModuleCatalog)this.ModuleCatalog;
// OK moduleCatalog.AddModule(typeof(ModuleDBGraph.ModuleEntityGraph));
// KO moduleCatalog.AddModule(typeof(ModuleDBGraphFS.ModuleEntityGraphFS));
}
}
}
In the C# project
public class ModuleEntityGraph : IModule
{
private IUnityContainer _container;
private readonly IRegionManager _manager;
public ModuleEntityGraph(IUnityContainer container, IRegionManager manager)
{
_container = container;
_manager = manager;
}
void IModule.Initialize()
{
}
}
in the F# project
type ModuleEntityGraphFS(container:IUnityContainer, manager:IRegionManager) =
do printfn "hi"
interface Microsoft.Practices.Prism.Modularity.IModule with
member x.Initialize() =
do ()
For some reason, the Nuget script for prism added reference in my module project to
C:\windows\assembly\GAC_MSIL\Microsoft.Practices.Unity\1.2.0.0__31bf3856ad364e35\Microsoft.Practices.Unity.dll
While the shell project itself was referencing
WpfApplication3\packages\Unity.2.1.505.2\lib\NET35\Microsoft.Practices.Unity.dll
A fresh solution that I started made me see the problem.
Hence the odd message that it could not resolve UnityContainer itself (which should be registered somewhere by Prism Unity extensions....)

Resources