title: java.net.ConnectException: Connection refused: connect Solr with Spring boot
body: <p>I am new to solr. I am try to get record from table using rest call using solr spring data tool. But when I am try to request url from browser then I am get the following error.</p>
  
  <pre><code>java.net.ConnectException: Connection refused: connect
      at java.net.DualStackPlainSocketImpl.connect0(Native Method) ~[na:1.8.0_25]
      at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79) ~[na:1.8.0_25]
      at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:345) ~[na:1.8.0_25]
      at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206) ~[na:1.8.0_25]
      at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188) ~[na:1.8.0_25]
      at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172) ~[na:1.8.0_25]
      at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392) ~[na:1.8.0_25]
      at java.net.Socket.connect(Socket.java:589) ~[na:1.8.0_25]
  </code></pre>
  
  <p>My code is like as:</p>
  
  <p>User Object:</p>
  
  <pre><code>public class User {
  
      @Field
      private String id;
  
      @Field
      private String fName;
  
      @Field
      private String lName;
  
      public String getId() {
          return id;
      }
  
      public void setId(String id) {
          this.id = id;
      }
  
      public String getfName() {
          return fName;
      }
  
      public void setfName(String fName) {
          this.fName = fName;
      }
  
      public String getlName() {
          return lName;
      }
  
      public void setlName(String lName) {
          this.lName = lName;
      }
  }
  </code></pre>
  
  <p>UserDao:</p>
  
  <pre><code>public interface UserDao extends SolrCrudRepository&lt;User, Long&gt; {
  
  }
  </code></pre>
  
  <p>UserController:</p>
  
  <pre><code>@RestController
  @RequestMapping("/app/api")
  public class UserController {
  
      @Autowired
      private UserDao userDao;
  
      @RequestMapping(value = "/users", method = RequestMethod.GET)
      public AjaxResponse loadAll() throws IOException {
  
          List&lt;User&gt; users = (List&lt;User&gt;) userDao.findAll();
          return new AjaxResponse("Success", false, users);
      }
  }
  </code></pre>
  
  <p>Aplication.properties file:</p>
  
  <pre><code>server.port=9111
  
  spring.datasource.driver-class-name=com.mysql.jdbc.Driver
  spring.datasource.url=jdbc:mysql://127.0.0.1:3306/solrDatabase?autoReconnect=true
  spring.datasource.username=root
  spring.datasource.password=root
  
  spring.data.solr.host=http://localhost:8983/solr/
  spring.data.solr.repositories.enabled=true
  </code></pre>
  
  <p>When I am try to request this url:
  <a href="http://localhost:9111/app/api/users" rel="nofollow noreferrer">http://localhost:9111/app/api/users</a>
  Then I am getting exception. Can any one help me.</p>