i have been trying make maven-web application. calculating few stuffs , need display in graph trying display using neo4j. problem facing right able connect program neo4j not able directly open browser display graph.
my code :
public static void main( string[] args ) throws ioexception, { file filename=new file("c:/path/documents/neo4j/default.graphdb"); graphdatabasefactory dbfactory= new graphdatabasefactory(); graphdatabaseservice graphdb=dbfactory.newembeddeddatabase(filename); try(transaction tx=graphdb.begintx()){ node anode=graphdb.createnode(nodetype.tspot); anode.setproperty("pid", "a"); node bnode=graphdb.createnode(nodetype.tspot); bnode.setproperty("pid", "b"); relationship distance = anode.createrelationshipto(bnode,relationtype.distance); distance.setproperty("distance", 40); tx.success(); system.out.println("success"); } config nossl = config.build() .withencryptionlevel(config.encryptionlevel.none).toconfig(); driver driver = graphdatabase.driver( "bolt://localhost", authtokens.basic( "neo4j", "neo4j" ) , nossl); session session = driver.session(); session.run( "match (n) detach delete n" ); statementresult result = session.run( "match (n) return n" ); session.close(); driver.close(); graphdb.shutdown(); }
the error getting :
exception in thread "main" org.neo4j.driver.v1.exceptions.authenticationexception: client unauthorized due authentication failure. @ org.neo4j.driver.internal.net.socketresponsehandler.handlefailuremessage(socketresponsehandler.java:71) @ org.neo4j.driver.internal.messaging.packstreammessageformatv1$reader.unpackfailuremessage(packstreammessageformatv1.java:457) @ org.neo4j.driver.internal.messaging.packstreammessageformatv1$reader.read(packstreammessageformatv1.java:418) @ org.neo4j.driver.internal.net.socketclient.receiveone(socketclient.java:176) @ org.neo4j.driver.internal.net.socketclient.receiveall(socketclient.java:170) @ org.neo4j.driver.internal.net.socketconnection.receiveall(socketconnection.java:200) @ org.neo4j.driver.internal.net.socketconnection.sync(socketconnection.java:155) @ org.neo4j.driver.internal.net.socketconnection.init(socketconnection.java:117) @ org.neo4j.driver.internal.net.concurrencyguardingconnection.init(concurrencyguardingconnection.java:53) @ org.neo4j.driver.internal.net.socketconnector.connect(socketconnector.java:58) @ org.neo4j.driver.internal.net.pooling.socketconnectionpool$connectionsupplier.get(socketconnectionpool.java:203) @ org.neo4j.driver.internal.net.pooling.socketconnectionpool$connectionsupplier.get(socketconnectionpool.java:185) @ org.neo4j.driver.internal.net.pooling.blockingpooledconnectionqueue.acquire(blockingpooledconnectionqueue.java:92) @ org.neo4j.driver.internal.net.pooling.socketconnectionpool.acquireconnection(socketconnectionpool.java:136) @ org.neo4j.driver.internal.net.pooling.socketconnectionpool.acquire(socketconnectionpool.java:75) @ org.neo4j.driver.internal.directdriver.newsessionwithmode(directdriver.java:50) @ org.neo4j.driver.internal.basedriver.session(basedriver.java:64) @ org.neo4j.driver.internal.basedriver.session(basedriver.java:57) @ final_project.app.main(app.java:87)
i think need reset password neo4j done first time neo4j runs.
Comments
Post a Comment