java.lang.IllegalStateException

Failed to execute CommandLineRunner

Samebug tips9

To restart the Selenium Webdriver mock browser in a testcase, first use 'driver.close()' and then reinstantiate the driver.

host port isnt set

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.

Solutions on the web3109

  • via GitHub by xenoterracide
    ,
  • via GitHub by xenoterracide
    ,
  • via Stack Overflow by Masi
    ,
  • Stack trace

    • java.lang.IllegalStateException: Failed to execute CommandLineRunner at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:778)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.springframework.boot.SpringApplication.callRunners(SpringApplication.java:759)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.springframework.boot.SpringApplication.afterRefresh(SpringApplication.java:746)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:314)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1161)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.springframework.boot.SpringApplication.run(SpringApplication.java:1150)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at sample.data.neo4j.SampleNeo4jApplication.main(SampleNeo4jApplication.java:60)[classes/:na] at sample.data.neo4j.SampleNeo4jApplicationTests.testDefaultSettings(SampleNeo4jApplicationTests.java:41)[test-classes/:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_102] at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)[junit-4.12.jar:4.12] at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)[junit-4.12.jar:4.12] at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)[junit-4.12.jar:4.12] at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)[junit-4.12.jar:4.12] at org.springframework.boot.test.rule.OutputCapture$1.evaluate(OutputCapture.java:61)[spring-boot-test-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] at org.junit.rules.RunRules.evaluate(RunRules.java:20)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)[junit-4.12.jar:4.12] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)[junit-4.12.jar:4.12] at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)[junit-4.12.jar:4.12] at org.junit.runners.ParentRunner.run(ParentRunner.java:363)[junit-4.12.jar:4.12] at org.junit.runner.JUnitCore.run(JUnitCore.java:137)[junit-4.12.jar:4.12] at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:117)[junit-rt.jar:na] at com.intellij.junit4.JUnit4IdeaTestRunner.startRunnerWithArgs(JUnit4IdeaTestRunner.java:42)[junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.prepareStreamsAndStart(JUnitStarter.java:262)[junit-rt.jar:na] at com.intellij.rt.execution.junit.JUnitStarter.main(JUnitStarter.java:84)[junit-rt.jar:na] Caused by: org.neo4j.ogm.drivers.http.request.HttpRequestException: http://localhost:7474/db/data/transaction/commit: Connect to localhost:7474 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect at org.neo4j.ogm.drivers.http.request.HttpRequest.execute(HttpRequest.java:228)[neo4j-ogm-http-driver-2.0.6-SNAPSHOT.jar:na] at org.neo4j.ogm.drivers.http.request.HttpRequest.executeRequest(HttpRequest.java:168)[neo4j-ogm-http-driver-2.0.6-SNAPSHOT.jar:na] at org.neo4j.ogm.drivers.http.request.HttpRequest.execute(HttpRequest.java:97)[neo4j-ogm-http-driver-2.0.6-SNAPSHOT.jar:na] at org.neo4j.ogm.session.delegates.DeleteDelegate.deleteAll(DeleteDelegate.java:147)[neo4j-ogm-core-2.0.6-SNAPSHOT.jar:na] at org.neo4j.ogm.session.Neo4jSession.deleteAll(Neo4jSession.java:409)[neo4j-ogm-core-2.0.6-SNAPSHOT.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_102] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.support.DelegatingIntroductionInterceptor.doProceed(DelegatingIntroductionInterceptor.java:133)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.support.DelegatingIntroductionInterceptor.invoke(DelegatingIntroductionInterceptor.java:121)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at com.sun.proxy.$Proxy44.deleteAll(Unknown Source)[na:na] at org.springframework.data.neo4j.template.Neo4jTemplate.deleteAll(Neo4jTemplate.java:198)[spring-data-neo4j-4.2.0.M1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_102] at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:333)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:190)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:157)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)[spring-tx-5.0.0.BUILD-20160927.074109-291.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at com.sun.proxy.$Proxy47.deleteAll(Unknown Source)[na:na] at org.springframework.data.neo4j.repository.GraphRepositoryImpl.deleteAll(GraphRepositoryImpl.java:100)[spring-data-neo4j-4.2.0.M1.jar:na] at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)[na:1.8.0_102] at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)[na:1.8.0_102] at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)[na:1.8.0_102] at java.lang.reflect.Method.invoke(Method.java:498)[na:1.8.0_102] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.executeMethodOn(RepositoryFactorySupport.java:503)[spring-data-commons-1.13.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.doInvoke(RepositoryFactorySupport.java:488)[spring-data-commons-1.13.0.M1.jar:na] at org.springframework.data.repository.core.support.RepositoryFactorySupport$QueryExecutorMethodInterceptor.invoke(RepositoryFactorySupport.java:460)[spring-data-commons-1.13.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.data.projection.DefaultMethodInvokingMethodInterceptor.invoke(DefaultMethodInvokingMethodInterceptor.java:61)[spring-data-commons-1.13.0.M1.jar:na] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:99)[spring-tx-5.0.0.BUILD-20160927.074109-291.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:281)[spring-tx-5.0.0.BUILD-20160927.074109-291.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)[spring-tx-5.0.0.BUILD-20160927.074109-291.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.dao.support.PersistenceExceptionTranslationInterceptor.invoke(PersistenceExceptionTranslationInterceptor.java:136)[spring-tx-5.0.0.BUILD-20160927.074109-291.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.interceptor.ExposeInvocationInterceptor.invoke(ExposeInvocationInterceptor.java:92)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:179)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:213)[spring-aop-5.0.0.BUILD-20160927.074109-292.jar:5.0.0.BUILD-SNAPSHOT] at com.sun.proxy.$Proxy50.deleteAll(Unknown Source)[na:na] at sample.data.neo4j.SampleNeo4jApplication.run(SampleNeo4jApplication.java:33)[classes/:na] at org.springframework.boot.SpringApplication.callRunner(SpringApplication.java:775)[spring-boot-2.0.0.BUILD-20160927.081730-14.jar:2.0.0.BUILD-SNAPSHOT] ... 31 more Caused by: org.apache.http.conn.HttpHostConnectException: Connect to localhost:7474 [localhost/127.0.0.1, localhost/0:0:0:0:0:0:0:1] failed: Connection refused: connect at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:158)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:82)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:107)[httpclient-4.5.2.jar:4.5.2] at org.neo4j.ogm.drivers.http.request.HttpRequest.execute(HttpRequest.java:192)[neo4j-ogm-http-driver-2.0.6-SNAPSHOT.jar:na] ... 82 more Caused by: java.net.ConnectException: Connection refused: connect at java.net.DualStackPlainSocketImpl.connect0(Native Method)[na:1.8.0_102] at java.net.DualStackPlainSocketImpl.socketConnect(DualStackPlainSocketImpl.java:79)[na:1.8.0_102] at java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:350)[na:1.8.0_102] at java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:206)[na:1.8.0_102] at java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:188)[na:1.8.0_102] at java.net.PlainSocketImpl.connect(PlainSocketImpl.java:172)[na:1.8.0_102] at java.net.SocksSocketImpl.connect(SocksSocketImpl.java:392)[na:1.8.0_102] at java.net.Socket.connect(Socket.java:589)[na:1.8.0_102] at org.apache.http.conn.socket.PlainConnectionSocketFactory.connectSocket(PlainConnectionSocketFactory.java:74)[httpclient-4.5.2.jar:4.5.2] at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)[httpclient-4.5.2.jar:4.5.2] ... 92 more

    Write tip

    You have a different solution? A short tip here would help you and many other users who saw this issue last week.

    Users with the same issue

    rprp
    Once,
    Unknown visitor
    Unknown visitorOnce,
    Unknown visitor
    Unknown visitor2 times, last one
    tfrtfr
    Once,
    Unknown visitor
    Unknown visitorOnce,
    983 more bugmates