Connect to neo4j using ColdFusion

Has anyone here successfully connected to neo4j using ColdFusion?

I was able to connect to neo4j 1.6.1 using this guide as a starting point: http://ghostednotes.com/2010/04/29/using-neo4j-graph-databases-with-coldfusion , however it was a short success. Since then I have uninstalled neo4j 1.6.1 and installed 1.7.

Now I am running Apache, CF 9.0.1 on Windows XP as a local unit. I added ...\neo4j-community-1.7\libin my way to class the CF, and the library - listed in the class path Java CF Server. neo4j is working fine since I can use their admin interface: http: // localhost: 7474 / webadmin / # . CF and Apache also work fine. I use them daily.

While the code below works, I would really like to “see” what happens with the neo4j web admin. Therefore, I can coordinate my neo4j training when using data in the CF application.

Code: (works)

    dbroot = "/tmp/neo4jtest1/";
    graphDb = createObject('java', 'org.neo4j.kernel.EmbeddedGraphDatabase');
    graphDb.init( dbroot & 'var/myFirstGraphDB');

So, I tried to connect to neo4j db graph.db. However, the code does not work.

Code: (failed)

    graphDb = createObject('java', 'org.neo4j.kernel.EmbeddedGraphDatabase');
    graphDb.init( dbroot & 'graph.db');

Error:

    Object instantiation exception.
    An exception occurred while instantiating a Java object. The class must not be an interface or an abstract class. Error: ''. 

If I delete "."in graph.db, it will make the creation of "graphdb" in the neo4j data folder and successfully connect to it. However, this db is not viewable by admin :(

I am a newbie, so please do not give an answer.

+5
source share
2 answers

, , , , . Neo4J CF ( Java) ( 1).

Neo4J Adobe CF, , , Neo4J Neo4J. , , .

Neo4J . Neo4J ( : , , ). Neo4J, ( 2).

, :

1- , , Java. Java ( ( -) ):

// Create your embedded graph db somewhere
src = CreateObject("java", "org.neo4j.server.WrappingNeoServerBootstrapper")
      .init(graphDb);
srv.start();
// The server is now running
// until we stop it:
srv.stop();

, , , , , .

2, 1 / Neo4J, , Neo4Js (EmbeddedReadOnlyGraphDatabase), ( ).

REST - , Neo4J Java REST Binding ( ).

, , .

CF/Neo4J, . , , , .

+4

otupman. CF. CF, , , . , . , Tomcat, .

  • neo4j-community-1.7/lib/*.* ( )
  • neo4j-community-1.7/system/lib: ( )

    • asm-3.1.jar
    • ASM--3.2.jar
    • ASM--3.2.jar
    • ASM--3.2.jar
    • ASM-Util-3.2.jar
    • --1.6.jar
    • --ASL-1.8.3.jar
    • -jaxrs-1.8.3.jar
    • --ASL-1.8.3.jar
    • --1.9.jar
    • --1.9.jar
    • - 1.9.jar
    • -6.1.25.jar
    • -Util-6.1.25.jar
    • Neo4j--1,7--web.jar
    • Neo4j- 1.7.jar
    • rrd4j-2.0.7.jar

onApplicationStart

    factory = createObject("java", "org.neo4j.graphdb.factory.GraphDatabaseFactory");
    dbroot = ExpandPath("/neo4jtest/");
    graphDb = factory.newEmbeddedDatabase(dbroot & 'myFirstGraphDB');

    Bootstrapper = createObject("java", "org.neo4j.server.WrappingNeoServerBootstrapper");
    graphServer = Bootstrapper.init( graphDb );
    graphServer.start();

    application.graphServer = graphServer;
    application.graphDb = graphDB;

onApplicationEnd

    application.graphDb.shutDown();
    application.graphServer.stop();

: , , OnServerStart. , . , .

+2

All Articles