Titan 0.4.1 not picking up Rexster server scripts #502

Closed
satb opened this Issue Nov 28, 2013 · 6 comments

Projects

None yet

3 participants

satb commented Nov 28, 2013

Hit a bump while upgrading from Titan 0.4.0 to Titan 0.4.1. This was working just fine when using Titan 0.4.0

Looks like I am unable to get my scripts to be recognized by Rexster.

titan-server-0.4.1 $vi conf/rexster-cassandra-es.xml

<script-engines>
         <script-engine>
             <name>gremlin-groovy</name>
             <reset-threshold>-1</reset-threshold>
             <init-scripts>scripts/get_or_create.groovy,scripts/create.groovy,scripts/data_types.groovy,scripts/negative.groovy</init-scripts>                                                                                    
             <imports>com.tinkerpop.gremlin.*,com.tinkerpop.gremlin.java.*,....truncated rest for readibility..</imports>
             <static-imports>com.tinkerpop.blueprints.Direction.*,com.tinkerpop.blueprints.TransactionalGraph$Conclusion.*,..truncated rest for readability....</static-imports>
         </script-engine>
</script-engines>

titan-server-0.4.1 $cat scripts/data_types.groovy

def makeKey(g, name, dataType, indexed, unique){
  def k =  g.makeKey(name).dataType(Class.forName("java.lang.${dataType}"))
    if(indexed){
      k =  k.indexed(Vertex.class)
    }
  if(unique){
    k = k.unique()
  }
  k = k.make()
    return k
}

def makeLabel(g, name, sortKey) {
  def l = g.makeLabel(name)
    if(sortKey!=null){
      l = l.sortKey(g.getType(sortKey))
    }
  l = l.make()
    return l
}

titan-server-0.4.1 $./bin/titan.sh -c cassandra-es start
Starting Cassandra...
Started Cassandra. Thrift service is alive.
Forking Titan + Rexster...
Forked Titan + Rexster.
Rexster may need a few more seconds to finish bootstrapping.
Run ./bin/rexster-console.sh to connect.

titan-server-0.4.1 $./bin/rexster-console.sh
uname: illegal option -- o
usage: uname [-amnprsv]
(l_(l
(_______( 0 0
( (-Y-)
l l-----l l
l l,, l l,,
opening session [127.0.0.1:8184]
?h for help

rexster[groovy]> g = rexster.getGraph("graph")
==>titangraph[cassandra:null]
rexster[groovy]> makeKey(g, 'time', "Long", true, false)
==>An error occurred while processing the script for language [groovy]. All transactions across all graphs in the session have been concluded with failure: java.util.concurrent.ExecutionException: javax.script.ScriptException: javax.script.ScriptException: groovy.lang.MissingMethodException: No signature of method: com.tinkerpop.gremlin.groovy.jsr223.GremlinGroovyScriptEngine.makeKey() is applicable for argument types: (com.thinkaurelius.titan.graphdb.database.StandardTitanGraph, java.lang.String, java.lang.String, java.lang.Boolean, java.lang.Boolean) values: [titangraph[cassandra:null], time, Long, ...]

Owner

Looks like some pathing has changed in the packaging between 0.4.0 and 0.4.1. I assume you had your scripts directory in TITAN_HOME. It looks like Titan Server is now looking for them in TITAN_HOME/rexhome. if you move your scripts directory there it should work.

@dalaro was this an intentional change going into 0.4.1?

satb commented Dec 2, 2013

Thanks. I'll try and see if it fixes it. Will report back

Owner
dalaro commented Dec 2, 2013

@spmallette I made that change intentionally to work around Rexster's log4j configuration. Here's my related comment in our conversation on #463: #463 (comment)

Owner

Yup...now I remember that. thanks. I've updated the wiki to reflect the change.

satb commented Dec 2, 2013

I can also confirm it is working by moving the scripts to rexhome. BTW, where did you look to figure out that the path has changed? Helps me troubleshoot next time

@satb satb closed this Dec 2, 2013
Owner

Rexster server logs were showing where it was looking for the script.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment