有沒有可用於在Neo4j-3.0.3中創建存儲過程的示例Scala代碼?Neo4j 3.0.3 Scala中的存儲過程
我一直在試圖創建一個簡單的基於Scala的存儲過程。下面是錯誤消息我收到的時候我在我的斯卡拉-jar文件複製到的Neo4j-plugins目錄並啓動Neo4j的服務器:
================= Caused by: org.neo4j.kernel.lifecycle.LifecycleException: Component '[email protected]' was successfully initialized, but failed to start. Please see attached cause exception. at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:444) at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:107) at org.neo4j.kernel.impl.factory.GraphDatabaseFacadeFactory.newFacade(GraphDatabaseFacadeFactory.java:140) ... 10 more Caused by: org.neo4j.kernel.api.exceptions.ProcedureException: Unable to find a usable public no-argument constructor in the class `neoscala`. Please add a valid, public constructor, recompile the class and try again. =================
,我已經使用Scala的類是:
package neoproc import org.neo4j.graphdb.GraphDatabaseService import org.neo4j.procedure.Procedure; import javax.ws.rs.core.{Context, Response} class neoscala(@Context db: GraphDatabaseService) { @Procedure def alice():String = { String.valueOf(db.execute("MATCH (n:User) return n")); } }