title: 'Error 401 Unauthorized' for Neo4j REST url on Heroku
body: <p>I am using correct <code>NEO4J_URL</code> environment variable as shown in <code>heroku config</code>. 
  If I use the same neo4j url via a browser, it works fine (no auth failure). However my application fails to start with below error on heroku. (I am using spring-data-neo4j)</p>
  
  <p>The URL looks like <code>http://username:password@123456ac6.hosted.neo4j.org:1234/db/data/</code>. Tried without '/db/data' at the end and also with and without trailing slash. Didn't help.</p>
  
  <p>Please help if anyone has already faced/resolved this issue. The stack trace on server startup:</p>
  
  <pre><code>←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m Caused by:
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.index.RestIndexManager.existsForNodes(RestIndexManager.java:45)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m java.lang.RuntimeException: Error reading as JSON '&lt;html&gt;|&lt;head&gt;|&lt;meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/&gt;|&lt;tit
  le&gt;Error 401 UNAUTHORIZED&lt;/title&gt;|&lt;/head&gt;|&lt;body&gt;&lt;h2&gt;HTTP ERROR 401&lt;/h2&gt;|&lt;p&gt;Problem accessing /db/data/index/node. Reason:|&lt;pre&gt;    UNAUTHORIZED&lt;/pre&gt;&lt;/p&gt;&lt;hr /&gt;&lt;i&gt;&lt;small&gt;Powered by Jetty://&lt;/
  small&gt;&lt;/i&gt;&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;
                                     |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;
         |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;
                                   |&lt;br/&gt;                                                |&lt;br/&gt;
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.util.JsonHelper.jsonToSingleValue(JsonHelper.java:62)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.RequestResult.toEntity(RequestResult.java:114)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m                      |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;
                                          |&lt;br/&gt;                                                |&lt;br/&gt;                                                |&lt;br/&gt;
              |&lt;br/&gt;                                                ||&lt;/body&gt;|&lt;/html&gt;|'
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.RequestResult.toMap(RequestResult.java:120)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.util.JsonHelper.readJson(JsonHelper.java:57)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.index.RestIndexManager.indexInfo(RestIndexManager.java:50)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.springframework.data.neo4j.support.typerepresentation.TypeRepresentationStrategyFactory.chooseStrategy(TypeRepresentationStrategyFactor
  y.java:56)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.neo4j.rest.graphdb.ExecutingRestAPI.indexInfo(ExecutingRestAPI.java:327)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.springframework.data.neo4j.config.Neo4jConfiguration$$EnhancerByCGLIB$$36bc2a37.CGLIB$typeRepresentationStrategyFactory$7(&lt;generated&gt;)
  ←[36m2013-03-06T23:44:31+00:00 app[web.1]:←[0m  at org.springframework.data.neo4j.rest.SpringRestGraphDatabase.getIndex(SpringRestGraphDatabase.java:100
  </code></pre>