Exception while staring spring boot application in Vertx3

546 views
Skip to first unread message

Krishnaprasad Narayanan

unread,
Mar 23, 2016, 2:34:53 AM3/23/16
to vert.x

I am trying to deploy services which are developed using Spring Boot in vertx framework.


The services are developed in Spring Boot and deployed using Gradle. The following is my development environment 

a) Java version - 1.8 

b) Spring boot version - 1.2.8.RELEASE 

c) Gradle version - 2.0 

d) Vertx version - 3.2.1.


The vertx application is launched using the command vertx run samplevertx.java -cp sampleFAT.jar. When I start the vertx application, the following exception is thrown


WARN  o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Exception encountered during context initialization - cancelling refresh attempt: org.springframework.context.ApplicationContextException: Unable to start embedded container.

        nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

        ERROR o.s.boot.SpringApplication - Application startup failed

        org.springframework.context.ApplicationContextException: Unable to start embedded container 

        nested exception is org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.

        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.onRefresh(EmbeddedWebApplicationContext.java:133)

        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:474)

        at org.springframework.boot.context.embedded.EmbeddedWebApplicationContext.refresh(EmbeddedWebApplicationContext.java:118)

        at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:690)

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:322)

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:970) 

        at org.springframework.boot.SpringApplication.run(SpringApplication.java:959) 

        at io.vertx.core.AbstractVerticle.start(AbstractVerticle.java:111) [vertx-core-3.2.1.jar:na]

        at io.vertx.core.impl.DeploymentManager.lambda$doDeploy$163(DeploymentManager.java:429) [vertx-core-3.2.1.jar:na]

        at io.vertx.core.impl.ContextImpl.lambda$wrapTask$18(ContextImpl.java:335) ~[vertx-core-3.2.1.jar:na]

        at io.vertx.core.impl.OrderedExecutorFactory$OrderedExecutor.lambda$new$265(OrderedExecutorFactory.java:91) ~[vertx-core-3.2.1.jar:na]

        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) ~[na:1.8.0_73]

        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) ~[na:1.8.0_73]

        at java.lang.Thread.run(Thread.java:745) ~[na:1.8.0_73]

        Caused by: org.springframework.context.ApplicationContextException: Unable to start EmbeddedWebApplicationContext due to missing EmbeddedServletContainerFactory bean.


I tried the following solutions posted in StackOverflow forum but I had no luck.

Solution 1Solution 2Solution 3 and Solution 4.


I have added the necessary annotations and the dependencies in build.gradle file however, the problem still persists.


Can somebody in the forum help me resolve this problem?


Thanks,

Krishnaprasad

Krishnaprasad Narayanan

unread,
Mar 23, 2016, 9:35:05 AM3/23/16
to vert.x
I found that I had a few dependencies which was in the Reference Libraries and not added to the Gradle dependencies when the application was build. I specified these dependencies to the build.gradle and it worked.

May I know how to specify an input argument to a FAT jar while starting the vertx application?

Something like vertx <sample.java> -cp <FAT.jar> <input to the FAT jar> 

Kishore Dubey

unread,
Apr 8, 2016, 5:45:58 PM4/8/16
to vert.x
You can pass a whole configuration file as argument, below is the syntax:

vertx <sample.java> -cp <FAT.jar> -conf src/main/resources/app-conf.json
Reply all
Reply to author
Forward
0 new messages