graphaware / neo4j-uuid

GraphAware Runtime Module that assigns a UUID to all nodes (and relationships) in the graph transparently
103 stars 22 forks source link

UUID not generated for version 2.2.5 #9

Closed levidamian closed 9 years ago

levidamian commented 9 years ago

In the folder /var/lib/neo4j/plugins I have the file graphaware-server-community-all-2.2.5.34.jar I restarted the server and I created a node but there is no UUID.

neo4j-sh (?)$ create (a:Author{author_name: 'Camus, Albert'});
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 1
Properties set: 1
Labels added: 1
876 ms
neo4j-sh (?)$ match (a:Author) return a;                      
+--------------------------------------+
| a                                    |
+--------------------------------------+
| Node[0]{author_name:"Camus, Albert"} |
+--------------------------------------+
1 row
267 ms
neo4j-sh (?)$ match (a:Author) return a.uuid;                 
+--------+
| a.uuid |
+--------+
| <null> |
+--------+
1 row
77 ms
bachmanm commented 9 years ago

what does your neo4j.properties look like?

levidamian commented 9 years ago

dbms.pagecache.memory=10g remote_shell_enabled=true remote_shell_host=127.0.0.1 remote_shell_port=1337 com.graphaware.runtime.enabled=true com.graphaware.module.UIDM.1=com.graphaware.module.uuid.UuidBootstrapper com.graphaware.module.UIDM.uuidProperty=uuid com.graphaware.module.UIDM.node=hasLabel('Label1') || hasLabel('Label2') com.graphaware.module.UIDM.uuidIndex=uuidIndex

ikwattro commented 9 years ago

The following configuration line :

com.graphaware.module.UIDM.node=hasLabel('Label1') || hasLabel('Label2')

tells the module to create uuids only for nodes with labels Label1 or Label2.

This is optional, so you can just comment this line with the # if you want the uuid to be generated for all nodes and restart the db after the configuration change.

levidamian commented 9 years ago

OK, I commented the line as suggested, I restarted the server, same result, no UUID when creating a node.

ikwattro commented 9 years ago

can you paste the last 100 lines of your console.log file :

tail -n 100 data/log/console.log
levidamian commented 9 years ago

ubuntu@ip-10-92-135-77:/var/log/neo4j$ tail -n 100 console.log 21:16:17.996 [main] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'graphaware': initialization started 21:16:18.000 [main] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Refreshing WebApplicationContext for namespace 'graphaware-servlet': startup date [Thu Sep 24 21:16:18 UTC 2015]; parent: org.springframework.context.support.GenericApplicationContext@2c939698 21:16:18.021 [main] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Scanning base packages: [com..graphaware.,org..graphaware.,net..graphaware.] 21:16:19.589 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'graphaware-servlet': startup date [Thu Sep 24 21:16:18 UTC 2015]; parent: org.springframework.context.support.GenericApplicationContext@2c939698 21:16:19.785 [main] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'graphaware': initialization completed in 1789 ms 21:16:19.785 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@273edcec{/graphaware,null,AVAILABLE} 21:16:19.806 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector@12af3a25{HTTP/1.1}{10.92.135.77:7474} 21:16:19.929 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector@27ee1595{SSL-HTTP/1.1}{10.92.135.77:7473} 21:16:19.929 [main] INFO org.eclipse.jetty.server.Server - Started @8403ms 21:16:19.931 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Server started on: http://10.92.135.77:7474/ 21:16:19.932 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Remote interface ready and available at [http://10.92.135.77:7474/] 21:28:14.815 [Thread-6] INFO o.s.c.s.GenericApplicationContext - Closing org.springframework.context.support.GenericApplicationContext@2c939698: startup date [Thu Sep 24 21:16:16 UTC 2015]; root of context hierarchy 21:28:14.815 [Thread-14] INFO c.g.s.GraphAwareCommunityBootstrapper - Neo4j Server shutdown initiated by request 21:28:14.824 [Thread-14] INFO o.e.jetty.server.ServerConnector - Stopped ServerConnector@12af3a25{HTTP/1.1}{10.92.135.77:7474} 21:28:14.825 [Thread-14] INFO o.e.jetty.server.ServerConnector - Stopped ServerConnector@27ee1595{SSL-HTTP/1.1}{10.92.135.77:7473} 21:28:14.825 [Thread-14] INFO /graphaware - Destroying Spring FrameworkServlet 'graphaware' 21:28:14.825 [Thread-14] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Closing WebApplicationContext for namespace 'graphaware-servlet': startup date [Thu Sep 24 21:16:18 UTC 2015]; parent: org.springframework.context.support.GenericApplicationContext@2c939698 21:28:14.828 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@273edcec{/graphaware,null,UNAVAILABLE} 21:28:14.828 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@725e9af2{/,null,UNAVAILABLE} 21:28:14.829 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.w.WebAppContext@3ef73474{/browser,jar:file:/usr/share/neo4j/system/lib/neo4j-browser-2.2.5.jar!/browser,UNAVAILABLE} 21:28:14.830 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@cd34045{/db/data,null,UNAVAILABLE} 21:28:14.830 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.ServletContextHandler@12fa0836{/db/manage,null,UNAVAILABLE} 21:28:14.832 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.w.WebAppContext@7acd9b42{/webadmin,jar:file:/usr/share/neo4j/system/lib/neo4j-server-2.2.5-static-web.jar!/webadmin-html,UNAVAILABLE} 21:28:14.832 [Thread-14] INFO o.e.j.server.handler.ContextHandler - Stopped o.e.j.s.h.MovedContextHandler@373e2c30{/,null,UNAVAILABLE} 21:28:14.840 [Thread-14] INFO c.g.s.GraphAwareCommunityNeoServer - Successfully shutdown Neo4j Server. 21:28:14.960 [Thread-14] INFO c.g.runtime.BaseGraphAwareRuntime - Shutting down GraphAware Runtime... 21:28:14.960 [Thread-14] INFO c.g.r.schedule.RotatingTaskScheduler - Terminating task scheduler... 21:28:14.960 [Thread-14] INFO c.g.r.schedule.RotatingTaskScheduler - Task scheduler terminated successfully. 21:28:14.960 [Thread-14] INFO c.g.runtime.BaseGraphAwareRuntime - GraphAware Runtime shut down. 2015-09-24 21:28:14.968+0000 INFO [API] Successfully stopped database 21:28:14.968 [Thread-14] INFO c.g.s.GraphAwareCommunityNeoServer - Successfully shutdown database. 21:28:16.543 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Setting startup timeout to: 120000ms based on 120000 21:28:18.901 [main] INFO c.g.r.b.RuntimeKernelExtension - GraphAware Runtime enabled, bootstrapping... 21:28:18.928 [main] INFO c.g.r.b.RuntimeKernelExtension - Bootstrapping module with order 1, ID UIDM, using com.graphaware.module.uuid.UuidBootstrapper 21:28:18.934 [main] ERROR c.g.r.b.RuntimeKernelExtension - Unable to bootstrap module 1 java.lang.ClassNotFoundException: com.graphaware.module.uuid.UuidBootstrapper at java.net.URLClassLoader$1.run(URLClassLoader.java:366) ~[na:1.7.0_75] at java.net.URLClassLoader$1.run(URLClassLoader.java:355) ~[na:1.7.0_75] at java.security.AccessController.doPrivileged(Native Method) ~[na:1.7.0_75] at java.net.URLClassLoader.findClass(URLClassLoader.java:354) ~[na:1.7.0_75] at java.lang.ClassLoader.loadClass(ClassLoader.java:425) ~[na:1.7.0_75] at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308) ~[na:1.7.0_75] at java.lang.ClassLoader.loadClass(ClassLoader.java:358) ~[na:1.7.0_75] at java.lang.Class.forName0(Native Method) ~[na:1.7.0_75] at java.lang.Class.forName(Class.java:191) ~[na:1.7.0_75] at com.graphaware.runtime.bootstrap.RuntimeKernelExtension.registerModules(RuntimeKernelExtension.java:145) [graphaware-server-community-all-2.2.5.34.jar:na] at com.graphaware.runtime.bootstrap.RuntimeKernelExtension.start(RuntimeKernelExtension.java:113) [graphaware-server-community-all-2.2.5.34.jar:na] at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.extension.KernelExtensions.start(KernelExtensions.java:80) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.InternalAbstractGraphDatabase.run(InternalAbstractGraphDatabase.java:331) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.EmbeddedGraphDatabase.(EmbeddedGraphDatabase.java:59) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.server.database.LifecycleManagingDatabase$1.newGraphDatabase(LifecycleManagingDatabase.java:44) [neo4j-server-2.2.5.jar:2.2.5] at org.neo4j.server.database.LifecycleManagingDatabase.start(LifecycleManagingDatabase.java:110) [neo4j-server-2.2.5.jar:2.2.5] at org.neo4j.kernel.lifecycle.LifeSupport$LifecycleInstance.start(LifeSupport.java:507) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.kernel.lifecycle.LifeSupport.start(LifeSupport.java:115) [neo4j-kernel-2.2.5.jar:2.2.5] at org.neo4j.server.AbstractNeoServer.start(AbstractNeoServer.java:203) [neo4j-server-2.2.5.jar:2.2.5] at org.neo4j.server.Bootstrapper.start(Bootstrapper.java:117) [neo4j-server-2.2.5.jar:2.2.5] at org.neo4j.server.Bootstrapper.main(Bootstrapper.java:69) [neo4j-server-2.2.5.jar:2.2.5] 21:28:18.942 [main] INFO c.g.r.b.RuntimeKernelExtension - GraphAware Runtime bootstrapped, starting the Runtime... 2015-09-24 21:28:19.289+0000 INFO [API] Successfully started database 21:28:19.299 [Thread-4] INFO c.g.runtime.BaseGraphAwareRuntime - Starting GraphAware... 21:28:19.299 [Thread-4] INFO c.g.runtime.BaseGraphAwareRuntime - Loading module metadata... 21:28:19.302 [Thread-4] INFO c.g.runtime.BaseGraphAwareRuntime - Module metadata loaded. 21:28:19.303 [Thread-4] INFO c.g.r.m.BaseTxDrivenModuleManager - Starting transaction-driven modules... 21:28:19.303 [Thread-4] INFO c.g.r.m.BaseTxDrivenModuleManager - Transaction-driven modules started. 21:28:19.303 [Thread-4] INFO c.g.r.schedule.RotatingTaskScheduler - There are no timer-driven runtime modules. Not scheduling any tasks. 21:28:19.303 [Thread-4] INFO c.g.runtime.BaseGraphAwareRuntime - GraphAware started. 21:28:19.303 [Thread-4] INFO c.g.r.b.RuntimeKernelExtension - GraphAware Runtime automatically started. 21:28:19.366 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Starting HTTP on port :7474 with 2 threads available 21:28:19.567 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Enabling HTTPS on port :7473 21:28:19.879 [main] INFO org.eclipse.jetty.util.log - Logging initialized @4324ms 21:28:19.945 [main] INFO c.g.s.web.GraphAwareJetty9WebServer - Mounting static content at [/webadmin] from [webadmin-html] 21:28:20.017 [main] INFO c.g.s.web.GraphAwareJetty9WebServer - Mounting static content at [/browser] from [browser] 21:28:20.158 [main] INFO o.s.c.s.GenericApplicationContext - Refreshing org.springframework.context.support.GenericApplicationContext@2c939698: startup date [Thu Sep 24 21:28:20 UTC 2015]; root of context hierarchy 21:28:20.266 [main] INFO c.g.s.web.GraphAwareJetty9WebServer - Mounting GraphAware Framework under /graphaware 21:28:20.315 [main] INFO c.g.s.web.GraphAwareJetty9WebServer - Will try to scan the following packages: {com..graphaware.,org..graphaware.,net..graphaware.} 21:28:20.322 [main] INFO org.eclipse.jetty.server.Server - jetty-9.2.4.v20141103 21:28:20.355 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.h.MovedContextHandler@373e2c30{/,null,AVAILABLE} 21:28:20.543 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /webadmin, did not find org.apache.jasper.servlet.JspServlet 21:28:20.563 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@7acd9b42{/webadmin,jar:file:/usr/share/neo4j/system/lib/neo4j-server-2.2.5-static-web.jar!/webadmin-html,AVAILABLE} 21:28:21.274 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@12fa0836{/db/manage,null,AVAILABLE} 21:28:21.886 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@cd34045{/db/data,null,AVAILABLE} 21:28:21.914 [main] INFO o.e.j.w.StandardDescriptorProcessor - NO JSP Support for /browser, did not find org.apache.jasper.servlet.JspServlet 21:28:21.915 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.w.WebAppContext@3ef73474{/browser,jar:file:/usr/share/neo4j/system/lib/neo4j-browser-2.2.5.jar!/browser,AVAILABLE} 21:28:22.089 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@725e9af2{/,null,AVAILABLE} 21:28:22.119 [main] INFO /graphaware - Initializing Spring FrameworkServlet 'graphaware' 21:28:22.119 [main] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'graphaware': initialization started 21:28:22.123 [main] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Refreshing WebApplicationContext for namespace 'graphaware-servlet': startup date [Thu Sep 24 21:28:22 UTC 2015]; parent: org.springframework.context.support.GenericApplicationContext@2c939698 21:28:22.145 [main] INFO o.s.w.c.s.AnnotationConfigWebApplicationContext - Scanning base packages: [com..graphaware.,org..graphaware.,net..graphaware.] 21:28:23.829 [main] INFO o.s.w.s.m.m.a.RequestMappingHandlerAdapter - Looking for @ControllerAdvice: WebApplicationContext for namespace 'graphaware-servlet': startup date [Thu Sep 24 21:28:22 UTC 2015]; parent: org.springframework.context.support.GenericApplicationContext@2c939698 21:28:23.977 [main] INFO o.s.web.servlet.DispatcherServlet - FrameworkServlet 'graphaware': initialization completed in 1858 ms 21:28:23.978 [main] INFO o.e.j.server.handler.ContextHandler - Started o.e.j.s.ServletContextHandler@273edcec{/graphaware,null,AVAILABLE} 21:28:23.989 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector@398557e2{HTTP/1.1}{10.92.135.77:7474} 21:28:24.121 [main] INFO o.e.jetty.server.ServerConnector - Started ServerConnector@41be6919{SSL-HTTP/1.1}{10.92.135.77:7473} 21:28:24.121 [main] INFO org.eclipse.jetty.server.Server - Started @8577ms 21:28:24.122 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Server started on: http://10.92.135.77:7474/ 21:28:24.122 [main] INFO c.g.s.GraphAwareCommunityNeoServer - Remote interface ready and available at [http://10.92.135.77:7474/] ubuntu@ip-10-92-135-77:/var/log/neo4j$

ikwattro commented 9 years ago

By seeing these lines :

21:28:18.928 [main] INFO c.g.r.b.RuntimeKernelExtension - Bootstrapping module with order 1, ID UIDM, using com.graphaware.module.uuid.UuidBootstrapper
21:28:18.934 [main] ERROR c.g.r.b.RuntimeKernelExtension - Unable to bootstrap module 1
java.lang.ClassNotFoundException: com.graphaware.module.uuid.UuidBootstrapper

Can you confirm that the UUID plugin is also present in the plugins folder ?

levidamian commented 9 years ago

I can confirm this:

ubuntu@ip-10-92-135-77:/var/lib/neo4j/plugins$ pwd /var/lib/neo4j/plugins ubuntu@ip-10-92-135-77:/var/lib/neo4j/plugins$ ls -lrt total 12868 -rw-r--r-- 1 neo4j adm 273 Aug 27 12:42 README.txt -rwxr-xr-x 1 neo4j adm 13171409 Sep 24 20:46 graphaware-server-community-all-2.2.5.34.jar

ikwattro commented 9 years ago

Ok you need to download the UUID plugin and copy it inside the plugins folder too.

Download link : http://graphaware.com/downloads/graphaware-uuid-2.2.5.34.7.jar

levidamian commented 9 years ago

It worked, many thanks, here is the result: neo4j-sh (?)$ create (a:Author{author_name: 'Camus, Albert'}); +-------------------+ | No data returned. | +-------------------+ Nodes created: 1 Properties set: 1 Labels added: 1 825 ms neo4j-sh (?)$ match (a:Author) return a;
+----------------------------------------------------------------------------------+ | a | +----------------------------------------------------------------------------------+ | Node[0]{author_name:"Camus, Albert",uuid:"3b3dfd20-6306-11e5-9209-22000b18b199"} | +----------------------------------------------------------------------------------+ 1 row 331 ms

ikwattro commented 9 years ago

Ok cool ! Have fun !