title: Java - Bolt Configuration for Neo4j 3.0.0-M01 Embedded
body: <p>I am using the EMBEDDED version of neo4j 3.0.0-M01 and the neo4j-spark connector for my java project, and i am not able to properly configure bolt.</p>
  
  <p>The instructions on the official github project for the connector (<a href="https://github.com/neo4j-contrib/neo4j-spark-connector" rel="nofollow noreferrer">https://github.com/neo4j-contrib/neo4j-spark-connector</a>) refers only to the case of a running standalone server (on localhost for example), which is not my case.</p>
  
  <p>Here is the snippet of code from my project that is involved in the configuration of bolt:</p>
  
  <pre><code>SparkConf conf = new SparkConf().setAppName("TestApp").setMaster("local[8]");
      conf.set("spark.neo4j.bolt.url","bolt://C/neo4j_test/neo4j-community-3/data/graph-repo.db");
  </code></pre>
  
  <p>If i comment the line containing the conf.set() method,then launch the standalone (not the embedded) neo4j server on localhost on port 7474 and then execute my code, the connection is successful. Otherwise i get this exception:</p>
  
  <pre><code>java.lang.IllegalArgumentException: hostname can't be null
  at java.net.InetSocketAddress.checkHost(Unknown Source)
  at java.net.InetSocketAddress.&lt;init&gt;(Unknown Source)
  at org.neo4j.driver.internal.connector.socket.SocketClient$ChannelFactory.create(SocketClient.java:243)
  at org.neo4j.driver.internal.connector.socket.SocketClient.start(SocketClient.java:75)
  at org.neo4j.driver.internal.connector.socket.SocketConnection.&lt;init&gt;(SocketConnection.java:63)
  at org.neo4j.driver.internal.connector.socket.SocketConnector.connect(SocketConnector.java:52)
  at org.neo4j.driver.internal.pool.InternalConnectionPool.acquire(InternalConnectionPool.java:113)
  at org.neo4j.driver.internal.InternalDriver.session(InternalDriver.java:53)
  at org.neo4j.spark.Executor$.execute(Neo4j.scala:360)
  at org.neo4j.spark.Neo4jRDD.compute(Neo4j.scala:408)
  at org.apache.spark.rdd.RDD.computeOrReadCheckpoint(RDD.scala:319)
  at org.apache.spark.rdd.RDD.iterator(RDD.scala:283)
  at org.apache.spark.scheduler.ResultTask.runTask(ResultTask.scala:70)
  at org.apache.spark.scheduler.Task.run(Task.scala:86)
  at org.apache.spark.executor.Executor$TaskRunner.run(Executor.scala:274)
  at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
  at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
  at java.lang.Thread.run(Unknown Source)
  </code></pre>
  
  <p>Even the Neo4j Manual does not explain how to refer to an embedded instance, as you can see in the following extract from chapter 4: (<a href="https://neo4j.com/docs/developer-manual/current/drivers/" rel="nofollow noreferrer">https://neo4j.com/docs/developer-manual/current/drivers/</a>):</p>
  
  <p>4.3.1.1. Bolt URI format</p>
  
  <p>A Bolt URI follows the standard URI pattern of scheme://host:port. For example, bolt://203.0.113.1:1234 would connect using the Bolt protocol to 203.0.113.1 on port 1234. A hostname can be used instead of an IP address: bolt://server:1234. The default Bolt port is 7687.</p>