title: How to fix "Error creating bean with name"
body: <p>My website is/was working just fine. But I am being forced to upgrade the OS of the servers it runs on, because the newer version of a piece of software I need to upgrade, won't run on the old OS. So, now I am in dependency hell.</p>
  
  <p>So, on a test server, I've upgraded the OS from Ubuntu 14.04 to 18.04.1 . I was also forced to use a later version of Java from:</p>
  
  <pre><code>echo $JAVA_HOME
  /usr/lib/jvm/java-7-oracle
  </code></pre>
  
  <p>to</p>
  
  <pre><code>echo $JAVA_HOME
  /usr/lib/jvm/java-11-openjdk-amd64/
  </code></pre>
  
  <p>And the version of Tomcat from 7 to 8. </p>
  
  <p>Having fiddled a bit (I started this in January, but have only just been able to get back to it, so I can't remember what exactly, though can search the history for clues if required), I can build my application OK, but it fails at the final hurdle:</p>
  
  <blockquote>
    <p>BUILD SUCCESSFUL Total time: 19 seconds Using CATALINA_BASE:<br>
    /var/lib/tomcat8 Using CATALINA_HOME:   /usr/share/tomcat8 Using
    CATALINA_TMPDIR: /var/lib/tomcat8/temp Using JRE_HOME:<br>
    /usr/lib/jvm/java-11-openjdk-amd64/ Using CLASSPATH:<br>
    /usr/share/tomcat8/bin/bootstrap.jar:/usr/share/tomcat8/bin/tomcat-juli.jar
    Using CATALINA_PID:    /root/catalina.pid Tomcat started.
    --2019-05-28 16:10:16--  <a href="http://localhost:8080/" rel="nofollow noreferrer">http://localhost:8080/</a> Resolving localhost (localhost)... 127.0.0.1 Connecting to localhost
    (localhost)|127.0.0.1|:8080... connected. HTTP request sent, awaiting
    response... 404 2019-05-28 16:10:16 ERROR 404: (no description).</p>
  </blockquote>
  
  <p>Further investigation reveals:</p>
  
  <pre><code>less /var/log/tomcat8/catalina.out
  </code></pre>
  
  <blockquote>
    <p>2019-05-28 16:10:06.418 UTC [localhost-startStop-1] ERROR
    org.springframework.web.context.ContextLoader - Context initialization
    failed org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'embedController' defined in ServletContext
    resource [/WEB-INF/playground-servlet.xml]: Cannot resolve reference
    to bean 'homeController' while settin g bean property
    'homeController'; nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'homeController' defined in ServletContext
    resource [/WEB-INF/playground-servlet.xml]: Cannot re solve reference
    to bean 'execService' while setting bean property 'execService';
    nested exception is
    org.springframework.beans.factory.BeanCreationException: Error
    creating bean with name 'execService': Invocation of init method
    failed; nested exception is javax.ws.rs.ProcessingException:
    java.net.ConnectException: Connection refused (Connection refused)
            at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:326)
    ~[spring-beans-3.2.8.RELEASE.jar:3.2.8.RELEASE]</p>
  </blockquote>
  
  <p>It should be abundantly clear by now that I don't have much clue what I'm doing. I have spent the afternoon doing lots of googling and looking at lots of Stack Overflow answers, but nothing seems relevant. </p>