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

TitanFactory not imported when running Gremlin script #96

Closed
vadasg opened this issue Sep 29, 2012 · 1 comment
Closed

TitanFactory not imported when running Gremlin script #96

vadasg opened this issue Sep 29, 2012 · 1 comment

Comments

@vadasg
Copy link
Member

vadasg commented Sep 29, 2012

I can create a new graph in an interactive Gremlin shell with no problems:

vadasg$ ./titan-0.1.0/bin/gremlin.sh

     \,,,/
     (o o)

-----oOOo-(_)-oOOo-----
gremlin> g = TitanFactory.open('/tmp/titantest1')
==>titangraph[local:/tmp/titantest1]
gremlin> exit

However, when I do the same thing in a script that I run with Gremlin I get the following error:

vadasg$ echo "g = TitanFactory.open('/tmp/titantest2')" > titantest2.groovy
vadasg$ ./titan-0.1.0/bin/gremlin.sh -e titantest2.groovy
javax.script.ScriptException: groovy.lang.MissingPropertyException: No such property: TitanFactory for class: Script1

Marko gave me the workaround: import TitanFactory explicitly in the script:

echo "import com.thinkaurelius.titan.core.TitanFactory; g = TitanFactory.open('/tmp/titantest2')" > titantest2.groovy
bin/gremlin.sh -e titantest2.groovy 

titan$ ls /tmp/titantest2/
00000000.jdb    je.info.0   je.info.0.lck   je.lck

It would be good if this were fixed in Titan so the workaround is not needed.

@okram
Copy link
Contributor

okram commented Oct 2, 2012

Fixed. Pushed to 0.2-SNAPSHOT.

titan$ echo "g = TitanFactory.open('/tmp/titantest2')" > titantest2.groovy
titan$ bin/gremlin.sh -e titantest2.groovy 
titan$ 

@okram okram closed this as completed Oct 2, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants