[keycloak-user] app-authz-rest-employee example generates error during mvn spring-boot:run

Bruno Oliveira bruno at abstractj.org
Fri May 17 16:10:15 EDT 2019


Looking at the steps you provided, to me it looks like you're starting
WildFly and Sprint boot on the same port (8080). Try to change the
WildFly port or Spring boot and see if it works.

On 2019-05-17, Olivier Rivat wrote:
> 
> 
> Hi,
> 
> I am trying to bring the app-authz-rest-employee example, but is failing 
> when trying to luanch mvn spring-boot:run
> https://github.com/keycloak/keycloak-quickstarts/tree/latest/app-authz-rest-employee
> 
> 
> 1) keycloak is started with
> 
> cd {KEYCLOAK_HOME}/bin
> ./standalone.sh -Djboss.socket.binding.port-offset=100
> 
> 2) wilfly is started with
> sh stanalone.sh (port 8080)
> 
> 
> 3)launching maven
> mvn spring-boot:run
> 
> I obtain following errors
> 
>    at java.lang.Thread.run (Thread.java:745)
> Caused by: 
> org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: 
> Connector configured to listen on port 8080 failed to start
>      at 
> org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkThatConnectorsHaveStarted 
> (TomcatWebServer.java:228)
> 
> 
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:run 
> (default-cli) on project app-authz-rest-employee: An exception occurred 
> while running. null: InvocationTargetException: Connector configured to 
> listen on port 8080 failed to start -> [Help 1]
> org.apache.maven.lifecycle.LifecycleExecutionException: Failed to 
> execute goal 
> org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:run 
> (default-cli) on project app-authz-rest-employee: An exception occurred 
> while running. null
>      at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:215)
>      at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:156)
>      at org.apache.maven.lifecycle.internal.MojoExecutor.execute 
> (MojoExecutor.java:148)
>      at 
> org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject 
> (Lifecyc
> 
> 
> What do you think about it ? Did I mistake following README fiel of 
> example ?
> 
> 
> 
> Regards,
> 
> Olivier
> 
> =============================================================================================================================
> 
> Full stack trace
> 
> mvn spring-boot:run
> [INFO] Scanning for projects...
> [WARNING]
> [WARNING] Some problems were encountered while building the effective 
> model for org.keycloak.quickstarts:app-authz-rest-employee:jar:6.0.1
> [WARNING] 'build.plugins.plugin.version' for 
> org.springframework.boot:spring-boot-maven-plugin is missing. @ 
> org.keycloak.quickstarts:app-authz-rest-employee:[unknown-version], 
> /home/orivat/dev/keycloak_6.01/keycloak-quickstarts-latest/app-authz-rest-employee/pom.xml, 
> line 106, column 21
> [WARNING]
> [WARNING] It is highly recommended to fix these problems because they 
> threaten the stability of your build.
> [WARNING]
> [WARNING] For this reason, future Maven versions might no longer support 
> building such malformed projects.
> [WARNING]
> [INFO]
> [INFO] ----------< org.keycloak.quickstarts:app-authz-rest-employee 
>  >----------
> [INFO] Building Spring Boot Web Keycloak Authorization Services Sample 6.0.1
> [INFO] --------------------------------[ jar 
> ]---------------------------------
> [INFO]
> [INFO] >>> spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) > 
> test-compile @ app-authz-rest-employee >>>
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
> app-authz-rest-employee ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 1 resource
> [INFO]
> [INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ 
> app-authz-rest-employee ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] --- maven-resources-plugin:2.6:testResources 
> (default-testResources) @ app-authz-rest-employee ---
> [INFO] Using 'UTF-8' encoding to copy filtered resources.
> [INFO] Copying 2 resources
> [INFO]
> [INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ 
> app-authz-rest-employee ---
> [INFO] Nothing to compile - all classes are up to date
> [INFO]
> [INFO] <<< spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) < 
> test-compile @ app-authz-rest-employee <<<
> [INFO]
> [INFO]
> [INFO] --- spring-boot-maven-plugin:2.1.3.RELEASE:run (default-cli) @ 
> app-authz-rest-employee ---
> [WARNING]
> java.lang.reflect.InvocationTargetException
>      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>      at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>      at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>      at java.lang.reflect.Method.invoke (Method.java:498)
>      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run 
> (AbstractRunMojo.java:558)
>      at java.lang.Thread.run (Thread.java:745)
> Caused by: 
> org.springframework.boot.web.embedded.tomcat.ConnectorStartFailedException: 
> Connector configured to listen on port 8080 failed to start
>      at 
> org.springframework.boot.web.embedded.tomcat.TomcatWebServer.checkThatConnectorsHaveStarted 
> (TomcatWebServer.java:228)
>      at 
> org.springframework.boot.web.embedded.tomcat.TomcatWebServer.start 
> (TomcatWebServer.java:203)
>      at 
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.startWebServer 
> (ServletWebServerApplicationContext.java:300)
>      at 
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.finishRefresh 
> (ServletWebServerApplicationContext.java:162)
>      at 
> org.springframework.context.support.AbstractApplicationContext.refresh 
> (AbstractApplicationContext.java:553)
>      at 
> org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh 
> (ServletWebServerApplicationContext.java:140)
>      at org.springframework.boot.SpringApplication.refresh 
> (SpringApplication.java:759)
>      at org.springframework.boot.SpringApplication.refreshContext 
> (SpringApplication.java:395)
>      at org.springframework.boot.SpringApplication.run 
> (SpringApplication.java:327)
>      at org.springframework.boot.SpringApplication.run 
> (SpringApplication.java:1255)
>      at org.springframework.boot.SpringApplication.run 
> (SpringApplication.java:1243)
>      at org.keycloak.quickstart.springboot.MyApplication.main 
> (MyApplication.java:31)
>      at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method)
>      at sun.reflect.NativeMethodAccessorImpl.invoke 
> (NativeMethodAccessorImpl.java:62)
>      at sun.reflect.DelegatingMethodAccessorImpl.invoke 
> (DelegatingMethodAccessorImpl.java:43)
>      at java.lang.reflect.Method.invoke (Method.java:498)
>      at org.springframework.boot.maven.AbstractRunMojo$LaunchRunner.run 
> (AbstractRunMojo.java:558)
>      at java.lang.Thread.run (Thread.java:745)
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] BUILD FAILURE
> [INFO] 
> ------------------------------------------------------------------------
> [INFO] Total time:  4.711 s
> [INFO] Finished at: 2019-05-17T18:53:20+02:00
> [INFO] 
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal 
> org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE:run 
> (default-cli) on project app-authz-rest-employee: An exception occurred 
> while running. null: InvocationTargetException: Connector configured to 
> listen on port 8080 failed to start -> [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
> 
> 
> 
> 
> -- 
> 
> 
> <http://www.janua.fr/images/logo-big-sans.png><http://www.janua.fr/images/LogoSignature.gif>
> 
> 	<http://www.janua.fr/images/6g_top.gif>
> 	
> Olivier Rivat
> CTO
> orivat at janua.fr <mailto:dchikhaoui at janua.fr>
> Gsm: +33(0)682 801 609
> Tél: +33(0)489 829 238
> Fax: +33(0)955 260 370
> http://www.janua.fr <http://www.janua.fr/>
> 	<http://www.janua.fr/images/6g_top.gif>
> 
> 
> _______________________________________________
> keycloak-user mailing list
> keycloak-user at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/keycloak-user

-- 

abstractj


More information about the keycloak-user mailing list