Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Loading plugin in Gremlin console fails #320

Closed
martijndwars opened this issue Dec 2, 2018 · 6 comments
Closed

Loading plugin in Gremlin console fails #320

martijndwars opened this issue Dec 2, 2018 · 6 comments
Labels

Comments

@martijndwars
Copy link

I downloaded apache-tinkerpop-gremlin-console-3.3.4 and started the shell ./bin/gremlin.sh. When I install sqlg-mysql, I get:

gremlin> :install org.umlg sqlg-mysql 2.0.0
org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin: Provider org.umlg.sqlg.groovy.plugin.SqlgPostgresGremlinPlugin could not be instantiated
Type ':help' or ':h' for help.
Display stack trace? [yN]y
java.util.ServiceConfigurationError: org.apache.tinkerpop.gremlin.jsr223.GremlinPlugin: Provider org.umlg.sqlg.groovy.plugin.SqlgPostgresGremlinPlugin could not be instantiated
	at java.util.ServiceLoader.fail(ServiceLoader.java:232)
	at java.util.ServiceLoader.access$100(ServiceLoader.java:185)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:384)
	at java.util.ServiceLoader$LazyIterator.next(ServiceLoader.java:404)
	at java.util.ServiceLoader$1.next(ServiceLoader.java:480)
	at java.lang.Iterable.forEach(Iterable.java:74)
	at org.apache.tinkerpop.gremlin.console.commands.InstallCommand.grabDeps(InstallCommand.groovy:67)
	at org.apache.tinkerpop.gremlin.console.commands.InstallCommand.execute(InstallCommand.groovy:53)
	at org.codehaus.groovy.tools.shell.Shell.execute(Shell.groovy:104)
	at org.codehaus.groovy.tools.shell.Groovysh.super$2$execute(Groovysh.groovy)
	at sun.reflect.GeneratedMethodAccessor15.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
	at org.codehaus.groovy.tools.shell.Groovysh.executeCommand(Groovysh.groovy:273)
	at org.codehaus.groovy.tools.shell.Groovysh.execute(Groovysh.groovy:164)
	at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.super$3$execute(GremlinGroovysh.groovy)
	at sun.reflect.GeneratedMethodAccessor14.invoke(Unknown Source)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
	at org.apache.tinkerpop.gremlin.console.GremlinGroovysh.execute(GremlinGroovysh.groovy:72)
	at org.codehaus.groovy.tools.shell.Shell.leftShift(Shell.groovy:122)
	at org.codehaus.groovy.tools.shell.ShellRunner.work(ShellRunner.groovy:95)
	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$work(InteractiveShellRunner.groovy)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.work(InteractiveShellRunner.groovy:130)
	at org.codehaus.groovy.tools.shell.ShellRunner.run(ShellRunner.groovy:59)
	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.super$2$run(InteractiveShellRunner.groovy)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.codehaus.groovy.reflection.CachedMethod.invoke(CachedMethod.java:98)
	at groovy.lang.MetaMethod.doMethodInvoke(MetaMethod.java:325)
	at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:1225)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuperN(ScriptBytecodeAdapter.java:145)
	at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnSuper0(ScriptBytecodeAdapter.java:165)
	at org.codehaus.groovy.tools.shell.InteractiveShellRunner.run(InteractiveShellRunner.groovy:89)
	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
	at org.apache.tinkerpop.gremlin.console.Console.<init>(Console.groovy:148)
	at org.codehaus.groovy.vmplugin.v7.IndyInterface.selectMethod(IndyInterface.java:236)
	at org.apache.tinkerpop.gremlin.console.Console.main(Console.groovy:455)
Caused by: java.lang.IllegalAccessException: Class java.util.ServiceLoader$LazyIterator can not access a member of class org.umlg.sqlg.groovy.plugin.SqlgPostgresGremlinPlugin with modifiers "private"
	at sun.reflect.Reflection.ensureMemberAccess(Reflection.java:102)
	at java.lang.Class.newInstance(Class.java:436)
	at java.util.ServiceLoader$LazyIterator.nextService(ServiceLoader.java:380)
	... 54 more

What am I doing wrong?

@martijndwars martijndwars changed the title Loading plugin fails Loading plugin in Gremlin console fails Dec 2, 2018
@pietermartin
Copy link
Owner

Hmmm, thats weird, where is it getting postgresql from?

@pietermartin
Copy link
Owner

Ok, I am getting the same, not even on mysql but the postgres plugin.

@pietermartin
Copy link
Owner

Ok, looks like I fell for Intellij's code suggestions and made the ServiceLoaders constructor private without thinking.

@pietermartin
Copy link
Owner

Ok, the console is working for Postgresql and Mariadb on 2.0.1-SNAPSHOT
For some reason the console groovy magic is not loading Hsqldb, H2 and MSSqlServer properly.
Mysql is a copy of Mariadb but I have not actually tested it as I only got Mariadb running on my machine.
It will be great if you can test mysql.

@pietermartin
Copy link
Owner

I updated the docs with how I manage to get it working,
http://www.sqlg.org/docs/2.0.0-SNAPSHOT/#_gremlin_console

@pietermartin
Copy link
Owner

Deployed a latest 2.0.1-SNAPSHOT
The plugins for hsqldb, h2 and mssqlserver were not quite right. I tested them now and their consoles are working.

Please open the issue if you still have problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants