Hi Rodger, The library that Neo4j uses is geronimo-jta_1.1_spec version 1.1.1. This contains the interface that you require.
Have you tried building your application using maven or similar (e.g. ivy, gradle)? This jar, and neo4j-primitive-collections, are transitive dependencies of the kernel jar and would be resolved automatically if you were using maven. If you do decide to add the jars directly, you can find them: http://mvnrepository.com/artifact/org.apache.geronimo.specs/geronimo-jta_1.1_spec/1.1.1 http://mvnrepository.com/artifact/org.neo4j/neo4j-primitive-collections/2.1.2 but as your application gets more complex and requires things like cypher, etc. you will find yourself having to manage many more jars. There's documentation to support all this at http://docs.neo4j.org/chunked/stable/tutorials-java-embedded-setup.html Dave On Friday, July 25, 2014 4:30:11 PM UTC+1, Rodger wrote: > > Hello all, > > > I'm trying to recreate the program here: > http://stackoverflow.com/questions/15662059/neo4j-helloworld-is-not-working > > as I mentioned in another post. > https://groups.google.com/forum/#!topic/neo4j/EWl2p4xMF2U > > > In Netbeans, I added library: > > /neo4j/neo4j-community-2.1.2/neo4j-community-2.1.2/lib/neo4j-kernel-2.1.2.jar > > > And the program compiled fine. > > > > But when I run the program, I get this error: > > > > run: > Exception in thread "main" java.lang.NoClassDefFoundError: > javax/transaction/TransactionManager > at java.lang.ClassLoader.defineClass1(Native Method) > at java.lang.ClassLoader.defineClass(ClassLoader.java:792) > at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142) > at java.net.URLClassLoader.defineClass(URLClassLoader.java:449) > at java.net.URLClassLoader.access$100(URLClassLoader.java:71) > at java.net.URLClassLoader$1.run(URLClassLoader.java:361) > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > at > org.neo4j.graphdb.factory.GraphDatabaseFactory$1.newDatabase(GraphDatabaseFactory.java:90) > at > org.neo4j.graphdb.factory.GraphDatabaseBuilder.newGraphDatabase(GraphDatabaseBuilder.java:199) > at > org.neo4j.graphdb.factory.GraphDatabaseFactory.newEmbeddedDatabase(GraphDatabaseFactory.java:70) > at HelloNeo4J.main(HelloNeo4J.java:34) > Caused by: java.lang.ClassNotFoundException: > javax.transaction.TransactionManager > at java.net.URLClassLoader$1.run(URLClassLoader.java:366) > at java.net.URLClassLoader$1.run(URLClassLoader.java:355) > at java.security.AccessController.doPrivileged(Native Method) > at java.net.URLClassLoader.findClass(URLClassLoader.java:354) > at java.lang.ClassLoader.loadClass(ClassLoader.java:424) > at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) > at java.lang.ClassLoader.loadClass(ClassLoader.java:357) > ... 16 more > Java Result: 1 > BUILD SUCCESSFUL (total time: 0 seconds) > > > > Failing on this line: > GraphDatabaseService graphDb= new > GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH ); > > > This occurs whether or not the NEO4J server is running. > > > > What is the secret to getting the program to work? > > Thanks a lot! > > The simple program is: > > ------ > > > import org.neo4j.graphdb.GraphDatabaseService; > import org.neo4j.graphdb.Node; > import org.neo4j.graphdb.Relationship; > import org.neo4j.graphdb.RelationshipType; > import org.neo4j.graphdb.Transaction; > import org.neo4j.graphdb.factory.GraphDatabaseFactory; > > public class HelloNeo4J { > > private static enum RelTypes implements RelationshipType > { > KNOWS > } > > > // public static String DB_PATH= " /home/anas/graph/data/graph.db/" ; > > public static String DB_PATH= > "/neo4j/neo4j-community-2.1.2/neo4j-community-2.1.2/data/graph.db/" ; > > > public static void main ( String[] args){ > > GraphDatabaseService graphDb= new > GraphDatabaseFactory().newEmbeddedDatabase( DB_PATH ); > Node firstNode, secondNode; > Relationship relationship; > > Transaction tx = graphDb.beginTx(); > try > { > firstNode = graphDb.createNode(); > firstNode.setProperty( "message", "Hello, " ); > secondNode = graphDb.createNode(); > secondNode.setProperty( "message", "World!" ); > > relationship = firstNode.createRelationshipTo( secondNode, > RelTypes.KNOWS ); > relationship.setProperty( "message", "brave Neo4j " ); > tx.success(); > } > finally > { > // tx.finish(); > tx.close(); > } > > } > } > > -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
