Shield Custom Realm for 2.4.4 - unable to compile after moving from 2.4.3

Hi,

I was using and modifying custom realm using 2.4.3 version of ES. However lately ES is now upgraded to 2.4.4, I just updated the POM.XML to 2.4.4 and after which i am getting series of compilation errors, Please help me identify the solution, below is the compilation error:

[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR :
[INFO] -------------------------------------------------------------
[ERROR] E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\CustomRealmExamplePlugin.java:[24,37] error: cannot find symbol
[ERROR] symbol: class AuthenticationModule
location: package org.elasticsearch.shield.authc
E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\CustomRealmExamplePlugin.java:[54,25] error: cannot find symbol
[ERROR] symbol: class AuthenticationModule
location: class CustomRealmExamplePlugin
E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomCachingRealmFactory.java:[23,31] error: cannot find symbol
[ERROR] symbol: class ShieldSettingsFilter
location: package org.elasticsearch.shield
E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomCachingRealmFactory.java:[24,37] error: cannot find symbol
[ERROR] symbol: class Realm
location: package org.elasticsearch.shield.authc
E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomCachingRealmFactory.java:[25,37] error: cannot find symbol
[ERROR] symbol: class RealmConfig
location: package org.elasticsearch.shield.authc
[ERROR] E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomAuthenticationFailureHandler.java:[94,4] error: method does not override or implement a method from a supertype
[ERROR] E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomAuthenticationFailureHandler.java:[96,44] error: cannot find symbol[details=Summary]This text will be hidden[/details]
[ERROR] symbol: variable super
[ERROR] location: class CustomAuthenticationFailureHandler
[ERROR] E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomRealmFactory.java:[50,4] error: method does not override or implement a method from a supertype
[ERROR] E:\kudopo\customrealm\shield-custom-realm-example-2.4\src\main\java\org\elasticsearch\example\realm\CustomRealmFactory.java:[63,4] error: method does not override or implement a method from a supertype
[ERROR] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.3:compile (default-compile) on project shield-custom-realm-example: Compilation failure
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:212)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:116)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:80)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:307)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:193)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:106)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:863)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:288)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:199)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(Launcher.java:415)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:356)
Caused by: org.apache.maven.plugin.compiler.CompilationFailureException: Compilation failure
at org.apache.maven.plugin.compiler.AbstractCompilerMojo.execute(AbstractCompilerMojo.java:911)
at org.apache.maven.plugin.compiler.CompilerMojo.execute(CompilerMojo.java:129)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:207)
... 20 more
[ERROR]
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException

It looks like there is a problem with the 2.4.4 shield jar in our maven repository.

We are working to fix that - thanks for letting us know.

The maven repository problem has been resolved.

You may need to clear the old jar from any repositories that have a copy of it.

On your local machine that's as simple as deleting the folder .m2/repository/org/elasticsearch/plugin/shield/2.4.4/ from your home directory (something like C:\Documents and Settings\{your-windows-login}\.m2\repository\ ... on windows).

If you are using a local repository manager (like Nexus or Artifactory) you will need to force a re-download there as well.

@TimV
Thanks for the reply and fixing the Build issues. I have completed the build and run the test however when i am installing the plugin in the ES i am getting this error.

; line: 102, column: 18]
at com.fasterxml.jackson.dataformat.yaml.snakeyaml.error.MarkedYAMLException.from(MarkedYAMLException.java:27)
at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:343)
at org.elasticsearch.common.xcontent.json.JsonXContentParser.nextToken(JsonXContentParser.java:53)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:99)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:101)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:101)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:101)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.serializeObject(XContentSettingsLoader.java:101)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:67)
at org.elasticsearch.common.settings.loader.XContentSettingsLoader.load(XContentSettingsLoader.java:45)
at org.elasticsearch.common.settings.loader.YamlSettingsLoader.load(YamlSettingsLoader.java:46)
at org.elasticsearch.common.settings.Settings$Builder.loadFromStream(Settings.java:1080)
... 3 more
Caused by: mapping values are not allowed here
in 'reader', line 102, column 18:
users:
^

    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchValue(ScannerImpl.java:871)
    at org.yaml.snakeyaml.scanner.ScannerImpl.fetchMoreTokens(ScannerImpl.java:360)
    at org.yaml.snakeyaml.scanner.ScannerImpl.checkToken(ScannerImpl.java:226)
    at org.yaml.snakeyaml.parser.ParserImpl$ParseBlockMappingKey.produce(ParserImpl.java:558)
    at org.yaml.snakeyaml.parser.ParserImpl.peekEvent(ParserImpl.java:158)
    at org.yaml.snakeyaml.parser.ParserImpl.getEvent(ParserImpl.java:168)
    at com.fasterxml.jackson.dataformat.yaml.YAMLParser.nextToken(YAMLParser.java:340)
    ... 13 more

Can you help me identify the issue

It looks like you have inconsistent spacing in your YAML file.
There appears to be an extra space in front of users:

In the future please post configuration files as code (i.e. preformatted text, using the </> button) rather than a screenshot.

@TimV
Thanks Tim, yes users: was the culprit. It works now.

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.