Skip to content
Russell Keane
Main Navigation HomePosts

Appearance

Sidebar Navigation

2025

February (1)

Dynamically setting prev and next links in Vitepress

2019

November (1)

CloudFormation template failing to deploy

2018

March (1)

Subst'ing a drive in Windows 7 / 10

January (1)

Groovy - unable to resolve class

2017

October (2)

Reordering pages in LIFERAY forms

Spring / ZUUL - Failed to introspect annotated methods

June (1)

Sourcetree stuck on POST (chunked)

March (1)

Turning off Windows 10 ads

2016

December (1)

Failure to install / update ruby gems

July (2)

PostgreSQL - Casting integer to interval

piggly trace- invalid multibyte escape

June (1)

Jenkins stuck on "Retrieving Git references..."

March (1)

Jenkins & Groovy - accessing build parameters

2015

November (2)

Creating a Jenkins slave as a Windows service

Why Jenkins?

On this page

The Problem ​

Working through the spring security tutorial at https://spring.io/guides/tutorials/spring-security-and-angular-js/ and I've found a few issues with the instructions (more on those later perhaps).

The bit that really caused me some issues though was when introducing the API Gateway concept. Following the instructions I added the @EnableZuulProxy to the UIApplication java file:

javascript
    @SpringBootApplication
    @RestController
    @EnableZuulProxy
    public class UIApplication {
        ...

Along with the import statement (not mentioned in the tutorial):

javascript
    import org.springframework.cloud.netflix.zuul.EnableZuulProxy;

And the dependencies in the pom.xml file (as specified in the tutorial):

xml
    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-dependencies</artifactId>
                <version>Camden.SR2</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-starter-zuul</artifactId>
        </dependency>
        ...
    <dependencies>

Now, when building the project I get the following:

shell
    Caused by: java.lang.ClassNotFoundException: org.springframework.boot.context.embedded.ServletRegistrationBean
     at java.net.URLClassLoader.findClass(URLClassLoader.java:381)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:424)
     at java.lang.ClassLoader.loadClass(ClassLoader.java:357)
     ... 31 more
    [INFO] ------------------------------------------------------------------------
    [INFO] BUILD FAILURE
    [INFO] ------------------------------------------------------------------------
    [INFO] Total time: 30.493 s
    [INFO] Finished at: 2017-10-07T09:58:15+01:00
    [INFO] Final Memory: 81M/386M
    [INFO] ------------------------------------------------------------------------
    [ERROR] Failed to execute goal org.springframework.boot:spring-boot-maven-plugin:1.5.6.RELEASE:run (default-cli) on project ui: An exception occurred while running. null: InvocationTargetException: Failed to process import candidates for configuration class [com.test.ui.UIApplication]; nested exception is java.lang.IllegalStateException: Failed to introspect annotated methods on class org.springframework.cloud.netflix.zuul.ZuulConfiguration: org/springframework/boot/context/embedded/ServletRegistrationBean: org.springframework.boot.context.embedded.ServletRegistrationBean -> [Help 1]
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please read the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

The Solution ​

I really struggled to find anything about the error around the internets and the solution was so simple...

Within the pom.xml (from the github version of the tutorial pom), the version should be:

xml
    <version>Dalston.SR2</version>

rather than:

xml
    <version>Camden.SR2</version>

That's it. So simple.

Pager
Previous pageSourcetree stuck on POST (chunked)
Next pageReordering pages in LIFERAY forms

All views expressed are my own

Copyright © 2015-present Russell Keane